Skip to content

Instantly share code, notes, and snippets.

@mikelovesrobots
Created July 25, 2017 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikelovesrobots/00973c8cd2bf220e1833a3054ac6f530 to your computer and use it in GitHub Desktop.
Save mikelovesrobots/00973c8cd2bf220e1833a3054ac6f530 to your computer and use it in GitHub Desktop.
one way of using yaml features to DRY up drone.yml
invalidate-cloudfront-common: &invalidate-cloudfront-common
image: cgswong/aws:aws
commands:
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"
secrets: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY]
pipeline:
invalidate-cloudfront-dev:
<<: *invalidate-cloudfront-common
when:
event: deployment
environment: dev
environment:
- DISTRIBUTION_ID=XXXXXXXXXXXXX1
invalidate-cloudfront-qa:
<<: *invalidate-cloudfront-common
when:
event: deployment
environment: qa
environment:
- DISTRIBUTION_ID=XXXXXXXXXXXXX2
invalidate-cloudfront-stable:
<<: *invalidate-cloudfront-common
when:
event: deployment
environment: stable
environment:
- DISTRIBUTION_ID=XXXXXXXXXXXXX3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment