diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b5d99c07..33a4487ad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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©_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: @@ -134,3 +159,11 @@ workflows: filters: branches: only: master + - copy_prod_to_staging: + type: approval + requires: + - test + - confirm_deploy_production + filters: + branches: + only: staging