From 1ce9b91275fedb3a69e68336ba5fb0819dce9ce2 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 19 May 2017 15:43:26 +0200 Subject: Make bytecode upload more robust and use date for directory name. --- scripts/bytecodecompare/storebytecode.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'scripts/bytecodecompare/storebytecode.sh') 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 -- cgit From e12b9900380780d2fb3edab21cbfabdc45ecfdfe Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 May 2017 11:03:38 +0100 Subject: Move COMMIT_DATE --- scripts/bytecodecompare/storebytecode.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/bytecodecompare/storebytecode.sh') diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index b3491cfa..057eaf0c 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -34,6 +34,10 @@ TMPDIR=$(mktemp -d) ( cd "$REPO_ROOT" REPO_ROOT=$(pwd) # make it absolute + + echo "Running for commit $TRAVIS_COMMIT" + COMMIT_DATE=$(git show -s --format="%cd" --date=short "$TRAVIS_COMMIT") + cd "$TMPDIR" "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/ @@ -87,8 +91,6 @@ 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" -- cgit From 0ca941942b78aaa4b9b71b0fccc41d2cfdb9551a Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 24 May 2017 14:36:46 +0200 Subject: Use HEAD for report directory name --- scripts/bytecodecompare/storebytecode.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'scripts/bytecodecompare/storebytecode.sh') diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index 057eaf0c..653c86ba 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -34,10 +34,6 @@ TMPDIR=$(mktemp -d) ( cd "$REPO_ROOT" REPO_ROOT=$(pwd) # make it absolute - - echo "Running for commit $TRAVIS_COMMIT" - COMMIT_DATE=$(git show -s --format="%cd" --date=short "$TRAVIS_COMMIT") - cd "$TMPDIR" "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/ @@ -97,9 +93,9 @@ EOF git config user.email "chris@ethereum.org" git clean -f -d -x - DIRECTORY=$COMMIT_DATE"_"$TRAVIS_COMMIT - mkdir -p "$DIRECTORY" - REPORT="$DIRECTORY/$ZIP_SUFFIX.txt" + DIRNAME=$(cd "$REPO_ROOT" && git show -s --format="%cd-H" --date=short) + mkdir -p "$DIRNAME" + REPORT="$DIRNAME/$ZIP_SUFFIX.txt" cp ../report.txt "$REPORT" # Only push if adding actually worked, i.e. there were changes. if git add "$REPORT" @@ -112,4 +108,4 @@ EOF fi fi ) -rm -rf "$TMPDIR" \ No newline at end of file +rm -rf "$TMPDIR" -- cgit From 6d8afab9287df3d4dbb2b4c012cf4218b0fab4f3 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 29 May 2017 15:53:15 +0200 Subject: Use actual hash. --- scripts/bytecodecompare/storebytecode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/bytecodecompare/storebytecode.sh') diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index 653c86ba..564de3f8 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -93,7 +93,7 @@ EOF git config user.email "chris@ethereum.org" git clean -f -d -x - DIRNAME=$(cd "$REPO_ROOT" && git show -s --format="%cd-H" --date=short) + DIRNAME=$(cd "$REPO_ROOT" && git show -s --format="%cd-%H" --date=short) mkdir -p "$DIRNAME" REPORT="$DIRNAME/$ZIP_SUFFIX.txt" cp ../report.txt "$REPORT" -- cgit