Fix v1 precompiled (#7033)

* Combine cargo updates into one

* Update log tag
This commit is contained in:
Jaco Greeff 2017-11-13 11:52:34 +01:00 committed by GitHub
parent 399043d37e
commit 0f2bfda830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 116 additions and 119 deletions

View File

@ -690,9 +690,10 @@ js-release:
script: script:
- rustup default stable - rustup default stable
- echo $JS_FILES_MODIFIED - echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS rebuild since no JS files modified."; else ./js/scripts/build.sh && ./js/scripts/release.sh; fi - if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS rebuild since no JS files modified."; else ./js/scripts/build.sh && ./js/scripts/push-precompiled.sh; fi
- echo $JS_OLD_FILES_MODIFIED - echo $JS_OLD_FILES_MODIFIED
- if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS (old) rebuild since no JS files modified."; else ./js-old/scripts/build.sh && ./js-old/scripts/release.sh; fi - if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS (old) rebuild since no JS files modified."; else ./js-old/scripts/build.sh && ./js-old/scripts/push-precompiled.sh; fi
- if [ $JS_FILES_MODIFIED -eq 0 ] || [ $JS_OLD_FILES_MODIFIED -eq 0 ]; then echo "Skipping Cargo update since no JS files modified."; else ./js/scripts/push-cargo.sh; fi
tags: tags:
- javascript - javascript

View File

@ -5,7 +5,6 @@ set -e
UTCDATE=`date -u "+%Y%m%d-%H%M%S"` UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
PRECOMPILED_BRANCH="v1" PRECOMPILED_BRANCH="v1"
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git" GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git"
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"
# setup the git user defaults for the current repo # setup the git user defaults for the current repo
function setup_git_user { function setup_git_user {
@ -22,17 +21,17 @@ pushd $BASEDIR
cd ../.dist cd ../.dist
# add local files and send it up # add local files and send it up
echo "*** [v1] Setting up GitHub config for js-precompiled" echo "*** [v1 precompiled] Setting up GitHub config for js-precompiled"
rm -rf ./.git rm -rf ./.git
git init git init
setup_git_user setup_git_user
echo "*** [v1] Checking out $PRECOMPILED_BRANCH branch" echo "*** [v1 precompiled] Checking out $PRECOMPILED_BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG git fetch origin 2>$GITLOG
git checkout -b $PRECOMPILED_BRANCH git checkout -b $PRECOMPILED_BRANCH
echo "*** [v1] Committing compiled files for $UTCDATE" echo "*** [v1 precompiled] Committing compiled files for $UTCDATE"
mv build ../build.new mv build ../build.new
git add . git add .
git commit -m "$UTCDATE [update]" git commit -m "$UTCDATE [update]"
@ -44,33 +43,10 @@ mv ../build.new build
git add . git add .
git commit -m "$UTCDATE [release]" git commit -m "$UTCDATE [release]"
echo "*** [v1] Merging remote" echo "*** [v1 precompiled] Merging remote"
git push origin HEAD:refs/heads/$PRECOMPILED_BRANCH 2>$GITLOG git push origin HEAD:refs/heads/$PRECOMPILED_BRANCH 2>$GITLOG
PRECOMPILED_HASH=`git rev-parse HEAD`
# move to root # move to root
cd ../..
echo "*** [v1] Setting up GitHub config for parity"
setup_git_user
git remote set-url origin $GIT_PARITY
git reset --hard origin/$BRANCH 2>$GITLOG
echo "*** [v1] Updating cargo parity-ui-old-precompiled#$PRECOMPILED_HASH"
git submodule update
# Not needed since $BRANCH is hardcoded
# sed -i "/^parity-ui-old-precompiled/ { s/branch = \".*\"/branch = \"$BRANCH\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-old-precompiled
# --precise "$PRECOMPILED_HASH"
echo "*** [v1] Committing updated files"
git add dapps/ui/Cargo.toml
git add Cargo.lock
git commit -m "[ci skip] js-precompiled $UTCDATE"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
# back to root
echo "*** [v1] Release completed"
popd popd
# exit with exit code # exit with exit code

View File

@ -1 +1 @@
// test script 10 // test script 11

55
js/scripts/push-cargo.sh Normal file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
# variables
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
BRANCH=$CI_BUILD_REF_NAME
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"
# setup the git user defaults for the current repo
function setup_git_user {
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
}
# change into the build directory
BASEDIR=`dirname $0`
pushd $BASEDIR
echo "*** [cargo] Setting up GitHub config for parity"
setup_git_user
git remote set-url origin $GIT_PARITY
git reset --hard origin/$BRANCH 2>$GITLOG
git submodule update
if [ "$BRANCH" == "master" ]; then
cd js
echo "*** [cargo] Bumping package.json patch version"
npm --no-git-tag-version version
npm version patch
cd ..
git add js
fi
echo "*** [cargo] Updating cargo parity-ui-precompiled"
sed -i "/^parity-ui-precompiled/ { s/branch = \".*\"/branch = \"$BRANCH\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-precompiled
cargo update -p parity-ui-old-precompiled
echo "*** [cargo] Committing updated files"
git add dapps/ui/Cargo.toml
git add Cargo.lock
git commit -m "[ci skip] js-precompiled $UTCDATE"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
# back to root
echo "*** [cargo] Release completed"
popd
# exit with exit code
exit 0

52
js/scripts/push-precompiled.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
set -e
# variables
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
BRANCH=$CI_BUILD_REF_NAME
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git"
# setup the git user defaults for the current repo
function setup_git_user {
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
}
# change into the build directory
BASEDIR=`dirname $0`
GITLOG=./.git/gitcommand.log
pushd $BASEDIR
cd ../.dist
# add local files and send it up
echo "*** [v2 precompiled] Setting up GitHub config"
rm -rf ./.git
git init
setup_git_user
echo "*** [v2 precompiled] Checking out $BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG
git checkout -b $BRANCH
echo "*** [v2 precompiled] Committing compiled files for $UTCDATE"
mv build ../build.new
git add .
git commit -m "$UTCDATE [update]"
git merge origin/$BRANCH -X ours --commit -m "$UTCDATE [merge]"
git rm -r build
rm -rf build
git commit -m "$UTCDATE [cleanup]"
mv ../build.new build
git add .
git commit -m "$UTCDATE [release]"
echo "*** [v2 precompiled] Merging remote"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
popd
# exit with exit code
exit 0

View File

@ -1,87 +0,0 @@
#!/bin/bash
set -e
# variables
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
BRANCH=$CI_BUILD_REF_NAME
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git"
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"
# setup the git user defaults for the current repo
function setup_git_user {
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
}
# change into the build directory
BASEDIR=`dirname $0`
GITLOG=./.git/gitcommand.log
pushd $BASEDIR
cd ../.dist
# add local files and send it up
echo "*** [v2] Setting up GitHub config for js-precompiled"
rm -rf ./.git
git init
setup_git_user
echo "*** [v2] Checking out $BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG
git checkout -b $BRANCH
echo "*** [v2] Committing compiled files for $UTCDATE"
mv build ../build.new
git add .
git commit -m "$UTCDATE [update]"
git merge origin/$BRANCH -X ours --commit -m "$UTCDATE [merge]"
git rm -r build
rm -rf build
git commit -m "$UTCDATE [cleanup]"
mv ../build.new build
git add .
git commit -m "$UTCDATE [release]"
echo "*** [v2] Merging remote"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
PRECOMPILED_HASH=`git rev-parse HEAD`
# move to root
cd ../..
echo "*** [v2] Setting up GitHub config for parity"
setup_git_user
git remote set-url origin $GIT_PARITY
git reset --hard origin/$BRANCH 2>$GITLOG
if [ "$BRANCH" == "master" ]; then
cd js
echo "*** [v2] Bumping package.json patch version"
npm --no-git-tag-version version
npm version patch
cd ..
fi
echo "*** [v2] Updating cargo parity-ui-precompiled#$PRECOMPILED_HASH"
git submodule update
sed -i "/^parity-ui-precompiled/ { s/branch = \".*\"/branch = \"$BRANCH\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-precompiled
# --precise "$PRECOMPILED_HASH"
echo "*** [v2] Committing updated files"
git add js
git add dapps/ui/Cargo.toml
git add Cargo.lock
git commit -m "[ci skip] js-precompiled $UTCDATE"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
# back to root
echo "*** [v2] Release completed"
popd
# exit with exit code
exit 0

View File

@ -1 +1 @@
// test script 15 // test script 16