Created
June 12, 2018 12:33
-
-
Save evagonz/901d3e20790c0ef90e472faafc914263 to your computer and use it in GitHub Desktop.
Jenkinsfile example for: https://medium.com/devopslinks/a-hacky-hackers-guide-to-hacking-together-jenkins-scripted-pipelines-and-getting-them-to-do-things-a1e943cb8d11
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
stage('deploy') { | |
node('aws') { | |
// this is going to be a multi-line 'sh' | |
sh """ | |
new_stack = "my-aws-cloudformation-stack-name" | |
aws cloudformation create-stack \ | |
--region us-east-3 \ | |
--capabilities CAPABILITY_IAM \ | |
--stack-name $new_stack | |
--template-body file://path-to-file-for-stack-template | |
// the wait is optional, but recommended, so the pipeline doesn't progress until your stack is actually created | |
aws cloudformation wait stack-create-complete --region us-east-3 --stack-name $new_stack | |
""" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment