diff --git a/deploy-production.sh b/deploy-production.sh index b6fd060..a32c506 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -1,17 +1,26 @@ +#!/bin/bash # Triggers a webhook to update the staging server at staging.fullstack.cash. -#!/bin/bash #echo $DEPLOY_SECRET -echo "Deploy to production...." +# This if statement will only deploy on Jenkins when its testing the master branch. +echo "-->$GIT_BRANCH<--" +if [[ $GIT_BRANCH =~ "master" ]] + then -export DATA="{\"ref\":\"$DEPLOY_SECRET\"}" + echo "Deploying to production...." -#echo $DATA + export DATA="{\"ref\":\"$DEPLOY_SECRET\"}" -curl -X POST http://fullstack.cash:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA -curl -X POST http://fullstack.cash:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA -curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA -curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA + #echo $DATA -echo "...Finished deploying to production." + curl -X POST http://fullstack.cash:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA + curl -X POST http://fullstack.cash:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA + curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA + curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA + + echo "...Finished deploying to production." + + else + echo "Not master, so not deploying." +fi