Fox scripts
This commit is contained in:
parent
eb03484d56
commit
6c7d167d78
@ -17,8 +17,8 @@ kubernetes:
|
|||||||
values: ["bootstrap"]
|
values: ["bootstrap"]
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
PROVIDER=$(jq -r .[0].objects.[0].object.data.provider $BINDING_CONTEXT_PATH)
|
PROVIDER=$(jq -r .[0].object.data.provider $BINDING_CONTEXT_PATH)
|
||||||
KUBERNETES=$(jq -r .[0].objects.[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
|
KUBERNETES=$(jq -r .[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
|
||||||
echo "running the ${PROVIDER}-cleanup hook"
|
echo "running the ${PROVIDER}-cleanup hook"
|
||||||
|
|
||||||
if ! [ -f /tpls/${PROVIDER}-cleanup.yaml ]; then
|
if ! [ -f /tpls/${PROVIDER}-cleanup.yaml ]; then
|
||||||
@ -26,8 +26,8 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SP_CUSTOMER_ID=$(jq -r .[0].objects.[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].objects.[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
||||||
echo "removing the ${SP_ENVIRONMENT} owned by ${SP_CUSTOMER_ID}"
|
echo "removing the ${SP_ENVIRONMENT} owned by ${SP_CUSTOMER_ID}"
|
||||||
|
|
||||||
envsubst < /tpls/${PROVIDER}-cleanup.yaml | kubectl create -f -
|
envsubst < /tpls/${PROVIDER}-cleanup.yaml | kubectl create -f -
|
||||||
|
@ -22,14 +22,14 @@ kubernetes:
|
|||||||
values: ["bootstrap"]
|
values: ["bootstrap"]
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
PROVIDER=$(jq -r .[0].objects.[0].object.data.provider $BINDING_CONTEXT_PATH)
|
PROVIDER=$(jq -r .[0].object.data.provider $BINDING_CONTEXT_PATH)
|
||||||
KUBERNETES=$(jq -r .[0].objects.[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
|
KUBERNETES=$(jq -r .[0].object.data.kubernetes $BINDING_CONTEXT_PATH)
|
||||||
if ! [ -f /tpls/${PROVIDER}-${KUBERNETES}.yaml ]; then
|
if ! [ -f /tpls/${PROVIDER}-${KUBERNETES}.yaml ]; then
|
||||||
echo "ERROR: template not found for ${PROVIDER}-${KUBERNETES}"
|
echo "ERROR: template not found for ${PROVIDER}-${KUBERNETES}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
export SP_CUSTOMER_ID=$(jq -r .[0].objects.[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].objects.[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
|
||||||
envsubst < /tpls/${PROVIDER}-${KUBERNETES}.yaml | kubectl create -f -
|
envsubst < /tpls/${PROVIDER}-${KUBERNETES}.yaml | kubectl create -f -
|
||||||
kubectl patch configmap -n ${SP_CUSTOMER_ID} ${SP_ENVIRONMENT} \
|
kubectl patch configmap -n ${SP_CUSTOMER_ID} ${SP_ENVIRONMENT} \
|
||||||
-p '{"metadata":{"finalizers":["softplayer.net/bootstrapped"]}}' --type=merge
|
-p '{"metadata":{"finalizers":["softplayer.net/bootstrapped"]}}' --type=merge
|
||||||
|
Loading…
Reference in New Issue
Block a user