Update .gitlab-ci.yml

This commit is contained in:
chenwj113 2023-02-16 09:49:11 +08:00
parent b1e7510e09
commit d28d9de272
1 changed files with 5 additions and 0 deletions

View File

@ -12,11 +12,14 @@ before_script:
stages: stages:
- build - build
- deploy
deploy-staging:dep: deploy-staging:dep:
stage: build stage: build
only: only:
- master - master
tags:
- $TAG
script: script:
- echo "===== start build ==========" - echo "===== start build =========="
- docker build -t ${IMAGE_NAME} . - docker build -t ${IMAGE_NAME} .
@ -28,6 +31,8 @@ deploy-staging:dep:
stage: deploy stage: deploy
only: only:
- master - master
tags:
- $TAG
script: script:
- echo "===== start deploy ==========" - echo "===== start deploy =========="
- if [ "$(kubectl get deployment -n $K8S_NS | grep $DEPLOYMENT_NAME | awk '{print $1}')" ]; then - if [ "$(kubectl get deployment -n $K8S_NS | grep $DEPLOYMENT_NAME | awk '{print $1}')" ]; then