wip: misc helmfile improvements

This commit is contained in:
2025-05-14 16:01:55 +02:00
parent 87a10aab1f
commit 55c6bb5923
7 changed files with 41 additions and 29 deletions
+8 -7
View File
@@ -3,8 +3,8 @@
cmd=$1
chart=$2
env=$3
dir=_helmify
manifests=${4:-manifests}
outdir=${5:-_manifests}
build() {
if [ ! -d "manifests" ]; then
@@ -12,11 +12,11 @@ build() {
exit 0
fi
mkdir -p $dir/templates
mkdir -p $outdir/templates
echo "generating $dir/Chart.yaml" 1>&2
echo "generating $outdir/Chart.yaml" 1>&2
cat <<EOF > $dir/Chart.yaml
cat <<EOF > $outdir/Chart.yaml
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
@@ -24,11 +24,12 @@ name: $chart
version: 0.1.0
EOF
cp -r manifests/* $dir/templates
cp -r $manifests/* $outdir/templates
}
clean() {
rm -rf $dir
echo "cleaning $outdir" 1>&2
rm -rf $outdir
}
case "$cmd" in
+7 -2
View File
@@ -1,8 +1,13 @@
#!/usr/bin/env bash
if [ -f base/kustomization.yaml ]; then
[ $# != 1 ] && exit 1
[ ! -f base/kustomization.yaml ] && exit 1
env=$1
if [ -f $env/kustomization.yaml ]; then
cat >base/_manifest.yaml
kubectl kustomize base
kubectl kustomize $env
else
cat
fi