Add Templates to pretty config

This commit is contained in:
Nikolai Rodionov 2024-05-10 15:56:24 +02:00
parent 6a3bffceff
commit bc15214bf0
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -26,6 +26,7 @@ else
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_CONFIG_NAME=$(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.yaml"' $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release') export SP_APPLICATION=$(jq -r '.[0].object.data."values.yaml"' $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release')
export SP_ENVIRONMENT_ID=$(jq -r .[0].object.metadata.labels.environment)
flux create source helm $SP_APPLICATION \ flux create source helm $SP_APPLICATION \
--namespace=$SP_CUSTOMER_ID \ --namespace=$SP_CUSTOMER_ID \
@ -36,7 +37,7 @@ else
--namespace=$SP_CUSTOMER_ID \ --namespace=$SP_CUSTOMER_ID \
--chart=helmrelease \ --chart=helmrelease \
--values-from Secret/$SP_CONFIG_NAME \ --values-from Secret/$SP_CONFIG_NAME \
--kubeconfig-secret-ref=$SP_CUSTOMER_ID-config \ --kubeconfig-secret-ref=$SP_ENVIRONMENT_ID-config \
--target-namespace=default --export \ --target-namespace=default --export \
| yq '.spec.storageNamespace="helm-installations"' \ | yq '.spec.storageNamespace="helm-installations"' \
| kubectl apply -f - | kubectl apply -f -