Skip to content

Commit b0064b8

Browse files
authored
Merge pull request #135 from davidferlay/newrunner
Refactor CI runner
2 parents 66ad618 + 20085dd commit b0064b8

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

.gitlab-ci.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Variables to add in Gitalb UI : Settings > CI/CI
2+
# - REVIEW_DOMAIN // Mandatory, should equal to DNS of available runner server with docker + docker-compose
3+
# - SONAR_HOST // Optional
4+
# - SONAR_TOKEN // Optional
5+
16
image: skilldlabs/php:72
27

38
variables:
@@ -11,7 +16,7 @@ stages:
1116
- sniffers
1217
- deploy
1318
- tests
14-
- logs
19+
- reports
1520

1621

1722
sniffers:clang:
@@ -33,7 +38,7 @@ sniffers:phpcs:
3338
- docker -v
3439
- make phpcs
3540
tags:
36-
- review-apps-3
41+
- review-apps-4
3742

3843
sniffers:sonarqube:
3944
stage: sniffers
@@ -63,7 +68,7 @@ sniffers:sonarqube:
6368
only:
6469
- branches
6570
tags:
66-
- review-apps-3
71+
- review-apps-4
6772
dependencies:
6873
- sniffers:phpcs
6974

@@ -74,21 +79,22 @@ deploy:review:
7479
- echo "CI_ENVIRONMENT_NAME=${CI_ENVIRONMENT_NAME}"
7580
- echo "CI_ENVIRONMENT_SLUG=${CI_ENVIRONMENT_SLUG}"
7681
- echo "CI_ENVIRONMENT_URL=${CI_ENVIRONMENT_URL}"
82+
- echo "CI_PROJECT_PATH_SLUG=${CI_PROJECT_PATH_SLUG}"
7783
- echo "CI_PROJECT_NAME=${CI_PROJECT_NAME}"
7884
- echo "REVIEW_DOMAIN=${REVIEW_DOMAIN}"
7985
- mkdir -p ${BUILD_DIR}
8086
- rsync -ah --exclude=.git --delete ./ ${BUILD_DIR}
8187
- cd ${BUILD_DIR}
8288
- echo "COMPOSE_PROJECT_NAME=${CI_PROJECT_NAME}-${CI_ENVIRONMENT_SLUG}" >> .env.default
83-
- echo "MAIN_DOMAIN_NAME=${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}" >> .env.default
89+
- echo "MAIN_DOMAIN_NAME=${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}" >> .env.default
8490
- echo "INSTALL_DEV_DEPENDENCIES=TRUE" >> .env.default
8591
- docker --version
8692
- docker-compose --version
8793
- make all
8894
after_script:
8995
- echo "Started ${CI_ENVIRONMENT_URL} composition in ${BUILD_DIR} from Makefile."
9096
environment:
91-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
97+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
9298
name: review/$CI_COMMIT_REF_NAME
9399
on_stop: stop_review
94100

@@ -105,7 +111,7 @@ stop_review:
105111
test:behat:
106112
stage: tests
107113
environment:
108-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
114+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
109115
name: review/$CI_COMMIT_REF_NAME
110116
on_stop: stop_review
111117
script:
@@ -123,7 +129,7 @@ test:behat:
123129
- mv features/*.png web/screenshots/
124130
- echo "- Screenshots are available here :" && cd web/screenshots && ls -h *.png | xargs -i echo "${CI_ENVIRONMENT_URL}/screenshots/{}"
125131
tags:
126-
- review-apps-3
132+
- review-apps-4
127133
dependencies:
128134
- deploy:review
129135
only:
@@ -132,7 +138,7 @@ test:behat:
132138
test:cinsp:
133139
stage: tests
134140
environment:
135-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
141+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
136142
name: review/$CI_COMMIT_REF_NAME
137143
on_stop: stop_review
138144
script:
@@ -141,7 +147,7 @@ test:cinsp:
141147
- pwd
142148
- make cinsp
143149
tags:
144-
- review-apps-3
150+
- review-apps-4
145151
dependencies:
146152
- deploy:review
147153
only:
@@ -150,7 +156,7 @@ test:cinsp:
150156
test:drupalcheck:
151157
stage: tests
152158
environment:
153-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
159+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
154160
name: review/$CI_COMMIT_REF_NAME
155161
on_stop: stop_review
156162
script:
@@ -160,7 +166,7 @@ test:drupalcheck:
160166
- ls -lah
161167
- make drupalcheckval
162168
tags:
163-
- review-apps-3
169+
- review-apps-4
164170
dependencies:
165171
- deploy:review
166172
only:
@@ -169,7 +175,7 @@ test:drupalcheck:
169175
test:contentgen:
170176
stage: tests
171177
environment:
172-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
178+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
173179
name: review/$CI_COMMIT_REF_NAME
174180
on_stop: stop_review
175181
script:
@@ -178,17 +184,17 @@ test:contentgen:
178184
- pwd
179185
- make contentgen
180186
tags:
181-
- review-apps-3
187+
- review-apps-4
182188
dependencies:
183189
- deploy:review
184190
only:
185191
- branches
186192
when: manual
187193

188-
test:statusreportval:
189-
stage: tests
194+
report:statusreportval:
195+
stage: reports
190196
environment:
191-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
197+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
192198
name: review/$CI_COMMIT_REF_NAME
193199
on_stop: stop_review
194200
script:
@@ -197,16 +203,16 @@ test:statusreportval:
197203
- pwd
198204
- make statusreportval
199205
tags:
200-
- review-apps-3
206+
- review-apps-4
201207
dependencies:
202208
- deploy:review
203209
only:
204210
- branches
205211

206-
logs:watchdog:
207-
stage: logs
212+
report:watchdog:
213+
stage: reports
208214
environment:
209-
url: http://${CI_ENVIRONMENT_SLUG}.${REVIEW_DOMAIN}
215+
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_PATH_SLUG}.${REVIEW_DOMAIN}
210216
name: review/$CI_COMMIT_REF_NAME
211217
on_stop: stop_review
212218
script:
@@ -215,7 +221,7 @@ logs:watchdog:
215221
- pwd
216222
- make watchdogval
217223
tags:
218-
- review-apps-3
224+
- review-apps-4
219225
dependencies:
220226
- deploy:review
221227
only:

docker/docker-compose.override.yml.default

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ services:
2323
# networks:
2424
# - front
2525

26-
2726
# mysql:
2827
# image: percona:5.7.22
2928
# container_name: "${COMPOSE_PROJECT_NAME}_mysql"
@@ -48,7 +47,8 @@ services:
4847
- 'traefik.enable=true'
4948
- 'traefik.backend=${MAIN_DOMAIN_NAME}_mail'
5049
- 'traefik.port=8025'
51-
- 'traefik.frontend.rule=Host:mail.${MAIN_DOMAIN_NAME}'
50+
- 'traefik.frontend.rule=Host:mail-${MAIN_DOMAIN_NAME}'
51+
- 'traefik.frontend.redirect.entryPoint=https'
5252

5353
nginx:
5454
# Uncomment for MacOS.
@@ -62,6 +62,8 @@ services:
6262
- 'traefik.backend=${MAIN_DOMAIN_NAME}_web'
6363
- 'traefik.port=80'
6464
- 'traefik.frontend.rule=Host:${MAIN_DOMAIN_NAME}'
65+
- 'traefik.frontend.redirect.entryPoint=https'
66+
6567
#networks:
6668
# front:
6769
# driver: bridge

0 commit comments

Comments
 (0)