Skip to content

Commit

Permalink
Merge pull request #17 from delfer/master
Browse files Browse the repository at this point in the history
Added parameters 'force' and 'user'
  • Loading branch information
MacTynow authored Apr 9, 2018
2 parents b71e43d + a139168 commit a5776c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ if [ -z ${PLUGIN_NAMESPACE} ]; then
PLUGIN_NAMESPACE="default"
fi

if [ -z ${PLUGIN_KUBERNETES_USER} ]; then
PLUGIN_KUBERNETES_USER="default"
fi

if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then
KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN
fi
Expand All @@ -25,7 +29,7 @@ else
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
fi

kubectl config set-context default --cluster=default --user=default
kubectl config set-context default --cluster=default --user=${PLUGIN_KUBERNETES_USER}
kubectl config use-context default

# kubectl version
Expand All @@ -34,6 +38,10 @@ 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 deployment/${DEPLOY} \
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}FORCE
fi
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG} --record
done
Expand Down

0 comments on commit a5776c4

Please sign in to comment.