aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/docker_deploy_manual.sh
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-12-01 22:18:39 +0800
committerchriseth <chris@ethereum.org>2017-12-01 22:18:39 +0800
commitf8ef68be1869b2b5a5872839c64d4667aef41c4b (patch)
treebf5fdaee36cebc9efd1f7ff77a5887c2897baa76 /scripts/docker_deploy_manual.sh
parentd0af0c14841648365ad05ecc626e672a16df5b5c (diff)
downloaddexon-solidity-f8ef68be1869b2b5a5872839c64d4667aef41c4b.tar.gz
dexon-solidity-f8ef68be1869b2b5a5872839c64d4667aef41c4b.tar.zst
dexon-solidity-f8ef68be1869b2b5a5872839c64d4667aef41c4b.zip
Manual deploy to docker.
Diffstat (limited to 'scripts/docker_deploy_manual.sh')
-rwxr-xr-xscripts/docker_deploy_manual.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/docker_deploy_manual.sh b/scripts/docker_deploy_manual.sh
new file mode 100755
index 00000000..c098f4ee
--- /dev/null
+++ b/scripts/docker_deploy_manual.sh
@@ -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"