diff options
author | chriseth <chris@ethereum.org> | 2017-02-10 22:03:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-10 22:03:49 +0800 |
commit | 885b6ed96b580f9bdc214bca279e39dbaa739cf9 (patch) | |
tree | fce0688cab3c33d6075cc630216c2d829eab827d /scripts | |
parent | af8e31b023723bfc6baa224931ef6570cd8d9a32 (diff) | |
parent | 4f6ebae36c03bea6882c77a1c7841095e7c99049 (diff) | |
download | dexon-solidity-885b6ed96b580f9bdc214bca279e39dbaa739cf9.tar.gz dexon-solidity-885b6ed96b580f9bdc214bca279e39dbaa739cf9.tar.zst dexon-solidity-885b6ed96b580f9bdc214bca279e39dbaa739cf9.zip |
Merge pull request #1616 from VoR0220/DockerReleaseAutomation
Docker release automation
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Dockerfile | 22 | ||||
-rwxr-xr-x | scripts/docker_deploy.sh | 16 | ||||
-rwxr-xr-x | scripts/install_deps.sh | 37 | ||||
-rwxr-xr-x | scripts/tests.sh | 4 |
4 files changed, 48 insertions, 31 deletions
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 <chris@ethereum.org> +#Official solidity docker image -RUN \ - apk --no-cache --update add build-base cmake boost-dev git && \ - sed -i -E -e 's/include <sys\/poll.h>/include <poll.h>/' /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 <sys\/poll.h>/include <poll.h>/' /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..c9682c16 --- /dev/null +++ b/scripts/docker_deploy.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; +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 push ethereum/solc:stable; +elif [ "$TRAVIS_TAG" == v"$version"]; then + docker tag ethereum/solc:build ethereum/solc:"$version"; + docker push ethereum/solc:"$version"; +fi diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index f21c48d0..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 @@ -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 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 |