2017-09-05 11:21:18 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# variables
|
2017-11-23 14:29:56 +01:00
|
|
|
PVER="1-9"
|
|
|
|
PTYPE="v1"
|
2017-09-05 11:21:18 +02:00
|
|
|
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
|
2017-11-23 14:29:56 +01:00
|
|
|
PRE_REPO="js-dist-paritytech/parity-${CI_BUILD_REF_NAME}-${PVER}-${PTYPE}.git"
|
|
|
|
PRE_REPO_TOKEN="https://${GITHUB_JS_PRECOMPILED}:@github.com/${PRE_REPO}"
|
2017-11-13 16:51:57 +01:00
|
|
|
BASEDIR=`dirname $0`
|
2017-11-23 14:29:56 +01:00
|
|
|
|
|
|
|
pushd $BASEDIR/..
|
|
|
|
|
|
|
|
echo "*** [$PRE_REPO] Cloning repo"
|
|
|
|
rm -rf precompiled
|
|
|
|
git clone https://github.com/$PRE_REPO precompiled
|
|
|
|
cd precompiled
|
|
|
|
git config push.default simple
|
|
|
|
git config merge.ours.driver true
|
|
|
|
git config user.email "$GITHUB_EMAIL"
|
|
|
|
git config user.name "GitLab Build Bot"
|
|
|
|
git remote set-url origin $PRE_REPO_TOKEN > /dev/null 2>&1
|
|
|
|
|
|
|
|
echo "*** [$PRE_REPO] Copying build"
|
2017-09-05 11:21:18 +02:00
|
|
|
rm -rf build
|
2017-11-23 14:29:56 +01:00
|
|
|
cp -rf ../.dist/build .
|
2017-11-29 18:04:12 +01:00
|
|
|
find . -name "*.css.map" -type f -delete
|
|
|
|
find . -name "*.js.map" -type f -delete
|
2017-11-30 11:12:03 +01:00
|
|
|
find . -name "package.json" -type f -delete
|
2017-11-23 14:29:56 +01:00
|
|
|
|
|
|
|
echo "*** [$PRE_REPO] Adding to git"
|
|
|
|
echo "$UTCDATE" >README.md
|
2017-11-29 15:33:04 +01:00
|
|
|
git add --all .
|
2017-11-23 14:29:56 +01:00
|
|
|
git commit -m "$UTCDATE"
|
2017-09-05 11:21:18 +02:00
|
|
|
|
2017-11-23 14:29:56 +01:00
|
|
|
echo "*** [$PRE_REPO] Pushing upstream"
|
|
|
|
git push --quiet origin HEAD:refs/heads/master > /dev/null 2>&1
|
2017-09-05 11:21:18 +02:00
|
|
|
|
2017-11-23 14:29:56 +01:00
|
|
|
cd ..
|
2017-11-29 14:39:57 +01:00
|
|
|
rm -rf .dist .build .happypack precompiled
|
2017-09-05 11:21:18 +02:00
|
|
|
popd
|
|
|
|
|
|
|
|
# exit with exit code
|
|
|
|
exit 0
|