-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
47 lines (41 loc) · 1.31 KB
/
.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
image: docker:latest
services:
- docker:dind
stages:
- build
- deploy
build_prod:
stage: build
script:
- mv config.prod.json config.json
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE/prod" -f Dockerfile .
- docker push "$CI_REGISTRY_IMAGE/prod"
- docker tag "$CI_REGISTRY_IMAGE/prod" "$CI_REGISTRY_IMAGE/prod:$CI_COMMIT_REF_NAME"
- docker push "$CI_REGISTRY_IMAGE/prod:$CI_COMMIT_REF_NAME"
only:
- tags
build_integ:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE/integ" -f Dockerfile .
- docker push "$CI_REGISTRY_IMAGE/integ"
- docker tag "$CI_REGISTRY_IMAGE/integ" "$CI_REGISTRY_IMAGE/integ:develop"
- docker push "$CI_REGISTRY_IMAGE/integ:develop"
only:
- master
deploy_prod:
stage: deploy
image: cdrx/rancher-gitlab-deploy
script:
- upgrade --environment default --stack ssz-prod --service stat --new-image $CI_REGISTRY_IMAGE/prod:$CI_COMMIT_REF_NAME
only:
- tags
deploy_integ:
stage: deploy
image: cdrx/rancher-gitlab-deploy
script:
- upgrade --environment default --stack ssz-integ --service stat --new-image $CI_REGISTRY_IMAGE/integ:develop
only:
- master