Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ resource "azuredevops_build_definition" "devops_build_definition" {
queue_status = var.status

ci_trigger {
use_yaml = true
use_yaml = var.use_yaml == true ? true : null

dynamic "override" {
for_each = var.use_yaml == false ? var.ci_trigger_overrides : []
content {
batch = override.value.batch
max_concurrent_builds_per_branch = override.value.max_concurrent_builds_per_branch
polling_interval = override.value.polling_interval
branch_filter {
exclude = override.value.branch_filter_exclude_list
include = override.value.branch_filter_include_list
}
path_filter {
exclude = override.value.path_filter_exclude_list
include = override.value.path_filter_include_list
}
}
}
}

repository {
Expand Down
20 changes: 20 additions & 0 deletions modules/azuredevops/GitHub-Build-Definition/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,23 @@ variable "status" {
description = "The queue status of the build definition. Valid values: enabled or paused or disabled"
type = string
}

variable "use_yaml" {
default = true
description = "Use YAML for CI trigger"
type = bool
}

variable "ci_trigger_overrides" {
default = []
description = "Overrides for the CI trigger. Only used when use_yaml is false."
type = list(object({
batch = bool
max_concurrent_builds_per_branch = number
polling_interval = number
branch_filter_exclude_list = list(string)
branch_filter_include_list = list(string)
path_filter_exclude_list = list(string)
path_filter_include_list = list(string)
}))
}