Skip to content

Commit b4c236a

Browse files
committed
feat(argocd): provide configurable deploy repo prefix path
Allow the user to customize their path into their deploy repo for their configuration files. This will be useful for testing purposes.
1 parent 5caa528 commit b4c236a

30 files changed

Lines changed: 75 additions & 46 deletions

charts/argocd-understack/templates/_helpers.tpl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,29 @@ Get the deployment repository git reference
9898
{{- .Values.deploy_ref }}
9999
{{- end }}
100100

101+
{{/*
102+
Get the base path within the deploy repository.
103+
Always includes Release.Name, with an optional prefix from deploy_path_prefix.
104+
105+
Examples:
106+
deploy_path_prefix: "" -> "uc-iad3-prod"
107+
deploy_path_prefix: "sites" -> "sites/uc-iad3-prod"
108+
deploy_path_prefix: "us/east" -> "us/east/uc-iad3-prod"
109+
110+
Usage in valueFiles:
111+
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/dex.yaml
112+
113+
Usage in source path:
114+
path: {{ include "understack.deploy_path" $ }}/manifests/dex
115+
*/}}
116+
{{- define "understack.deploy_path" -}}
117+
{{- if .Values.deploy_path_prefix -}}
118+
{{- printf "%s/%s" .Values.deploy_path_prefix .Release.Name -}}
119+
{{- else -}}
120+
{{- .Release.Name -}}
121+
{{- end -}}
122+
{{- end }}
123+
101124
{{/*
102125
Check if a component is enabled by walking the configuration hierarchy.
103126
Supports both "global" and "site" scopes with appropriate kill switches.

charts/argocd-understack/templates/application-argo-events-workflows.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
ref: understack
1717
repoURL: {{ include "understack.understack_url" $ }}
1818
targetRevision: {{ include "understack.understack_ref" $ }}
19-
- path: {{ $.Release.Name }}/manifests/argo-events-workflows
19+
- path: {{ include "understack.deploy_path" $ }}/manifests/argo-events-workflows
2020
ref: deploy
2121
repoURL: {{ include "understack.deploy_url" $ }}
2222
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-argo-events.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
ref: understack
1616
repoURL: {{ include "understack.understack_url" $ }}
1717
targetRevision: {{ include "understack.understack_ref" $ }}
18-
- path: {{ $.Release.Name }}/manifests/argo-events
18+
- path: {{ include "understack.deploy_path" $ }}/manifests/argo-events
1919
ref: deploy
2020
repoURL: {{ include "understack.deploy_url" $ }}
2121
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-argo-workflows.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
server: {{ $.Values.cluster_server }}
1313
project: understack
1414
sources:
15-
- path: {{ $.Release.Name }}/manifests/argo-workflows
15+
- path: {{ include "understack.deploy_path" $ }}/manifests/argo-workflows
1616
ref: deploy
1717
repoURL: {{ include "understack.deploy_url" $ }}
1818
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-cilium.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
server: {{ $.Values.cluster_server }}
1313
project: understack-infra
1414
sources:
15-
- path: {{ $.Release.Name }}/manifests/cilium
15+
- path: {{ include "understack.deploy_path" $ }}/manifests/cilium
1616
ref: deploy
1717
repoURL: {{ include "understack.deploy_url" $ }}
1818
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-dex.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ spec:
1818
releaseName: dex
1919
valueFiles:
2020
- $understack/components/dex/values.yaml
21-
- $deploy/{{ $.Release.Name }}/helm-configs/dex.yaml
21+
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/dex.yaml
2222
repoURL: https://charts.dexidp.io
2323
targetRevision: 0.16.0
2424
- path: components/dex
2525
ref: understack
2626
repoURL: {{ include "understack.understack_url" $ }}
2727
targetRevision: {{ include "understack.understack_ref" $ }}
28-
- path: {{ $.Release.Name }}/manifests/dex
28+
- path: {{ include "understack.deploy_path" $ }}/manifests/dex
2929
ref: deploy
3030
repoURL: {{ include "understack.deploy_url" $ }}
3131
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-envoy-configs.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ spec:
1717
ignoreMissingValueFiles: true
1818
valueFiles:
1919
- $understack/components/envoy-configs/values.yaml
20-
- $deploy/{{ $.Release.Name }}/helm-configs/envoy-configs.yaml
20+
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/envoy-configs.yaml
2121
ref: understack
2222
repoURL: {{ include "understack.understack_url" $ }}
2323
targetRevision: {{ include "understack.understack_ref" $ }}
24-
- path: {{ $.Release.Name }}/manifests/envoy-configs
24+
- path: {{ include "understack.deploy_path" $ }}/manifests/envoy-configs
2525
ref: deploy
2626
repoURL: {{ include "understack.deploy_url" $ }}
2727
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-envoy-gateway.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ spec:
1818
releaseName: gateway-helm
1919
valueFiles:
2020
- $understack/components/envoy-gateway/values.yaml
21-
- $deploy/{{ $.Release.Name }}/helm-configs/envoy-gateway.yaml
21+
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/envoy-gateway.yaml
2222
repoURL: docker.io/envoyproxy
2323
targetRevision: v1.6.0
2424
- path: components/envoy-gateway
2525
ref: understack
2626
repoURL: {{ include "understack.understack_url" $ }}
2727
targetRevision: {{ include "understack.understack_ref" $ }}
28-
- path: {{ $.Release.Name }}/manifests/envoy-gateway
28+
- path: {{ include "understack.deploy_path" $ }}/manifests/envoy-gateway
2929
ref: deploy
3030
repoURL: {{ include "understack.deploy_url" $ }}
3131
targetRevision: {{ include "understack.deploy_ref" $ }}

charts/argocd-understack/templates/application-etcdbackup.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
ignoreMissingValueFiles: true
1717
valueFiles:
1818
- $understack/components/etcdbackup/values.yaml
19-
- $deploy/{{ $.Release.Name }}/helm-configs/etcdbackup.yaml
19+
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/etcdbackup.yaml
2020
path: components/etcdbackup
2121
ref: understack
2222
repoURL: {{ include "understack.understack_url" $ }}

charts/argocd-understack/templates/application-external-dns.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ spec:
1717
ignoreMissingValueFiles: true
1818
releaseName: external-dns-rackspace
1919
valueFiles:
20-
- $deploy/{{ $.Release.Name }}/helm-configs/external-dns.yaml
20+
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/external-dns.yaml
2121
repoURL: ghcr.io/rackerlabs/charts
2222
targetRevision: 0.2.0
23-
- path: {{ $.Release.Name }}/manifests/external-dns
23+
- path: {{ include "understack.deploy_path" $ }}/manifests/external-dns
2424
ref: deploy
2525
repoURL: {{ include "understack.deploy_url" $ }}
2626
targetRevision: {{ include "understack.deploy_ref" $ }}

0 commit comments

Comments
 (0)