Skip to content

Instantly share code, notes, and snippets.

@evagonz
Created June 12, 2018 12:33
Show Gist options
  • Save evagonz/901d3e20790c0ef90e472faafc914263 to your computer and use it in GitHub Desktop.
Save evagonz/901d3e20790c0ef90e472faafc914263 to your computer and use it in GitHub Desktop.
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