-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: DBTP-1366 - Force environment pipeline to trigger on correct branch #230
fix: DBTP-1366 - Force environment pipeline to trigger on correct branch #230
Conversation
push { | ||
branches { | ||
includes = [ | ||
var.trigger_on_push ? var.branch : "NO_TRIGGER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally here we would remove the trigger instead of setting a placeholder branch to prevent triggering var.trigger_on_push ? var.branch : "NO_TRIGGER"
, however Terraform doesn't detect the change if we omit the entire trigger block.
|
||
assert { | ||
condition = length(aws_codepipeline.environment_pipeline.trigger[0].git_configuration[0].push[0].branches[0].includes) == 1 | ||
error_message = "Should be: true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error_message = "Should be: true" | |
error_message = "Should be: 1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length function evaluates this to true|false
but I've added a better message anyway
Co-authored-by: Kate Sugden <[email protected]>
Co-authored-by: Kate Sugden <[email protected]>
Explicitly add a trigger block with the source branch to the environment pipeline.