Skip to content

Commit

Permalink
update circle ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianXu20 committed May 23, 2022
1 parent 5fd2e62 commit 5035ec0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,31 @@ jobs:
command: |
echo "Deploying to Heroku. To see progress, go to: https://dashboard.heroku.com/apps/$HEROKU_APP_NAME_PRODUCTION/activity"
curl -sf -X POST -m 900 https://heroku-deploy.torchbox.com/$HEROKU_APP_NAME_PRODUCTION/$CIRCLE_SHA1?key=$DEPLOYMENT_KEY -d "Content-Length: 0"
copy_prod_to_staging:
docker:
- image: buildpack-deps:trusty
steps:
- checkout
- run:
name: update packages
command: 'apt-get update -y'
- run:
name: install curl, jq
command: 'apt-get install -y curl jq'
- run:
name: Send Post request to FlightPath
command: |
export JOB_STATUS=$(curl -f -X POST -m 900
-H "Authorization: Token $FLIGHTPATH_AUTH_KEY" -d "source_key=$DEPLOYMENT_KEY&destination_key=$DEPLOYMENT_KEY&copy_media=1&from_backup=1"
"https://flightpath.torchbox.com/copy/$SOURCE_APP/$DESTINATION_APP/")
echo $JOB_STATUS
export JOB_ID=$(echo $JOB_STATUS | jq -r '.job_id')
echo $JOB_ID
enviroment:
SOURCE_APP: rca-production
DESTINATION_APP: rca-staging

workflows:
version: 2
build-deploy:
Expand Down Expand Up @@ -134,3 +159,11 @@ workflows:
filters:
branches:
only: master
- copy_prod_to_staging:
type: approval
requires:
- test
- confirm_deploy_production
filters:
branches:
only: staging

0 comments on commit 5035ec0

Please sign in to comment.