added repo
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
{{- $top := . -}}
|
||||
{{- range $i, $config := .Values.appSpec }}
|
||||
---
|
||||
{{- $appName := $config.name -}}
|
||||
{{- $appNameOverride := $config.nameOverride -}}
|
||||
{{- $clusterValues := $top.Values.clusterSpec -}}
|
||||
{{- $clusterName := $clusterValues.destination.name -}}
|
||||
{{- $clusterServer := $clusterValues.destination.server -}}
|
||||
|
||||
{{- $teamValues := $top.Values.teamSpec.devops -}}
|
||||
{{- $labels := $teamValues.labels -}}
|
||||
{{- $bu := $labels.bu -}}
|
||||
{{- $cluster := $labels.cluster | replace "dp-" "#pqr#" | replace "backup" "#abc#" | replace "p-" "" | replace "prd-" "" | replace "int-" "" | replace "dev-" "" | replace "-cluster" "" | replace "prod-ops" "infra" | replace "-ase1c" "-c" | replace "-ase1a" "-a" | replace "-ase1" "" | replace "k8s-" "" | replace "gke-" "" | replace "#pqr#" "dp-" | replace "#abc#" "backup" -}}
|
||||
{{- $team := $labels.team -}}
|
||||
{{- $env := $labels.env -}}
|
||||
{{- $source := $teamValues.source -}}
|
||||
{{- $repoURL := $source.repoURL -}}
|
||||
{{- $targetRevision := $source.targetRevision -}}
|
||||
|
||||
{{- $namespace := $config.namespace -}}
|
||||
{{- $path := printf "%s/%s" $source.path $config.chartDir -}}
|
||||
{{- $valueFiles := printf "%s/%s/custom-values.yaml" $source.valueFiles $config.valuesDir -}}
|
||||
{{- $additionalValueFiles := $config.additionalValueFiles | default list -}}
|
||||
|
||||
{{ $argoAppNamespace := $top.Values.argocdSpec.namespace }}
|
||||
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: '{{- if $appNameOverride }}{{ $appNameOverride }}{{- else }}{{ printf "%s-%s-%s" $appName $cluster $env }}{{- end }}'
|
||||
namespace: {{ $argoAppNamespace }}
|
||||
labels:
|
||||
{{ toYaml $labels | indent 4 }}
|
||||
finalizers:
|
||||
- resources-finalizer.argocd.argoproj.io
|
||||
spec:
|
||||
project: {{ $team }}
|
||||
source:
|
||||
repoURL: {{ $repoURL }}
|
||||
targetRevision: {{ $targetRevision }}
|
||||
path: {{ $path }}
|
||||
helm:
|
||||
valueFiles:
|
||||
- {{ $valueFiles }}
|
||||
{{- if $additionalValueFiles }}
|
||||
{{- range $additionalValueFiles }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
destination:
|
||||
name: {{ $clusterName }}
|
||||
server: {{ $clusterServer }}
|
||||
namespace: {{ $namespace }}
|
||||
syncPolicy:
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user