build(CI): update build and deploy stages

- Add commit ref as image tag
- Restrict deploy stage
This commit is contained in:
bmartins 2023-03-28 23:59:20 +02:00
parent 328bce1187
commit 6bd1fd9dc5

View File

@ -47,17 +47,22 @@ build-image:
extends: .kaniko_build
variables:
PUSH_IMAGE: "true"
REGISTRY_IMAGE_PATH: "${HARBOR_HOST}/${HARBOR_PROJECT}/${CI_PROJECT_NAME}"
REGISTRY_IMAGE_PATH: "${HARBOR_HOST}/${HARBOR_PROJECT}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME}"
deploy-image:
stage: deploy
image:
name: bitnami/kubectl:latest
entrypoint: ['']
environment:
name: develop
url: http://162.19.225.127
script:
- kubectl config get-contexts
- kubectl config use-context framasoft/framadate/funky-framadate-front:framadate-local-cluster
- kubectl config use-context framasoft/framadate/funky-framadate-front:framadate-cluster
- kubectl -n framadate rollout restart deployments/frontend-deployment
except:
- master
# build:
# image: node:16