stackspout/apps/generate-kustomizations.sh

15 lines
395 B
Bash
Raw Normal View History

2022-07-12 17:38:21 +00:00
#!/bin/sh -e
# Generates kubernetes kustomizations
if test $# -gt 0
then dir=$1
2024-02-07 12:03:43 +00:00
{ echo 'apiVersion: kustomize.config.k8s.io/v1beta1
2022-07-12 17:38:21 +00:00
kind: Kustomization
resources:'
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