From fb7e8cd98e37db111bed0bd3c983e2e0157b4be6 Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Wed, 26 Feb 2025 19:31:32 -0800 Subject: [PATCH] Migrate blog to a) -deployment repo, b) jsonnet-format definition --- app-of-apps/app-definitions.libsonnet | 32 ++++++++++++++++++++++++++ app-of-apps/apps.yaml | 33 --------------------------- app-of-apps/blog.jsonnet | 5 ++++ 3 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 app-of-apps/blog.jsonnet diff --git a/app-of-apps/app-definitions.libsonnet b/app-of-apps/app-definitions.libsonnet index 0b9eba7..ffbdd1a 100644 --- a/app-of-apps/app-definitions.libsonnet +++ b/app-of-apps/app-definitions.libsonnet @@ -72,6 +72,38 @@ syncOptions: ["CreateNamespace=true"] } } + }, + kustomizeApplication( + name, + repoUrl="", + namespace="", + path="") :: + { + apiVersion: "argoproj.io/v1alpha1", + kind: "Application", + metadata: { + name: name, + namespace: "argo", + finalizers: ["resources-finalizer.argocd.argoproj.io"] + }, + spec: { + project: "default", + source: { + repoURL: if repoUrl=="" then std.join('', ['https://gitea.scubbo.org/scubbo/', name, '-deployment']) else repoUrl, + targetRevision: "HEAD", + path: if path == "" then "." else path + }, + destination: { + server: 'https://kubernetes.default.svc', + namespace: if namespace == "" then name else namespace + }, + syncPolicy: { + automated: { + prune: true + }, + syncOptions: ["CreateNamespace=true"] + } + } } } diff --git a/app-of-apps/apps.yaml b/app-of-apps/apps.yaml index c9ec520..116e952 100644 --- a/app-of-apps/apps.yaml +++ b/app-of-apps/apps.yaml @@ -364,36 +364,3 @@ spec: prune: true syncOptions: - CreateNamespace=true ---- -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: blog - namespace: argo - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - project: default - - source: - repoURL: https://gitea.scubbo.org/scubbo/blog-infrastructure.git - targetRevision: HEAD - path: helm - - helm: - valueFiles: - - values.yaml - - parameters: - - name: targetEnv - value: prod - - destination: - server: "https://kubernetes.default.svc" - namespace: blog - - syncPolicy: - automated: - prune: true - syncOptions: - - CreateNamespace=true diff --git a/app-of-apps/blog.jsonnet b/app-of-apps/blog.jsonnet new file mode 100644 index 0000000..2dadfed --- /dev/null +++ b/app-of-apps/blog.jsonnet @@ -0,0 +1,5 @@ +local appDef = import './app-definitions.libsonnet'; + +[ + appDef.kustomizeApplication(name="blog") +] \ No newline at end of file