Update scrtipts

This commit is contained in:
Nikolai Rodionov 2024-04-02 17:57:11 +02:00
parent ddf62b31eb
commit 12afd1346b
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -20,17 +20,14 @@ kubernetes:
values: ["bootstrap"]
EOF
else
echo $BINDING_CONTEXT_PATH
cmName=$(jq -r .[0].object $BINDING_CONTEXT_PATH)
echo "ConfigMap '${cmName}' added"
PROVIDER=$(jq -r .[0].object.data.provider $BINDING_CONTEXT_PATH)
KUBERNETES=$(jq -r .[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
PROVIDER=$(jq -r .[0].objects.[0].object.data.provider $BINDING_CONTEXT_PATH)
KUBERNETES=$(jq -r .[0].objects.[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
if ! [ -f /tpls/${PROVIDER}-${KUBERNETES}.yaml ]; then
echo "ERROR: template not found for ${PROVIDER}-${KUBERNETES}"
exit 1
fi
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_CUSTOMER_ID=$(jq -r .[0].objects.[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
export SP_ENVIRONMENT=$(jq -r .[0].objects.[0].object.metadata.name $BINDING_CONTEXT_PATH)
envsubst < /tpls/${PROVIDER}-${KUBERNETES}.yaml | kubectl create -f -
fi