Created
July 25, 2017 23:30
-
-
Save mikelovesrobots/00973c8cd2bf220e1833a3054ac6f530 to your computer and use it in GitHub Desktop.
one way of using yaml features to DRY up drone.yml
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
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