latest work

This commit is contained in:
ari committed 2025-04-22 17:27:38 -04:00
1 parent 0011050e53
commit ca4cec7a56
4 files changed
+84 -5

No files matched your search

+21 -1
View File
@@ -41,7 +41,7 @@ function run-upload-tfvars() {
kubectl -n $tfvar_ns create secret generic tfvars \
--dry-run=client \
--save-config \
--from-file=tfvars=./$tfvar_file \
--from-file=tfvars=$tfvar_file \
-o yaml | \
kubectl -n $tfvar_ns apply -f -
}
@@ -52,4 +52,24 @@ function run-download-tfvars() {
kubectl -n $tfvar_ns get secrets/tfvars -o jsonpath='{.data.tfvars}' | base64 -d > $tfvar_file
}
function run-template() {
:
:
app_name=${1}
tmp_folder=$ROOT_FOLDER/.tmp/homelab/tpl-$app_name
rm -rf $tmp_folder
mkdir -p $tmp_folder
kubectl get -n plugin-argo-cd applications.argoproj.io $app_name -o jsonpath='{.spec.source}' > $tmp_folder/spec.json
folder=$(cat $tmp_folder/spec.json | jq -r '.path')
cat $tmp_folder/spec.json | jq -r '.helm.values' > $tmp_folder/v.yaml
valuesFiles="--values "$(cat $tmp_folder/spec.json | jq -r '.helm.valueFiles | join(" --values ")')
pushd $ROOT_FOLDER/$folder &> /dev/null
hcmd="helm template --debug $valuesFiles --values $tmp_folder/v.yaml ."
echo $hcmd
$hcmd > $tmp_folder/rendered.yaml
cat $tmp_folder/rendered.yaml
echo $tmp_folder/rendered.yaml
popd &> /dev/null
}
start_cli $@