aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/bytecodecompare
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-05-19 21:43:26 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-20 04:08:13 +0800
commit1ce9b91275fedb3a69e68336ba5fb0819dce9ce2 (patch)
tree3faba6d23fa034bba560ad185cdd776411755cb8 /scripts/bytecodecompare
parent7e7c00f7615e6c831ffda6f323c7e51831b27263 (diff)
downloaddexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.tar
dexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.tar.gz
dexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.tar.bz2
dexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.tar.lz
dexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.tar.xz
dexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.tar.zst
dexon-solidity-1ce9b91275fedb3a69e68336ba5fb0819dce9ce2.zip
Make bytecode upload more robust and use date for directory name.
Diffstat (limited to 'scripts/bytecodecompare')
-rwxr-xr-xscripts/bytecodecompare/storebytecode.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh
index 9a40bc6d..b3491cfa 100755
--- a/scripts/bytecodecompare/storebytecode.sh
+++ b/scripts/bytecodecompare/storebytecode.sh
@@ -87,18 +87,27 @@ EOF
eval `ssh-agent -s`
ssh-add deploy_key
+ COMMIT_DATE=$(cd "$REPO_ROOT" && git show -s --format="%cd" --date=short "$TRAVIS_COMMIT")
+
git clone --depth 2 git@github.com:ethereum/solidity-test-bytecode.git
cd solidity-test-bytecode
git config user.name "travis"
git config user.email "chris@ethereum.org"
git clean -f -d -x
- mkdir -p "$TRAVIS_COMMIT"
- REPORT="$TRAVIS_COMMIT/$ZIP_SUFFIX.txt"
+ DIRECTORY=$COMMIT_DATE"_"$TRAVIS_COMMIT
+ mkdir -p "$DIRECTORY"
+ REPORT="$DIRECTORY/$ZIP_SUFFIX.txt"
cp ../report.txt "$REPORT"
- git add "$REPORT"
- git commit -a -m "Added report $REPORT"
- git push origin
+ # Only push if adding actually worked, i.e. there were changes.
+ if git add "$REPORT"
+ then
+ git commit -a -m "Added report $REPORT"
+ git pull --rebase
+ git push origin
+ else
+ echo "Adding report failed, it might already exist in the repository."
+ fi
fi
)
rm -rf "$TMPDIR" \ No newline at end of file