From 0710ff653260d34808ae2f23cb238e69412eb48c Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 24 Jan 2024 15:42:23 +0100 Subject: [PATCH] apps: create kustomization for directory --- apps/generate-kustomizations.sh | 13 +++++++++---- apps/kustomization.yaml | 8 ++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 apps/kustomization.yaml diff --git a/apps/generate-kustomizations.sh b/apps/generate-kustomizations.sh index 0d138e2..857f418 100755 --- a/apps/generate-kustomizations.sh +++ b/apps/generate-kustomizations.sh @@ -1,9 +1,14 @@ #!/bin/sh -e # Generates kubernetes kustomizations -find -mindepth 1 -maxdepth 1 -type d | while read dir; -do echo "$dir" +if test $# -gt 0 +then dir=$1 { echo 'apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources:' - find $dir -type f -not -name "*.bak" -not -name "kustomization.yaml" -printf " - %f\n"; } | tee $dir/kustomization.yaml -done + find $dir -maxdepth 1 -type f -name "*.yaml" -not -name "kustomization.yaml" -printf " - %f\n"; } | tee $dir/kustomization.yaml +else + find -mindepth 1 -maxdepth 1 -type d | while read dir + do echo "$dir" + $0 "$dir" + done +fi diff --git a/apps/kustomization.yaml b/apps/kustomization.yaml new file mode 100644 index 0000000..ebeee95 --- /dev/null +++ b/apps/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - gitea-kustomization.yaml + - forgejo-kustomization.yaml + - invoiceninja-customization.yaml + - vikunja-kustomization.yaml + - vikunja-test-kustomization.yaml