Migrate blog to a) -deployment repo, b) jsonnet-format definition

This commit is contained in:
Jack Jackson 2025-02-26 19:31:32 -08:00
parent 5e08c653a3
commit fb7e8cd98e
3 changed files with 37 additions and 33 deletions

View File

@ -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"]
}
}
}
}

View File

@ -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

5
app-of-apps/blog.jsonnet Normal file
View File

@ -0,0 +1,5 @@
local appDef = import './app-definitions.libsonnet';
[
appDef.kustomizeApplication(name="blog")
]