Skip to content

Commit

Permalink
Add regex to differentiate staging and master build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
svk31 committed Jun 18, 2018
1 parent 282711d commit 5bb41d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 13 additions & 9 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 5bb41d5

Please sign in to comment.