-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
137 lines (124 loc) · 3.4 KB
/
.gitlab-ci.yml
File metadata and controls
137 lines (124 loc) · 3.4 KB
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
stages:
- prerequisites
- build
- lint
- tests
- quality
variables:
CONTAINER_APP_IMAGE: ${CI_REGISTRY_IMAGE}/app:${CI_COMMIT_REF_SLUG}
.ci-trigger: &ci-trigger
# except:
# - pushes
only:
- master
- merge_requests
- tags
#-----------------------------------------------------------------------------------------------------------------------
# Stage prerequisites
#-----------------------------------------------------------------------------------------------------------------------
lint_dockerfiles:
<<: *ci-trigger
image: hadolint/hadolint:latest-debian
script:
- hadolint docker/app/Dockerfile
stage: prerequisites
#-----------------------------------------------------------------------------------------------------------------------
# Stage build
#-----------------------------------------------------------------------------------------------------------------------
build_app:
<<: *ci-trigger
script:
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker build --pull -t $CONTAINER_APP_IMAGE -f ./docker/app/Dockerfile .
- docker push $CONTAINER_APP_IMAGE
stage: build
tags:
- docker-build
#-----------------------------------------------------------------------------------------------------------------------
# Stage lint
#-----------------------------------------------------------------------------------------------------------------------
lint_css:
<<: *ci-trigger
image: node:6
script:
- npm install -g csslint
- ./cake_utils.sh lint_css
stage: lint
lint_js:
<<: *ci-trigger
image: node:6
script:
- npm install -g esvalidate
- ./cake_utils.sh lint_js
stage: lint
lint_php:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh lint_php
stage: lint
lint_po:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh lint_po
stage: lint
lint_sh:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh lint_sh
stage: lint
#-----------------------------------------------------------------------------------------------------------------------
# Stage tests
#-----------------------------------------------------------------------------------------------------------------------
tests_php:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh tests
stage: tests
variables:
DOCKER_TIMEZONE: Europe/Paris
#-----------------------------------------------------------------------------------------------------------------------
# Stage quality
#-----------------------------------------------------------------------------------------------------------------------
phpcpd:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh phpcpd
stage: quality
phpcs:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh phpcs
stage: quality
phpmd:
<<: *ci-trigger
image:
entrypoint: [""]
name: $CONTAINER_APP_IMAGE
script:
- cd /var/www/html/plugin
- ./cake_utils.sh phpmd
stage: quality