From 503cf4eaebabf03b8d541bd8f9c9c833daceec63 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 2 Feb 2017 18:52:41 -0600 Subject: reorganize travis Signed-off-by: RJ Catalano --- .travis.yml | 85 ++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index b642d947..eafba71f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,18 @@ branches: - develop - release - /^v[0-9]/ + +env: + global: + - ENCRYPTION_LABEL="6d4541b72666" + - SOLC_BUILD_TYPE=RelWithDebInfo + - SOLC_DOCS=Off + - SOLC_EMSCRIPTEN=Off + - SOLC_INSTALL_DEPS_TRAVIS=On + - SOLC_RELEASE=On + - SOLC_TESTS=On + - SOLC_DOCKER=Off + matrix: include: # Ubuntu 14.04 LTS "Trusty Tahr" @@ -61,10 +73,23 @@ matrix: dist: trusty sudo: required compiler: gcc + before_install: + - sudo apt-get -y install python-sphinx env: - - TRAVIS_DOCS=On - - TRAVIS_RELEASE=Off - - TRAVIS_TESTS=Off + - SOLC_DOCS=On + - SOLC_RELEASE=Off + - SOLC_TESTS=Off + # Docker target, which generates a statically linked alpine image + - os: linux + dist: trusty + sudo: required + services: + - docker + env: + - SOLC_DOCKER=On + - SOLC_INSTALL_DEPS_TRAVIS=Off + - SOLC_RELEASE=Off + - SOLC_TESTS=Off # Emscripten target, which compiles 'solc' to javascript and uploads the resulting .js # files to https://github.com/ethereum/solc-bin. These binaries are used in Browser-Solidity @@ -79,10 +104,10 @@ matrix: before_install: - docker pull trzeci/emscripten:sdk-tag-1.35.4-64bit env: - - TRAVIS_EMSCRIPTEN=On - - TRAVIS_INSTALL_DEPS=Off - - TRAVIS_RELEASE=Off - - TRAVIS_TESTS=Off + - SOLC_EMSCRIPTEN=On + - SOLC_INSTALL_DEPS_TRAVIS=Off + - SOLC_RELEASE=Off + - SOLC_TESTS=Off # OS X Mavericks (10.9) # https://en.wikipedia.org/wiki/OS_X_Mavericks @@ -143,37 +168,18 @@ cache: - $HOME/.local install: - - test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh + - test $SOLC_INSTALL_DEPS_TRAVIS != On || ./scripts/install_deps.sh - test "$TRAVIS_OS_NAME" != "linux" || ./scripts/install_cmake.sh - echo -n "$TRAVIS_COMMIT" > commit_hash.txt + - test $SOLC_DOCKER != On || docker build -t ethereum/solc:build -f ./scripts/Dockerfile . before_script: - - test $TRAVIS_EMSCRIPTEN != On || ./scripts/build_emscripten.sh - - test $TRAVIS_RELEASE != On || (./scripts/build.sh $TRAVIS_BUILD_TYPE + - test $SOLC_EMSCRIPTEN != On || ./scripts/build_emscripten.sh + - test $SOLC_RELEASE != On || (./scripts/build.sh $SOLC_BUILD_TYPE && ./scripts/release.sh $ZIP_SUFFIX && ./scripts/create_source_tarball.sh ) script: - - test $TRAVIS_DOCS != On || ./scripts/docs.sh - - # There are a variety of reliability issues with the Solidity unit-tests at the time of - # writing (especially on macOS), so within TravisCI we will try to run the unit-tests - # up to 3 times before giving up and declaring the tests as broken. - # - # We should aim to remove this "retry logic" as soon as we can, because it is a - # band-aid for issues which need solving at their root. Some of those issues will be - # in Solidity's RPC setup and some will be in 'eth'. It seems unlikely that Solidity - # itself is broken from the failure messages which we are seeing. - # - # More details on known issues at https://github.com/ethereum/solidity/issues/769 - - test $TRAVIS_TESTS != On || (cd $TRAVIS_BUILD_DIR && (./scripts/tests.sh || ./scripts/tests.sh || ./scripts/tests.sh) ) -env: - global: - - ENCRYPTION_LABEL="6d4541b72666" - - TRAVIS_BUILD_TYPE=RelWithDebInfo - - TRAVIS_DOCS=Off - - TRAVIS_EMSCRIPTEN=Off - - TRAVIS_INSTALL_DEPS=On - - TRAVIS_RELEASE=On - - TRAVIS_TESTS=On + - test $SOLC_DOCS != On || ./scripts/docs.sh + - test $SOLC_TESTS != On || (cd $TRAVIS_BUILD_DIR && ./scripts/tests.sh ) deploy: # This is the deploy target for the Emscripten build. @@ -182,14 +188,23 @@ deploy: # Both the build and deploy steps for Emscripten are only run within the Ubuntu # configurations (not for macOS). That is controlled by conditionals within the bash # scripts because TravisCI doesn't provide much in the way of conditional logic. + # This is also the deploy target for the dockerfile. If we are pushing into a develop branch, it will be tagged + # as a nightly and appended the commit of the branch it was pushed in. If we are pushing to master it will + # be tagged as "stable" and given the version tag as well. - provider: script - script: test $TRAVIS_EMSCRIPTEN != On || scripts/release_emscripten.sh + script: test $SOLC_EMSCRIPTEN == On || scripts/release_emscripten.sh + skip_cleanup: true + on: + branch: + - develop + - release + - provider: script + script: test $SOLC_DOCKER != On || ./scripts/docker_deploy.sh skip_cleanup: true on: branch: - develop - release - # This is the deploy target for the native build (Linux and macOS) # which generates ZIPs per commit and the source tarball. # @@ -207,4 +222,4 @@ deploy: on: all_branches: true tags: true - condition: $TRAVIS_RELEASE == On + condition: $SOLC_RELEASE == On \ No newline at end of file -- cgit From 00feec567afbedc0b09805d7226c94c1d96c0c2a Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 2 Feb 2017 18:52:59 -0600 Subject: reorganize deps installation Signed-off-by: RJ Catalano --- scripts/install_deps.sh | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index f21c48d0..869bce35 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -57,7 +57,7 @@ detect_linux_distro() { # extract 'foo' from NAME=foo, only on the line with NAME=foo DISTRO=$(sed -n -e 's/^NAME="\(.*\)\"/\1/p' /etc/os-release) elif [ -f /etc/centos-release ]; then - DISTRO=CentOS + DISTRO=CentOS else DISTRO='' fi @@ -93,19 +93,17 @@ case $(uname -s) in # Check for Homebrew install and abort if it is not installed. brew -v > /dev/null 2>&1 || { echo >&2 "ERROR - solidity requires a Homebrew install. See http://brew.sh."; exit 1; } - brew update - brew upgrade - brew install boost brew install cmake - - # We should really 'brew install' our eth client here, but at the time of writing - # the bottle is known broken, so we will just cheat and use a hardcoded ZIP for - # the time being, which is good enough. The cause of the breaks will go away - # when we commit the repository reorg changes anyway. - curl -L -O https://github.com/bobsummerwill/cpp-ethereum/releases/download/v1.3.0/cpp-ethereum-osx-mavericks-v1.3.0.zip - unzip cpp-ethereum-osx-mavericks-v1.3.0.zip + if ["$CI" = true]; then + brew upgrade cmake + brew tap ethereum/ethereum + brew install cpp-ethereum + brew linkapps cpp-ethereum + else + brew upgrade + fi ;; @@ -207,7 +205,6 @@ case $(uname -s) in # Install "normal packages" sudo apt-get -y update sudo apt-get -y install \ - python-sphinx \ build-essential \ cmake \ g++ \ @@ -311,17 +308,17 @@ case $(uname -s) in sudo apt-get -y update sudo apt-get -y install \ - python-sphinx \ build-essential \ cmake \ git \ libboost-all-dev - - # Install 'eth', for use in the Solidity Tests-over-IPC. - sudo add-apt-repository -y ppa:ethereum/ethereum - sudo add-apt-repository -y ppa:ethereum/ethereum-dev - sudo apt-get -y update - sudo apt-get -y install eth + if [ "$CI" = true ]; then + # Install 'eth', for use in the Solidity Tests-over-IPC. + sudo add-apt-repository -y ppa:ethereum/ethereum + sudo add-apt-repository -y ppa:ethereum/ethereum-dev + sudo apt-get -y update + sudo apt-get -y install eth + fi ;; @@ -397,4 +394,4 @@ case $(uname -s) in echo "If you would like to get your operating system working, that would be fantastic." echo "Drop us a message at https://gitter.im/ethereum/solidity." ;; -esac +esac \ No newline at end of file -- cgit From d76d9d41690b69622b703b7a3f567e830d095f9e Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 2 Feb 2017 18:53:30 -0600 Subject: create automated docker deployment Signed-off-by: RJ Catalano --- scripts/Dockerfile | 22 +++++++++++++--------- scripts/docker_deploy.sh | 17 +++++++++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100755 scripts/docker_deploy.sh diff --git a/scripts/Dockerfile b/scripts/Dockerfile index e34436ed..8be19783 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,12 +1,16 @@ FROM alpine MAINTAINER chriseth +#Official solidity docker image -RUN \ - apk --no-cache --update add build-base cmake boost-dev git && \ - sed -i -E -e 's/include /include /' /usr/include/boost/asio/detail/socket_types.hpp && \ - git clone --depth 1 --recursive -b develop https://github.com/ethereum/solidity && \ - cd /solidity && cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSTATIC_LINKING=1 && \ - cd /solidity && make solc && install -s solc/solc /usr/bin && \ - cd / && rm -rf solidity && \ - apk del sed build-base git make cmake gcc g++ musl-dev curl-dev boost-dev && \ - rm -rf /var/cache/apk/* +#Establish working directory as solidity +WORKDIR /solidity +#Copy working directory on travis to the image +COPY / $WORKDIR + +#Install dependencies, eliminate annoying warnings, and build release, delete all remaining points and statically link. +RUN ./scripts/install_deps.sh && sed -i -E -e 's/include /include /' /usr/include/boost/asio/detail/socket_types.hpp &&\ +cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=0 -DSTATIC_LINKING=1 &&\ +make solc && install -s solc/solc /usr/bin &&\ +cd / && rm -rf solidity &&\ +apk del sed build-base git make cmake gcc g++ musl-dev curl-dev boost-dev &&\ +rm -rf /var/cache/apk/* \ No newline at end of file diff --git a/scripts/docker_deploy.sh b/scripts/docker_deploy.sh new file mode 100755 index 00000000..f4c61601 --- /dev/null +++ b/scripts/docker_deploy.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; +version=version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? $(dirname "$0")/CMakeLists.txt) +if [ "$TRAVIS_BRANCH" == "develop" ]; then + docker tag ethereum/solc:build ethereum/solc:nightly; + docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT" + docker push ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT"; + docker push ethereum/solc:nightly; +elif [ "$TRAVIS_BRANCH" == "release"]; then + docker tag ethereum/solc:build ethereum/solc:stable; + docker tag ethereum/solc:build ethereum/solc:"$version"; + docker tag ethereum/solc:build ethereum/solc: + docker push ethereum/solc; + docker push ethereum/solc:"$version"; + docker push ethereum/solc:stable; +fi \ No newline at end of file -- cgit From d9e7af939ca202975a6dff7537d73614d75f1470 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 2 Feb 2017 18:53:42 -0600 Subject: defeat race condition Signed-off-by: RJ Catalano --- scripts/tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests.sh b/scripts/tests.sh index 8edfda0b..88815f5f 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -58,7 +58,7 @@ $ETH_PATH --test -d /tmp/test & # is available and is ready for the unit-tests to start talking to it. while [ ! -S /tmp/test/geth.ipc ]; do sleep 2; done echo "--> IPC available." - +sleep 2 # And then run the Solidity unit-tests (once without optimization, once with), # pointing to that IPC endpoint. echo "--> Running tests without optimizer..." @@ -69,4 +69,4 @@ ERROR_CODE=$? pkill eth || true sleep 4 pgrep eth && pkill -9 eth || true -exit $ERROR_CODE +exit $ERROR_CODE \ No newline at end of file -- cgit From 7ffc6863fb33775fb95b6ca2994dd769d3db33c3 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 2 Feb 2017 20:57:07 -0600 Subject: edit the documentation for the travis file Signed-off-by: RJ Catalano --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index eafba71f..df8b4ebb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -188,9 +188,7 @@ deploy: # Both the build and deploy steps for Emscripten are only run within the Ubuntu # configurations (not for macOS). That is controlled by conditionals within the bash # scripts because TravisCI doesn't provide much in the way of conditional logic. - # This is also the deploy target for the dockerfile. If we are pushing into a develop branch, it will be tagged - # as a nightly and appended the commit of the branch it was pushed in. If we are pushing to master it will - # be tagged as "stable" and given the version tag as well. + - provider: script script: test $SOLC_EMSCRIPTEN == On || scripts/release_emscripten.sh skip_cleanup: true @@ -198,6 +196,9 @@ deploy: branch: - develop - release + # This is the deploy target for the dockerfile. If we are pushing into a develop branch, it will be tagged + # as a nightly and appended the commit of the branch it was pushed in. If we are pushing to master it will + # be tagged as "stable" and given the version tag as well. - provider: script script: test $SOLC_DOCKER != On || ./scripts/docker_deploy.sh skip_cleanup: true -- cgit From e884f7a4790c498e4b406e42aec5a7f7b4102368 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Tue, 7 Feb 2017 16:20:48 -0600 Subject: minor fixups Signed-off-by: RJ Catalano --- scripts/docker_deploy.sh | 2 +- scripts/install_deps.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docker_deploy.sh b/scripts/docker_deploy.sh index f4c61601..870cca44 100755 --- a/scripts/docker_deploy.sh +++ b/scripts/docker_deploy.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; -version=version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? $(dirname "$0")/CMakeLists.txt) +version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? $(dirname "$0")/CMakeLists.txt) if [ "$TRAVIS_BRANCH" == "develop" ]; then docker tag ethereum/solc:build ethereum/solc:nightly; docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT" diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index 869bce35..7cfc92f2 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -57,7 +57,7 @@ detect_linux_distro() { # extract 'foo' from NAME=foo, only on the line with NAME=foo DISTRO=$(sed -n -e 's/^NAME="\(.*\)\"/\1/p' /etc/os-release) elif [ -f /etc/centos-release ]; then - DISTRO=CentOS + DISTRO=CentOS else DISTRO='' fi -- cgit From e9ae50dc5994a02119655eff4ed488fb3918d41f Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Thu, 9 Feb 2017 11:36:08 -0600 Subject: clarify branches for docker to push on and clarify where to find cmakelists.txt Signed-off-by: RJ Catalano --- scripts/docker_deploy.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/docker_deploy.sh b/scripts/docker_deploy.sh index 870cca44..dcd03f9e 100755 --- a/scripts/docker_deploy.sh +++ b/scripts/docker_deploy.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; -version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? $(dirname "$0")/CMakeLists.txt) +version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? $(dirname "$0")/../CMakeLists.txt) if [ "$TRAVIS_BRANCH" == "develop" ]; then docker tag ethereum/solc:build ethereum/solc:nightly; docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$TRAVIS_COMMIT" @@ -9,9 +9,8 @@ if [ "$TRAVIS_BRANCH" == "develop" ]; then docker push ethereum/solc:nightly; elif [ "$TRAVIS_BRANCH" == "release"]; then docker tag ethereum/solc:build ethereum/solc:stable; + docker push ethereum/solc:stable; +elif [ "$TRAVIS_BRANCH" == v"$version"]; then docker tag ethereum/solc:build ethereum/solc:"$version"; - docker tag ethereum/solc:build ethereum/solc: - docker push ethereum/solc; docker push ethereum/solc:"$version"; - docker push ethereum/solc:stable; fi \ No newline at end of file -- cgit From 4f6ebae36c03bea6882c77a1c7841095e7c99049 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 10 Feb 2017 14:07:46 +0100 Subject: Check for tag in travis. --- scripts/docker_deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docker_deploy.sh b/scripts/docker_deploy.sh index dcd03f9e..c9682c16 100755 --- a/scripts/docker_deploy.sh +++ b/scripts/docker_deploy.sh @@ -10,7 +10,7 @@ if [ "$TRAVIS_BRANCH" == "develop" ]; then elif [ "$TRAVIS_BRANCH" == "release"]; then docker tag ethereum/solc:build ethereum/solc:stable; docker push ethereum/solc:stable; -elif [ "$TRAVIS_BRANCH" == v"$version"]; then +elif [ "$TRAVIS_TAG" == v"$version"]; then docker tag ethereum/solc:build ethereum/solc:"$version"; docker push ethereum/solc:"$version"; -fi \ No newline at end of file +fi -- cgit