-
Notifications
You must be signed in to change notification settings - Fork 45
/
projects.yaml
35 lines (35 loc) · 1.03 KB
/
projects.yaml
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
{{- if not $.Values.projectOverride }}
{{- range $key,$val := .Values.projects }}
{{- /*
in order to use tpl within a range, _and_ have the key/val available to sub-templates,
need to add some variables to the root context.
*/ -}}
{{- $_ := set $ "curProjName" (print $.Values.envName "-" $key) }}
---
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: {{ required "A valid envName is required" $.Values.envName }}-{{ $key }}
spec:
{{- if $val.extraFields }}
{{ tpl $val.extraFields $ | indent 2 }}
{{- end }}
description: {{ tpl $val.description $ }}
sourceRepos:
{{ toYaml $val.sourceRepos | indent 4 }}
{{- if $val.roles }}
roles:
{{ tpl $val.roles $ | indent 4 }}
{{- else if $.Values.default.project.roles }}
roles:
{{ tpl $.Values.default.project.roles $ | indent 4 }}
{{- end }}
{{- if $val.destinations }}
destinations:
{{ tpl $val.destinations $ | indent 4 }}
{{- else if $.Values.default.project.destinations }}
destinations:
{{ tpl $.Values.default.project.destinations $ | indent 4 }}
{{- end }}
{{- end }}
{{- end }}