-
Notifications
You must be signed in to change notification settings - Fork 28
/
.gitlab-ci.yml
136 lines (119 loc) · 2.44 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
stages:
- docker
- tests
- quality-assurance
- deploy
image: mykiwi/docker
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
COMPOSE_FILE: "docker-compose.yml:docker-compose.gitlab-ci.yml"
.template-load-gitlab-image: &internal-image
before_script:
- cp -f .env.dist .env
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker-compose pull php node || true
.template-docker: &external-image
before_script:
- cp -f .env.dist .env
build-docker-images:
<<: *internal-image
stage: docker
script:
- docker-compose build --pull
- docker-compose push
only:
- master
tests:
<<: *internal-image
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
script:
- make start
- make test
artifacts:
paths:
- var/artefacts/coverage/
expire_in: 1 week
check-security:
<<: *internal-image
stage: quality-assurance
script:
- make start
- make security
check-yaml-files:
<<: *internal-image
stage: quality-assurance
script:
- make start
- make ly
check-twig-files:
<<: *internal-image
stage: quality-assurance
script:
- make start
- make lt
phpmd:
<<: *external-image
stage: quality-assurance
script:
- make phpmd || true # Bug with php 7.1
php_codesnifer:
<<: *external-image
stage: quality-assurance
script:
- make php_codesnifer
php-cs-fixer:
<<: *external-image
stage: quality-assurance
script:
- make php-cs-fixer
eslint:
<<: *internal-image
stage: quality-assurance
script:
- make start
- make eslint
phpcpd:
<<: *external-image
stage: quality-assurance
script:
- make phpcpd
phploc:
<<: *external-image
stage: quality-assurance
script:
- make phploc
pdepend:
<<: *external-image
stage: quality-assurance
script:
- make pdepend
artifacts:
paths:
- var/artefacts/pdepend_summary.xml
- var/artefacts/pdepend_jdepend.svg
- var/artefacts/pdepend_pyramid.svg
expire_in: 1 week
phpmetrics:
<<: *external-image
stage: quality-assurance
script:
- make phpmetrics
artifacts:
paths:
- var/artefacts/phpmetrics
expire_in: 1 week
ci-report:
stage: deploy
only:
- master
script:
- rm -rf public/*
- cp .gitlab-pages.html var/artefacts/index.html
- sed -i "s/PLACEHOLDER_GIT_COMMIT/${CI_COMMIT_SHA}/g" var/artefacts/index.html
- cp -R var/artefacts/* public/
artifacts:
paths:
- public