-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
62 lines (57 loc) · 1.47 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
image: docker:stable
stages:
- build
- deploy
variables:
CLIENT_IMAGE_NAME: $CI_REGISTRY/scpomedialab/toflit18-client:$CI_COMMIT_REF_SLUG
API_IMAGE_NAME: $CI_REGISTRY/scpomedialab/toflit18-api:$CI_COMMIT_REF_SLUG
build_client:
stage: build
tags:
- proxy
script:
- docker build -t $CLIENT_IMAGE_NAME -f ./client/Dockerfile .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push $CLIENT_IMAGE_NAME
environment:
name: $CI_COMMIT_REF_SLUG
only:
- staging
- prod
build_api:
stage: build
tags:
- proxy
script:
- docker build -t $API_IMAGE_NAME -f Dockerfile .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push $API_IMAGE_NAME
environment:
name: $CI_COMMIT_REF_SLUG
only:
- staging
- prod
deploy:
image:
name: jrisp/kubehelper:latest
entrypoint: [""]
stage: deploy
tags:
- proxy
dependencies:
- build_client
- build_api
before_script:
- export KUBECONFIG=$kubeconfig_file
script:
- kubectl apply -f k8s/namespace.yml
- cp ${NEO4J_SECRETS} k8s/overlays/$CI_COMMIT_REF_SLUG/neo4j.env
- cp ${TOFLIT18_SECRETS} k8s/overlays/$CI_COMMIT_REF_SLUG/toflit18.env
- kubectl apply -k k8s/overlays/$CI_COMMIT_REF_SLUG
- kubectl -n toflit18 rollout restart deployment toflit18-api
- kubectl -n toflit18 rollout restart deployment toflit18-client
environment:
name: $CI_COMMIT_REF_SLUG
only:
- staging
- prod