diff --git a/build.sh b/build.sh index 4605c687f2..57856191b0 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,8 @@ cd $TRAVIS_BUILD_DIR unamestr=`uname` - +echo TRAVIS_BRANCH=$TRAVIS_BRANCH ## Set a branch variable so we can detect the current branch in webpack if we're in staging or develop branch -if [ $unamestr = 'Linux' ] && [ $TRAVIS_BRANCH = 'staging' ] && [ -z $TRAVIS_PULL_REQUEST_BRANCH ] +if [ $unamestr = 'Linux' ] && [ $TRAVIS_BRANCH = 'staging' ] then export BRANCH=$TRAVIS_BRANCH fi diff --git a/deploy.sh b/deploy.sh index 521fffa3bd..0c4b1bf678 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,17 +1,21 @@ # This script clones an existing gh-pages repository and pushes updates # from the newly compiled version into github. # The GITHUB_TOKEN for authentication is stored in the encrypted -# variable in .travis.yml +# variable in .travis.yml. + +# The script assumes final releases are tagged +# using [2-9].[0-9].[0-9]{6} format, for example 2.0.180629 +# Staging releases should always end in -rcx, using the following format: +# .+-rc[1-9]$ -# Clone Repo ############ -#echo "Cloning wallet repo" unamestr=`uname` -echo $unamestr -echo $TRAVIS_TAG -echo $TRAVIS_BRANCH -echo $TRAVIS_PULL_REQUEST_BRANCH -if [[ "$unamestr" == 'Linux' && -n $TRAVIS_TAG && $TRAVIS_BRANCH = 'master' ]] +echo unamestr=$unamestr +echo TRAVIS_TAG=$TRAVIS_TAG +echo TRAVIS_BRANCH=$TRAVIS_BRANCH +echo TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH + +if [[ "$unamestr" == 'Linux' && -n $TRAVIS_TAG && $TRAVIS_BRANCH =~ [2-9]\.[0-9]\.[0-9]{6}$ ]] then ## wallet.bitshares.org subdomain (independent repo) echo "Pushing new wallet subdomain repo" @@ -26,7 +30,7 @@ then git push fi -if [[ "$unamestr" == 'Linux' && -n $TRAVIS_TAG && $TRAVIS_BRANCH = 'staging' ]] +if [[ "$unamestr" == 'Linux' && -n $TRAVIS_TAG && $TRAVIS_BRANCH =~ .+-rc[1-9]$ ]] then ## staging.bitshares.org subdomain (independent repo) echo "Pushing new staging subdomain repo"