forked from argenos/fleet_management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
230 lines (206 loc) · 6.24 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
image: docker:stable
variables:
#DOCKER_HOST: tcp://docker:2375/
#DOCKER_DRIVER: overlay2
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
services:
- name: docker:dind
stages:
- build
- unit tests
- integration tests
- task request tests
- release
before_script:
- docker info
- apk add --no-cache py-pip
- pip install -qqq docker-compose==1.23.2
- docker-compose -v
- apk add --no-cache git
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN git.ropod.org:4567
- echo $CONTAINER_TEST_IMAGE
build:
stage: build
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
pylint:
before_script:
- pip install anybadge
image: $CONTAINER_TEST_IMAGE
stage: build
script:
- python3 .gitlab/lint.py
allow_failure: true
artifacts:
when: always
paths:
- pylint.svg
expire_in: 30 days
coverage:
before_script:
- echo "Coverage"
image: $CONTAINER_TEST_IMAGE
stage: build
script:
- pytest --collect-only --cov=fleet_management fleet_management/test/fms
allow_failure: true
docs:
stage: build
image: $CONTAINER_TEST_IMAGE
before_script:
- pip install sphinx sphinx_rtd_theme
script:
- cd docs
- make html
allow_failure: true
resource management:
before_script:
- echo "Unit tests"
image: $CONTAINER_TEST_IMAGE
stage: unit tests
script:
- pytest fleet_management/test/fms/resources/fleet
- pytest fleet_management/test/fms/resources/infrastructure
case 1:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_1 task_test_1 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 2:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_2 task_test_2 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 3:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_3 task_test_3 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 4:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_4 task_test_4 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 5:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_5 task_test_5 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 6:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_6 task_test_6 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 7:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_7 task_test_7 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
case 8:
stage: task request tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from task_test_8 task_test_8 fms robot_proxy_1 robot_1
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
com_mediator test:
stage: integration tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from com_mediator_test com_mediator_test robot_proxy_1 robot_1 task_relay task_requester fms com_mediator
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
elevator monitor:
stage: integration tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from elevator_monitor_test elevator_monitor_test elevator
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
elevator workflow:
stage: integration tests
retry: 2
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up -d elevator
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from elevator_test elevator_test fms
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
path planner requests:
stage: integration tests
script:
- docker-compose -f .gitlab/docker-compose.yml up path_planner_test
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
when: always
query interface:
stage: integration tests
script:
- docker-compose up -d roscore
- docker-compose -f .gitlab/docker-compose.yml up --exit-code-from query_interface_test query_interface_test
- docker-compose logs
after_script:
- echo "Stoping all containers"
- docker stop $(docker ps -aq)
stable image:
variables:
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:stable
stage: release
script:
- docker build -t $CONTAINER_TEST_IMAGE .
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_TEST_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
- tags
latest image:
stage: release
variables:
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
script:
- docker build -t $CONTAINER_TEST_IMAGE .
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_TEST_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- develop