-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Group Buildkite pipeline anchors (#474)
- Loading branch information
Showing
5 changed files
with
130 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'skuba': patch | ||
--- | ||
|
||
**template:** Group Buildkite pipeline anchors | ||
|
||
This provides a bit more structure to our `pipeline.yml`s and allows anchored plugins to be recognised by Renovate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,82 @@ | ||
dev-agent: &dev-agent | ||
agents: | ||
queue: <%- devBuildkiteQueueName %> | ||
configs: | ||
environments: | ||
- &dev | ||
agents: | ||
queue: <%- devBuildkiteQueueName %> | ||
|
||
prod-agent: &prod-agent | ||
agents: | ||
queue: <%- prodBuildkiteQueueName %> | ||
- &prod | ||
agents: | ||
queue: <%- prodBuildkiteQueueName %> | ||
|
||
plugins: &plugins | ||
seek-oss/aws-sm#v2.3.1: | ||
env: | ||
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token | ||
docker#v3.8.0: | ||
volumes: | ||
- /workdir/node_modules | ||
- /workdir/lib | ||
environment: | ||
- NPM_READ_TOKEN | ||
seek-oss/docker-ecr-cache#v1.11.0: | ||
build-args: | ||
- NPM_READ_TOKEN | ||
cache-on: | ||
- package.json | ||
- yarn.lock | ||
plugins: | ||
- &aws-sm | ||
seek-oss/aws-sm#v2.3.1: | ||
env: | ||
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token | ||
|
||
- &docker | ||
docker#v3.8.0: | ||
volumes: | ||
- /workdir/lib | ||
- /workdir/node_modules | ||
|
||
- &docker-ecr-cache | ||
seek-oss/docker-ecr-cache#v1.11.0: | ||
build-args: | ||
- NPM_READ_TOKEN | ||
cache-on: | ||
- package.json | ||
- yarn.lock | ||
|
||
base-steps: | ||
- &deploy | ||
concurrency: 1 | ||
plugins: | ||
- *aws-sm | ||
- *docker-ecr-cache | ||
- *docker | ||
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 | ||
|
||
steps: | ||
- label: ':yarn: :eslint: Lint and :jest: unit test' | ||
<<: *dev-agent | ||
plugins: | ||
<<: *plugins | ||
key: test | ||
- <<: *dev | ||
label: 🧪 Test & Lint | ||
commands: | ||
- echo "+++ yarn test:ci" | ||
- echo '+++ yarn test:ci' | ||
- yarn test | ||
- echo "--- yarn lint" | ||
- echo '--- yarn lint' | ||
- yarn lint | ||
|
||
- label: 'Build & CDK Deploy Staging :shipit:' | ||
<<: *dev-agent | ||
plugins: | ||
<<: *plugins | ||
depends_on: | ||
- test | ||
- *aws-sm | ||
- *docker-ecr-cache | ||
- *docker | ||
|
||
- wait | ||
- block: 🙋🏻♀️ Deploy Dev | ||
branches: '!master' | ||
|
||
- <<: *dev | ||
<<: *deploy | ||
label: 🤞 Deploy Dev | ||
commands: | ||
- echo "--- Building code" | ||
- echo '--- yarn build' | ||
- yarn build | ||
- echo "--- Running CDK deploy to staging" | ||
- echo '+++ yarn deploy:dev' | ||
- yarn deploy:dev | ||
concurrency: 1 | ||
concurrency_group: '<%- repoName %>/deploy/dev' | ||
key: deploy-dev | ||
|
||
- label: 'Build & CDK Deploy Production :shipit:' | ||
branches: 'master' | ||
<<: *prod-agent | ||
plugins: | ||
<<: *plugins | ||
depends_on: | ||
- test | ||
- <<: *prod | ||
<<: *deploy | ||
label: 🚀 Deploy Prod | ||
branches: master | ||
commands: | ||
- echo "--- Building code" | ||
- echo '--- yarn build' | ||
- yarn build | ||
- echo "--- Running CDK deploy to production" | ||
- echo '+++ yarn deploy:prod' | ||
- yarn deploy:prod | ||
concurrency: 1 | ||
concurrency_group: '<%- repoName %>/deploy/prod' | ||
depends_on: deploy-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters