-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
155 lines (128 loc) · 3.33 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
image: docker:20
stages:
- format
- lint
- test
- build
- deploy
services:
- docker:20-dind
variables:
DOCKER_BUILDKIT: 1
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# Template jobs
.dev-template:
script:
- docker pull $CI_REGISTRY_IMAGE/$SUBPROJECT:ci || true
- cd $SUBPROJECT
- docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/$SUBPROJECT:ci --target $CI_JOB_STAGE --tag $CI_REGISTRY_IMAGE/$SUBPROJECT:ci .
- docker push $CI_REGISTRY_IMAGE/$SUBPROJECT:ci
only:
- master
- merge_requests
.build-template:
stage: build
script:
- docker pull $CI_REGISTRY_IMAGE/$SUBPROJECT:ci || true
- cd $SUBPROJECT
- docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/$SUBPROJECT:ci --tag $CI_REGISTRY_IMAGE/$SUBPROJECT:ci .
- docker push $CI_REGISTRY_IMAGE/$SUBPROJECT:ci
only:
- master
- merge_requests
.deploy-template:
stage: deploy
script:
- docker pull $CI_REGISTRY_IMAGE/$SUBPROJECT:ci || true
- cd $SUBPROJECT
- docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE/$SUBPROJECT:ci --tag $CI_REGISTRY_IMAGE/$SUBPROJECT:latest .
- docker push $CI_REGISTRY_IMAGE/$SUBPROJECT:latest
only:
- master
# Client jobs
lint-client:
extends: .dev-template
stage: lint
needs: [] # Workaround to start job even though we don't have a format job (lint-client takes care of checking formatting)
variables:
SUBPROJECT: client
test-client:
extends: .dev-template
stage: test
needs: [lint-client]
variables:
SUBPROJECT: client
build-client:
extends: .build-template
needs: [test-client]
variables:
SUBPROJECT: client
deploy-client:
extends: .deploy-template
needs: [build-client]
variables:
SUBPROJECT: client
# Server jobs
format-server:
extends: .dev-template
stage: format
variables:
SUBPROJECT: server
lint-server:
extends: .dev-template
stage: lint
needs: [format-server]
variables:
SUBPROJECT: server
test-server:
extends: .dev-template
stage: test
needs: [lint-server]
variables:
SUBPROJECT: server
build-server:
extends: .build-template
needs: [test-server]
variables:
SUBPROJECT: server
deploy-server:
extends: .deploy-template
needs: [build-server]
variables:
SUBPROJECT: server
# Drone jobs
format-drone:
extends: .dev-template
stage: format
variables:
GIT_SUBMODULE_STRATEGY: recursive
SUBPROJECT: drone
build-drone:
extends: .build-template
needs: [format-drone]
variables:
GIT_SUBMODULE_STRATEGY: recursive
SUBPROJECT: drone
deploy-drone:
extends: .deploy-template
needs: [build-drone]
variables:
GIT_SUBMODULE_STRATEGY: recursive
SUBPROJECT: drone
# ARGoS jobs
format-argos:
extends: .dev-template
stage: format
variables:
SUBPROJECT: argos
build-argos:
extends: .build-template
needs: [format-argos]
variables:
SUBPROJECT: argos
deploy-argos:
extends: .deploy-template
needs: [build-argos]
variables:
SUBPROJECT: argos