-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
30 lines (26 loc) · 969 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
stages:
- build
- deploy
- notification
build_prod:
stage: build
script:
#- mv .env.example .env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE:prod-$CI_PIPELINE_IID .
- docker push $CI_REGISTRY_IMAGE:prod-$CI_PIPELINE_IID
only:
- master
deploy_prod:
stage: deploy
script:
- mkdir -p $HOME/.kube
- echo ${kube_config} | base64 -d > $HOME/.kube/config
- kubectl config view
- kubectl set image deployment.apps/rigel-deployment rigel=$CI_REGISTRY_IMAGE:prod-$CI_PIPELINE_IID -n prod-mirorix
only:
- master
notification:
stage: notification
script:
- curl -XPOST --data "text=Project ${CI_PROJECT_PATH} on branch ${CI_COMMIT_REF_NAME} deployed successfully.%0A%0ABy ${GITLAB_USER_NAME}.%0A%0ACommit Details = ${CI_COMMIT_MESSAGE}%0A%0A${CI_PROJECT_URL}" ${TELEGRAM_BOT}