script: poll rollout sans watch

This commit is contained in:
hashfyre 2018-01-25 16:37:09 +05:30
parent e715f7e0e8
commit 41e7b9cce3
1 changed files with 9 additions and 2 deletions

View File

@ -104,7 +104,14 @@ pollDeploymentRollout(){
local NAMESPACE=$1; shift
local DEPLOY=$1
# wait on deployment rollout status
kubectl -n ${NAMESPACE} rollout status --watch=false --revision=0 deployment/${DEPLOY}
while true; do
result=`kubectl -n ${NAMESPACE} rollout status --watch=false --revision=0 deployment/${DEPLOY}`
if [[ "${result}" == "deployment \"${DEPLOY}\" successfully rolled out" ]]; then
exit 0
else
sleep 10
fi
done
}
startDeployment(){
@ -119,7 +126,7 @@ startDeployment(){
kubectl -n ${NAMESPACE} set image deployment/${DEPLOY} \
${CONTAINER}="${PLUGIN_REPO}:${PLUGIN_TAG}" --record
done
#pollDeploymentRollout ${NAMESPACE} ${DEPLOY}
pollDeploymentRollout ${NAMESPACE} ${DEPLOY}
done
}