This repository was archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables.tf
More file actions
53 lines (50 loc) · 1.52 KB
/
variables.tf
File metadata and controls
53 lines (50 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
variable "build_definition" {
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
locals {
default = {
# resource definition
build_definition = {
name = ""
path = "\\"
agent_pool_name = "Azure Pipelines"
variable = {
name = ""
value = ""
secret_value = ""
is_secret = false
allow_override = true
}
variable_groups = []
repository = {
branch_name = "master"
service_connection_id = ""
yml_path = "\\"
report_build_status = true
}
ci_trigger = {
use_yaml = false
}
pull_request_trigger = {}
schedules = {}
}
}
# compare and merge custom and default values
build_definition_values = {
for build_definition in keys(var.build_definition) :
build_definition => merge(local.default.build_definition, var.build_definition[build_definition])
}
# merge all custom and default values
build_definition = {
for build_definition in keys(var.build_definition) :
build_definition => merge(
local.build_definition_values[build_definition],
{
for config in ["variable", "repository", "ci_trigger", "pull_request_trigger", "schedules"] :
config => merge(local.default.build_definition[config], local.build_definition_values[build_definition][config])
}
)
}
}