stackspout/basic/apps/generate-kustomizations.sh
2022-07-12 22:11:36 +01:00

9 lines
334 B
Bash
Executable file

#!/bin/sh -e
# Generates kubernetes kustomizations
find -mindepth 1 -maxdepth 1 -type d | while read dir;
do echo "$dir"
{ 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