Files
bch-api/deploy-production.sh
T

28 lines
1016 B
Bash
Raw Permalink Normal View History

2020-11-08 07:17:30 -08:00
#!/bin/bash
2020-07-27 21:25:31 -07:00
# Triggers a webhook to update the staging server at staging.fullstack.cash.
#echo $DEPLOY_SECRET
2020-11-07 20:47:38 -08:00
# This if statement will only deploy on Jenkins when its testing the master branch.
2020-11-07 21:50:34 -08:00
echo "-->$GIT_BRANCH<--"
2020-11-08 07:09:08 -08:00
if [[ $GIT_BRANCH =~ "master" ]]
2020-11-07 20:40:06 -08:00
then
2020-07-27 21:25:31 -07:00
2020-11-07 20:40:06 -08:00
echo "Deploying to production...."
2020-07-27 21:25:31 -07:00
2020-11-07 20:40:06 -08:00
export DATA="{\"ref\":\"$DEPLOY_SECRET\"}"
2020-07-27 21:25:31 -07:00
2020-11-07 20:40:06 -08:00
#echo $DATA
2020-07-27 21:25:31 -07:00
2020-11-07 20:40:06 -08:00
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
2020-11-08 13:39:10 -08:00
#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
curl -X POST http://$BCHN_BCHAPI:9000/hooks/bch-api-bchn -H "Content-Type: application/json" -d $DATA
2020-11-07 20:40:06 -08:00
echo "...Finished deploying to production."
2020-11-07 21:00:05 -08:00
else
echo "Not master, so not deploying."
2020-11-07 20:40:06 -08:00
fi