From c4085fb92906c284bc9819b95a013c856b128693 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 20:40:06 -0800 Subject: [PATCH 1/9] Updating deploy script for Jenkins --- deploy-production.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/deploy-production.sh b/deploy-production.sh index b6fd060..9dc4a9f 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -3,15 +3,20 @@ #!/bin/bash #echo $DEPLOY_SECRET -echo "Deploy to production...." +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." + +fi From 8e4592826f6109de674077c6a245eed02f776448 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 20:47:38 -0800 Subject: [PATCH 2/9] Testing CI --- deploy-production.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy-production.sh b/deploy-production.sh index 9dc4a9f..cbd34a7 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -3,6 +3,7 @@ #!/bin/bash #echo $DEPLOY_SECRET +# This if statement will only deploy on Jenkins when its testing the master branch. if [ $GIT_BRANCH == master ] then From 840e92e54c9d2cb7eed8ce1b756ab7fe6c560200 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 21:00:05 -0800 Subject: [PATCH 3/9] testing ci --- deploy-production.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy-production.sh b/deploy-production.sh index cbd34a7..d9ab197 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -20,4 +20,6 @@ if [ $GIT_BRANCH == master ] echo "...Finished deploying to production." + else + echo "Not master, so not deploying." fi From 6c8a156f371c5b26321357680b93bf941e1c0bd6 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 21:24:45 -0800 Subject: [PATCH 4/9] testing ci --- deploy-production.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-production.sh b/deploy-production.sh index d9ab197..bd41466 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -4,7 +4,7 @@ #echo $DEPLOY_SECRET # This if statement will only deploy on Jenkins when its testing the master branch. -if [ $GIT_BRANCH == master ] +if [ $GIT_BRANCH == 'origin/master' ] then echo "Deploying to production...." From 2bfad5d261736a0df1e23296f9f571b754738a42 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 21:34:04 -0800 Subject: [PATCH 5/9] testing ci --- deploy-production.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy-production.sh b/deploy-production.sh index bd41466..93d9eb8 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -4,6 +4,7 @@ #echo $DEPLOY_SECRET # This if statement will only deploy on Jenkins when its testing the master branch. +echo -->$GIT_BRANCH<-- if [ $GIT_BRANCH == 'origin/master' ] then From ec2fb8e24ff09a5587250326db38c7696eecac57 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 21:50:34 -0800 Subject: [PATCH 6/9] testing ci --- deploy-production.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-production.sh b/deploy-production.sh index 93d9eb8..5f7468d 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -4,7 +4,7 @@ #echo $DEPLOY_SECRET # This if statement will only deploy on Jenkins when its testing the master branch. -echo -->$GIT_BRANCH<-- +echo "-->$GIT_BRANCH<--" if [ $GIT_BRANCH == 'origin/master' ] then From 91e5423dd25d60fe2389d74b6766b6a10ce515d1 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 7 Nov 2020 21:59:20 -0800 Subject: [PATCH 7/9] Debugging deployment from CI --- deploy-production.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-production.sh b/deploy-production.sh index 5f7468d..b7fc712 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -5,7 +5,7 @@ # This if statement will only deploy on Jenkins when its testing the master branch. echo "-->$GIT_BRANCH<--" -if [ $GIT_BRANCH == 'origin/master' ] +if [[ $GIT_BRANCH == *"master"* ]] then echo "Deploying to production...." From 0b180e02a49afba4fc2923a2ea99cbf7f86cb5a5 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 07:09:08 -0800 Subject: [PATCH 8/9] Debugging deployment from CI --- deploy-production.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-production.sh b/deploy-production.sh index b7fc712..61ac7a3 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -5,7 +5,7 @@ # This if statement will only deploy on Jenkins when its testing the master branch. echo "-->$GIT_BRANCH<--" -if [[ $GIT_BRANCH == *"master"* ]] +if [[ $GIT_BRANCH =~ "master" ]] then echo "Deploying to production...." From 03a4eb1b72aad9d4ea5ada33ff8eea5e78767d41 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 07:17:30 -0800 Subject: [PATCH 9/9] Debugging deployment from CI --- deploy-production.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-production.sh b/deploy-production.sh index 61ac7a3..a32c506 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -1,6 +1,6 @@ +#!/bin/bash # Triggers a webhook to update the staging server at staging.fullstack.cash. -#!/bin/bash #echo $DEPLOY_SECRET # This if statement will only deploy on Jenkins when its testing the master branch.