Add Templates to pretty config

This commit is contained in:
Nikolai Rodionov 2024-05-10 13:27:52 +02:00
parent 65bc5a070b
commit b3089c3415
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -24,7 +24,7 @@ EOF
else else
export $(jq -r .[0].object.data.vars $BINDING_CONTEXT_PATH) export $(jq -r .[0].object.data.vars $BINDING_CONTEXT_PATH)
export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH) export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH) export SP_CONFIG_NAME=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
export SP_APPLICATION=$(jq -r .[0].object.data.values $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release') export SP_APPLICATION=$(jq -r .[0].object.data.values $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release')
flux create source helm $SP_APPLICATION \ flux create source helm $SP_APPLICATION \
@ -35,12 +35,12 @@ else
--source=HelmRepository/$SP_APPLICATION \ --source=HelmRepository/$SP_APPLICATION \
--namespace=$SP_CUSTOMER_ID \ --namespace=$SP_CUSTOMER_ID \
--chart=helmrelease \ --chart=helmrelease \
--values-from Secret/$SP_APPLICATION \ --values-from Secret/$SP_CONFIG_NAME \
--kubeconfig-secret-ref=$SP_CUSTOMER_ID-config \ --kubeconfig-secret-ref=$SP_CUSTOMER_ID-config \
--target-namespace=default --export \ --target-namespace=default --export \
| yq '.spec.storageNamespace="helm-installations"' \ | yq '.spec.storageNamespace="helm-installations"' \
| kubectl create -f - | kubectl create -f -
flux reconcile helmrelease --namespace=$SP_ACCOUNT $SP_APPLICATION flux reconcile helmrelease --namespace=$SP_CUSTOMER_ID $SP_APPLICATION
fi fi