diff --git a/Jenkinsfile b/Jenkinsfile index 43cd3ec..e513db6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -150,7 +150,7 @@ spec: sh """ set -eux if [ "${IS_SESSION_JOB}" = "true" ]; then - kubectl -n ${APP_NS} scale deploy/${DEPLOY} --replicas=0 + kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=merge -p '{"spec":{"replicas":0}}' for i in \$(seq 1 150); do POD_COUNT=\$(kubectl -n ${APP_NS} get pod -l app=${DEPLOY} --no-headers 2>/dev/null | wc -l | tr -d ' ') [ "\${POD_COUNT}" = "0" ] && break @@ -165,7 +165,7 @@ spec: kubectl -n ${APP_NS} set image deploy/${DEPLOY} ${DEPLOY}=${REG}/${IMAGE}:${IMAGE_TAG} if [ "${IS_SESSION_JOB}" = "true" ]; then - kubectl -n ${APP_NS} scale deploy/${DEPLOY} --replicas=1 + kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=merge -p '{"spec":{"replicas":1}}' fi kubectl -n ${APP_NS} rollout status deploy/${DEPLOY} --timeout=300s