-
Notifications
You must be signed in to change notification settings - Fork 167
/
.gitlab-ci.yml
222 lines (199 loc) · 9.68 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
stages:
- build
- build-chromium
- publish
- test
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
NAMESPACE: edbizarro/gitlab-ci-pipeline-php
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
Debian 8.0:
stage: build
variables:
IMAGE_VERSION: "8.0"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/$IMAGE_VERSION/Dockerfile .
- docker run -t --rm edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION -v
- docker run -t --rm edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION -m
- docker run -t --rm -v $(pwd):/var/www/html edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-$IMAGE_VERSION.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:latest
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:8
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:8
- docker push $NAMESPACE:latest
when: always
Debian 7.4:
stage: build
variables:
IMAGE_VERSION: "7.4"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/$IMAGE_VERSION/Dockerfile .
- docker run -t --rm edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION -m
- docker run -t --rm -v $(pwd):/var/www/html edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-$IMAGE_VERSION.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:7
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:7
when: always
Debian 7.3:
stage: build
variables:
IMAGE_VERSION: "7.3"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/$IMAGE_VERSION/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-$IMAGE_VERSION.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Alpine 8.0:
stage: build
variables:
IMAGE_VERSION: "8.0-alpine"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/alpine/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-8.0.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:alpine
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:alpine
when: always
Alpine 8.0 LTS:
stage: build
variables:
IMAGE_VERSION: "8.0-alpine-lts"
script:
- docker pull php:8.0-alpine || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/alpine/Dockerfile-lts .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-lts.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:alpine-lts
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:alpine-lts
when: always
Alpine 7.4:
stage: build
variables:
IMAGE_VERSION: "7.4-alpine"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/alpine/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-7.4.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Alpine 7.4 LTS:
stage: build
variables:
IMAGE_VERSION: "7.4-alpine-lts"
script:
- docker pull php:7.4-alpine || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/alpine/Dockerfile-lts .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-lts.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Alpine 7.3:
stage: build
variables:
IMAGE_VERSION: "7.3-alpine"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.3/alpine/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-7.3.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Alpine 7.3 LTS:
stage: build
variables:
IMAGE_VERSION: "7.3-alpine-lts"
script:
- docker pull php:7.3-alpine || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.3/alpine/Dockerfile-lts .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-lts.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
FPM 8.0:
stage: build
variables:
IMAGE_VERSION: "8.0-fpm"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/fpm/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-8.0.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:fpm
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:fpm
when: always
FPM 7.4:
stage: build
variables:
IMAGE_VERSION: "7.4-fpm"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/fpm/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-7.4.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
FPM 7.3:
stage: build
variables:
IMAGE_VERSION: "7.3-fpm"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.3/fpm/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-7.3.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Chromium 8.0:
stage: build-chromium
variables:
IMAGE_VERSION: "8.0-chromium"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/chromium/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-8.0.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
dependencies:
- Debian 8.0
Chromium 7.4:
stage: build-chromium
variables:
IMAGE_VERSION: "7.4-chromium"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/chromium/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-7.4.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
dependencies:
- Debian 7.4
Chromium 7.3:
stage: build-chromium
variables:
IMAGE_VERSION: "7.3-chromium"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.3/chromium/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html edbizarro/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-7.3.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
dependencies:
- Debian 7.3