Merge pull request #3267 from ethereum/docker_manual

Manual deploy to docker.
This commit is contained in:
chriseth 2017-12-01 10:25:08 -05:00 committed by GitHub
commit 45ddfa1ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

49
scripts/docker_deploy_manual.sh Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/env sh
set -e
if [ -z "$1" ]
then
echo "Usage: $0 <tag/branch>"
exit 1
fi
branch="$1"
#docker login
DIR=$(mktemp -d)
(
cd "$DIR"
git clone --depth 2 https://github.com/ethereum/solidity.git -b "$branch"
cd solidity
commithash=$(git rev-parse --short=8 HEAD)
echo -n "$commithash" > commit_hash.txt
version=$($(dirname "$0")/get_version.sh)
if [ "$branch" = "release" -o "$branch" = v"$version" ]
then
echo -n > prerelease.txt
else
date -u +"nightly.%Y.%-m.%-d" > prerelease.txt
fi
rm -rf .git
docker build -t ethereum/solc:build -f scripts/Dockerfile .
tmp_container=$(docker create ethereum/solc:build sh)
if [ "$branch" = "develop" ]
then
docker tag ethereum/solc:build ethereum/solc:nightly;
docker tag ethereum/solc:build ethereum/solc:nightly-"$version"-"$commithash"
docker push ethereum/solc:nightly-"$version"-"$commithash";
docker push ethereum/solc:nightly;
elif [ "$branch" = v"$version" ]
then
docker tag ethereum/solc:build ethereum/solc:stable;
docker tag ethereum/solc:build ethereum/solc:"$version";
docker push ethereum/solc:stable;
docker push ethereum/solc:"$version";
else
echo "Not publishing docker image from branch or tag $branch"
fi
)
rm -rf "$DIR"