forked from spinnaker/sponnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv2PipelineTemplate.libsonnet
27 lines (25 loc) · 1000 Bytes
/
v2PipelineTemplate.libsonnet
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
{
pipelineTemplate():: {
schema: 'v2',
protect: false,
variables: [],
withId(id):: self + { id: id },
withProtect(protect):: self + { protect: protect },
withMetadata(metadata):: self + { metadata: metadata },
withVariables(variables):: self + if std.type(variables) == 'array' then { variables: variables } else { variables: [variables] },
withPipeline(pipeline):: self + { pipeline: pipeline },
},
metadata():: {
scopes: [],
withName(name):: self + { name: name },
withDescription(description):: self + { description: description },
withOwner(owner):: self + { owner: owner },
withScopes(scopes):: self + if std.type(scopes) == 'array' then { scopes: scopes } else { scopes: [scopes] },
},
variable():: {
withType(type):: self + { type: type },
withDefaultValue(value):: self + { defaultValue: value },
withDescription(description):: self + { description: description },
withName(name):: self + { name: name },
},
}