Allows a drone user to update a statefulset
This commit is contained in:
parent
a5776c44e9
commit
f9a988af29
25
update.sh
25
update.sh
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z ${PLUGIN_NAMESPACE} ]; then
|
||||
PLUGIN_NAMESPACE="default"
|
||||
fi
|
||||
|
@ -33,6 +35,26 @@ kubectl config set-context default --cluster=default --user=${PLUGIN_KUBERNETES_
|
|||
kubectl config use-context default
|
||||
|
||||
# kubectl version
|
||||
if [ ! -z ${PLUGIN_USE_STATEFULSET} ]; then
|
||||
echo "WARNING: Currently updating statefulset ${PLUGIN_STATEFULSET}."
|
||||
|
||||
IFS=',' read -r -a DEPLOYMENTS <<< "${PLUGIN_STATEFULSET}"
|
||||
IFS=',' read -r -a CONTAINERS <<< "${PLUGIN_CONTAINER}"
|
||||
for DEPLOY in ${DEPLOYMENTS[@]}; do
|
||||
echo Deploying to $KUBERNETES_SERVER
|
||||
for CONTAINER in ${CONTAINERS[@]}; do
|
||||
if [[ ${PLUGIN_FORCE} == "true" ]]; then
|
||||
kubectl -n ${PLUGIN_NAMESPACE} set image statefulset/${DEPLOY} \
|
||||
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}FORCE
|
||||
fi
|
||||
kubectl -n ${PLUGIN_NAMESPACE} set image statefulset/${DEPLOY} \
|
||||
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG} --record
|
||||
done
|
||||
done
|
||||
|
||||
else
|
||||
echo "WARNING: Currently updating deployment ${PLUGIN_DEPLOYMENT}"
|
||||
|
||||
IFS=',' read -r -a DEPLOYMENTS <<< "${PLUGIN_DEPLOYMENT}"
|
||||
IFS=',' read -r -a CONTAINERS <<< "${PLUGIN_CONTAINER}"
|
||||
for DEPLOY in ${DEPLOYMENTS[@]}; do
|
||||
|
@ -46,3 +68,6 @@ for DEPLOY in ${DEPLOYMENTS[@]}; do
|
|||
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG} --record
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue