From 16f48720a335243f2cd61a5d1d997b9cea29ad3c Mon Sep 17 00:00:00 2001 From: Jonas Juselius Date: Tue, 20 Feb 2024 10:34:31 +0100 Subject: [PATCH] fix: autosync staging sorcerer --- applications/sorcerer.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/applications/sorcerer.yaml b/applications/sorcerer.yaml index d17b6dcd..2ae5ae66 100644 --- a/applications/sorcerer.yaml +++ b/applications/sorcerer.yaml @@ -4,23 +4,28 @@ metadata: name: sorcerer namespace: argocd spec: + goTemplate: true generators: - list: elements: - cluster: https://10.255.241.99:4443 env: prod hostname: sorcerer.srv.archive.oceanbox.io + autoSync: false + prune: true - cluster: https://10.255.241.99:4443 env: staging hostname: sorcerer.beta.archive.oceanbox.io + autoSync: true + prune: true template: metadata: - name: '{{ env }}-sorcerer' + name: '{{ .env }}-sorcerer' spec: project: atlantis destination: namespace: oceanbox - server: '{{ cluster }}' + server: '{{ .cluster }}' sources: - repoURL: https://gitlab.com/oceanbox/manifests.git targetRevision: dev @@ -29,9 +34,13 @@ spec: name: kustomize-helm-with-rewrite parameters: - name: env - string: '{{ env }}' + string: '{{ .env }}' - name: hostname - string: '{{ hostname }}' - # - repoURL: https://gitlab.com/oceanbox/manifests.git - # targetRevision: HEAD - # path: charts/sorcerer/manifests + string: '{{ .hostname }}' + templatePatch: | + {{- if .autoSync }} + spec: + syncPolicy: + automated: + prune: {{ .prune }} + {{- end }}