-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
77 lines (73 loc) · 2.09 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
image: tiangolo/docker-with-compose
stages:
- check_docker_exist
- build_image
- coverage
- push
- push_version
- update_k8s
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
check_docker_exist:
tags:
- docker
- linux
stage: check_docker_exist
script:
- docker info
build_image:
tags:
- docker
- linux
stage: build_image
script:
- docker compose build
coverage:
tags:
- docker
- linux
stage: coverage
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+)%/'
script:
- echo $CI_JOB_TOKEN | docker login docker.idiap.ch -u gitlab-ci-token --password-stdin
- ./docker_run_tests.sh
- docker compose down
push:
tags:
- docker
- linux
stage: push
only:
- master
script:
- echo $CI_JOB_TOKEN | docker login docker.idiap.ch -u gitlab-ci-token --password-stdin
- docker push docker.idiap.ch/wenet/personal_context_builder:latest
- echo $DOCKERHUB_PASS | docker login -u $DOCKERHUB_USER --password-stdin
- docker tag docker.idiap.ch/wenet/personal_context_builder:latest internetofus/personal-context-builder:latest
- docker push internetofus/personal-context-builder:latest
push_version:
tags:
- docker
- linux
stage: push_version
only:
- tags
script:
- echo $CI_JOB_TOKEN | docker login docker.idiap.ch -u gitlab-ci-token --password-stdin
- docker tag docker.idiap.ch/wenet/personal_context_builder:latest docker.idiap.ch/wenet/personal_context_builder:$CI_COMMIT_TAG
- docker push docker.idiap.ch/wenet/personal_context_builder:$CI_COMMIT_TAG
- echo $DOCKERHUB_PASS | docker login -u $DOCKERHUB_USER --password-stdin
- docker tag docker.idiap.ch/wenet/personal_context_builder:$CI_COMMIT_TAG internetofus/personal-context-builder:$CI_COMMIT_TAG
- docker push internetofus/personal-context-builder:$CI_COMMIT_TAG
update_k8s:
tags:
- docker
- linux
stage: update_k8s
image: google/cloud-sdk
retry: 2
script:
- mkdir -p $HOME/.kube
- echo -n $KUBE_CONFIG | base64 -d > $HOME/.kube/config
- kubectl rollout restart deployment.apps/wenet-updater-deployment