Update createHelmYaml.sh
All checks were successful
Build docker container / Build image (push) Successful in 19s

This commit is contained in:
ties 2024-09-06 10:14:49 +00:00
parent 33862de7b6
commit 64a2dad2fa

View File

@ -19,6 +19,32 @@ function checkKubeConfig(){
exit 1
fi
}
function printGlobal(){
if [ -e "Chart.yaml" ]; then
printHelm()
else
printRaw()
fi
}
function deployGlobal(){
if [ -e "Chart.yaml" ]; then
deployHelm()
else
deployRaw()
fi
}
function printRaw(){
cat ./*.yaml
}
function deployRaw(){
printRaw()
kubectl apply -f .
}
function printHelm(){
helm dependency build .
helm template -g . --set-json="chart_template.subchartData=$(yq '.dependencies[] | select(.condition == "subchart")' Chart.yaml -ojson | jq -rc)"
@ -59,9 +85,9 @@ fi
# Check if the action environment variable is set to 'print'
if [[ "$action" == "print" ]]; then
printHelm
printGlobal
elif [[ "$action" == "deploy" ]]; then
deployHelm
deployGlobal
elif [[ "$action" == "helm-deploy" ]]; then
deployHelm
elif [[ "$action" == "package" ]]; then