Update .gitlab-ci.yml

This commit is contained in:
chenwj113 2023-02-16 13:54:29 +08:00
parent 8bde10f424
commit 4cf73561ea
1 changed files with 3 additions and 4 deletions

View File

@ -34,10 +34,9 @@ deploy-staging:dep:
- master
script:
- echo "===== start deploy =========="
- if [ $CI_COMMIT_TAG == 'dev' ]; then
- echo "'dev' branch commit!"
- if
- if [ "$(kubectl get deployment -n $K8S_NS | grep $DEPLOYMENT_NAME | awk '{print $1}')" ]; then
- echo $CI_COMMIT_TAG
- # 判断当前分支是否为dev开发分支否则不重启容器服务
- if [[ $CI_COMMIT_TAG == 'dev' ]] && [[ "$(kubectl get deployment -n $K8S_NS | grep $DEPLOYMENT_NAME | awk '{print $1}')" ]]; then
- kubectl rollout restart deployment $DEPLOYMENT_NAME -n $K8S_NS
- fi
- echo "===== end deploy !!!!!======="