From 2d2bf996fdc1666bc11a1671ccdcdc3bfa89618d Mon Sep 17 00:00:00 2001 From: Ryan Ling Date: Thu, 7 Jan 2021 16:19:41 +1100 Subject: [PATCH] Enable retry of successful deployment steps (#311) --- .changeset/eleven-phones-reflect.md | 7 +++++++ template/express-rest-api/.buildkite/pipeline.yml | 12 ++++++++++-- template/koa-rest-api/.buildkite/pipeline.yml | 12 ++++++++++-- template/lambda-sqs-worker/.buildkite/pipeline.yml | 5 +++++ 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .changeset/eleven-phones-reflect.md diff --git a/.changeset/eleven-phones-reflect.md b/.changeset/eleven-phones-reflect.md new file mode 100644 index 000000000..2b63eb759 --- /dev/null +++ b/.changeset/eleven-phones-reflect.md @@ -0,0 +1,7 @@ +--- +'skuba': patch +--- + +**template:** Enable retry of successful deployment steps + +This should be used with caution, but may be necessary if you need to rapidly roll back a broken deployment. diff --git a/template/express-rest-api/.buildkite/pipeline.yml b/template/express-rest-api/.buildkite/pipeline.yml index d6dcefbe4..51c221cea 100644 --- a/template/express-rest-api/.buildkite/pipeline.yml +++ b/template/express-rest-api/.buildkite/pipeline.yml @@ -4,6 +4,14 @@ configs: env: NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token + - &deploy + concurrency: 1 + retry: + manual: + # Only use this if you need to roll back a deployment ASAP. + # Always follow up with a proper revert or fix in Git history. + permit_on_passed: true + - &dev agents: queue: <%- devBuildkiteQueueName %> @@ -41,8 +49,8 @@ steps: branches: '!master' - <<: *dev + <<: *deploy label: 🤞 Deploy Dev - concurrency: 1 concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %> plugins: - seek-jobs/gantry#v1.2.9: @@ -56,9 +64,9 @@ steps: - wait - <<: *prod + <<: *deploy label: 🚀 Deploy Prod branches: master - concurrency: 1 concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %> plugins: - seek-jobs/gantry#v1.2.9: diff --git a/template/koa-rest-api/.buildkite/pipeline.yml b/template/koa-rest-api/.buildkite/pipeline.yml index d6dcefbe4..51c221cea 100644 --- a/template/koa-rest-api/.buildkite/pipeline.yml +++ b/template/koa-rest-api/.buildkite/pipeline.yml @@ -4,6 +4,14 @@ configs: env: NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token + - &deploy + concurrency: 1 + retry: + manual: + # Only use this if you need to roll back a deployment ASAP. + # Always follow up with a proper revert or fix in Git history. + permit_on_passed: true + - &dev agents: queue: <%- devBuildkiteQueueName %> @@ -41,8 +49,8 @@ steps: branches: '!master' - <<: *dev + <<: *deploy label: 🤞 Deploy Dev - concurrency: 1 concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %> plugins: - seek-jobs/gantry#v1.2.9: @@ -56,9 +64,9 @@ steps: - wait - <<: *prod + <<: *deploy label: 🚀 Deploy Prod branches: master - concurrency: 1 concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %> plugins: - seek-jobs/gantry#v1.2.9: diff --git a/template/lambda-sqs-worker/.buildkite/pipeline.yml b/template/lambda-sqs-worker/.buildkite/pipeline.yml index b8305fff9..5e966bc24 100644 --- a/template/lambda-sqs-worker/.buildkite/pipeline.yml +++ b/template/lambda-sqs-worker/.buildkite/pipeline.yml @@ -25,6 +25,11 @@ configs: - docker-compose#v3.7.0: dependencies: false run: app + retry: + manual: + # Only use this if you need to roll back a deployment ASAP. + # Always follow up with a proper revert or fix in Git history. + permit_on_passed: true - &dev agents: