-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
43 lines (35 loc) · 1.49 KB
/
.gitlab-ci.yml
File metadata and controls
43 lines (35 loc) · 1.49 KB
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
stages:
- build
- deploy🚀
- clean
packaging:
stage: build
tags:
- docker
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.forge.orange-labs.fr
- sudo docker build --rm -f docker/backend/Dockerfile -t registry.forge.orange-labs.fr/fwbn0182/oidc-testing-tool:backend .
- docker push registry.forge.orange-labs.fr/fwbn0182/oidc-testing-tool:backend
- sudo docker build --rm -f docker/front/Dockerfile -t registry.forge.orange-labs.fr/fwbn0182/oidc-testing-tool:front .
- docker push registry.forge.orange-labs.fr/fwbn0182/oidc-testing-tool:front
after_script:
- docker system prune -af
deploying🚀:
stage: deploy🚀
before_script:
- echo "${KUBECONFIG}" > kubeconfig
- export KUBECONFIG=kubeconfig
script:
#Rolling update
#- kubectl set image deploy test-backend -n test test-backend=registry.forge.orange-labs.fr/fwbn0182/oidc-testing-tool:backend
#- kubectl set image deploy test-ui -n test test-ui=registry.forge.orange-labs.fr/fwbn0182/oidc-testing-tool:front
- kubectl apply -f k8s/deploy/test-backend.yaml
- kubectl apply -f k8s/deploy/test-ui.yaml
- kubectl patch deployment test-backend -n test -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(date +%s)\"}}}}}"
- kubectl patch deployment test-ui -n test -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(date +%s)\"}}}}}"
cleaning:
stage: clean
tags:
- docker
script:
- docker system prune -af