Skip to content

Commit 60b14fb

Browse files
committed
feat: add helm chart
Signed-off-by: emirot <emirot.nolan@gmail.com>
1 parent 4269b64 commit 60b14fb

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/chart-diff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
5656
- name: Remove example blocks from generated CRDs
5757
run: |
58-
sed -i '/Example:/,/urlQueryEscape/d' current-repo/chart/templates/crd/argocdcommitstatuses.promoter.argoproj.io.yaml
58+
sed -i '' 's/{{- if eq \(.Environment\)/{{ `{{- if eq .Environment` }}/g; s/{{- else if eq \(.Environment\)/{{ `{{- else if eq .Environment` }}/g; s/{{- end -}}/{{ `{{- end -}}` }}/g; s/{{- range \$key, \$value := \.ArgoCDCommitStatus/{{ `{{- range $key, $value := .ArgoCDCommitStatus` }}/g' current-repo/chart/templates/crd/argocdcommitstatuses.promoter.argoproj.io.yaml
5959
6060
6161
- name: Diff charts

chart/templates/crd/argocdcommitstatuses.promoter.argoproj.io.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,21 @@ spec:
135135
is available to escape url query parameters. The template can be configured with options to control the behavior
136136
during execution if a variable is not present.
137137
138+
Example:
139+
140+
{{ "{{- $baseURL := \"https://dev.argocd.local\" -}}" }}
141+
{{- if eq .Environment "environment/development" -}}
142+
{{ "{{- $baseURL = \"https://dev.argocd.local\" -}}" }}
143+
{{- else if eq .Environment "environment/staging" -}}
144+
{{ "{{- $baseURL = \"https://staging.argocd.local\" -}}" }}
145+
{{- else if eq .Environment "environment/production" -}}
146+
{{ "{{- $baseURL = \"https://prod.argocd.local\" -}}" }}
147+
{{- end -}}
148+
{{ "{{- $labels := \"\" -}}" }}
149+
{{- range $key, $value := .ArgoCDCommitStatus.Spec.ApplicationSelector.MatchLabels -}}
150+
{{ "{{- $labels = printf \"%s%s=%s,\" $labels $key $value -}}" }}
151+
{{- end -}}
152+
{{ "{{ printf \"%s/applications?labels=%s\" $baseURL (urlQueryEscape $labels) }}" }}
138153
type: string
139154
type: object
140155
required:

0 commit comments

Comments
 (0)