diff --git a/argocd_deployer/data/application_set_template.xml b/argocd_deployer/data/application_set_template.xml index 49b50a5..575f5ba 100644 --- a/argocd_deployer/data/application_set_template.xml +++ b/argocd_deployer/data/application_set_template.xml @@ -2,30 +2,31 @@ Master application set template - Do not change apiVersion: argoproj.io/v1alpha1 +apiVersion: argoproj.io/v1alpha1 kind: ApplicationSet metadata: - name: curq-application-sets + name: curq-master-application-set namespace: argocd spec: goTemplate: true generators: - - git: - repoURL: {{.config.repository_url}} - revision: {{.config.branch}} - files: - - path: {{.config.deployment_directory}} + - git: + repoURL: {{.config.repository_url}} + revision: {{.config.branch}} + files: + - path: {{.config.deployment_directory}}/**/application_set.yaml template: metadata: - name: curq-application-sets + name: "application-set-{{ "{{ " }}.path.basename{{ " }}" }}" spec: project: "default" source: repoURL: {{.config.repository_url}} targetRevision: {{.config.branch}} - path: {{.config.deployment_directory}}/{{ "{{ " }}.path.basename{{ " }}" }} + path: "{{ "{{ " }}.path.filename{{ " }}" }}" destination: name: in-cluster - namespace: argocd + namespace: "application-set-{{ "{{ " }}.path.basename{{ " }}" }}" syncPolicy: syncOptions: - CreateNamespace=true diff --git a/argocd_deployer/models/application_set.py b/argocd_deployer/models/application_set.py index 37a27f3..390d88f 100644 --- a/argocd_deployer/models/application_set.py +++ b/argocd_deployer/models/application_set.py @@ -239,7 +239,7 @@ def _get_repository(self): return Repo.clone_from(self.repository_url, directory) def _get_branch(self): - return self.branch + return self.env.ref("argocd_deployer.application_set_master").branch def _format_commit_message(self, message): return message % self.name