-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
445 lines (377 loc) · 14.3 KB
/
Makefile
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
include Makefile.lint
include Makefile.build_args
.PHONY: tests get_goss tests_php/tools
OS := $(shell uname | tr A-Z a-z)
GOSS_VERSION := 0.3.16
GOSS_GUEST_PATH := tests_php/bin/linux/${GOSS_VERSION}/goss
GOSS_HOST_PATH := tests_php/bin/${OS}/${GOSS_VERSION}/goss
COMPOSER_VERSION = $(shell curl -s https://getcomposer.org/ | grep '<p class="latest">' | grep -o '<strong>.*</strong>' | sed "s/<[^>]\+>//g")
COMPOSER1_VERSION = $(shell curl -s https://getcomposer.org/download/ | grep -e 'href="/download/1\..*/composer.phar"' | grep -m 1 -o '/download/.*/' | sed "s/[download\/]\+//g")
SHA384_COMPOSER_SETUP = $(shell curl -s https://composer.github.io/installer.sha384sum | cut -f 1 -d ' ')
SHA256_COMPOSER_BIN = $(shell curl -s https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar.sha256sum | cut -f 1 -d ' ')
SHA256_COMPOSER1_BIN = $(shell curl -s https://getcomposer.org/download/${COMPOSER1_VERSION}/composer.phar.sha256sum | cut -f 1 -d ' ')
SURY_VERSIONS=$(shell mkdir -p /tmp/docker-php && curl -o /tmp/docker-php/Packages -s https://packages.sury.org/php/dists/stretch/main/binary-amd64/Packages)
#VERSION_7_1=$(shell echo "${SURY_VERSIONS}" > /dev/null && grep -C3 "Package: php7.1-fpm$$" /tmp/docker-php/Packages | grep Version | cut -f 2 -d ' ')
#VERSION_7_2=$(shell echo "${SURY_VERSIONS}" > /dev/null && grep -C3 "Package: php7.2-fpm$$" /tmp/docker-php/Packages | grep Version | cut -f 2 -d ' ')
#VERSION_7_3=$(shell echo "${SURY_VERSIONS}" > /dev/null && grep -C3 "Package: php7.3-fpm$$" /tmp/docker-php/Packages | grep Version | cut -f 2 -d ' ')
VERSION_7_0=$(shell curl -sL https://packages.debian.org/fr/stretch/php | grep '<h1>.*php .1:' | sed -E 's/.*\(1:([0-9.+]+)\).*/\1/')
VERSION_7_3=$(shell curl -sL https://packages.debian.org/fr/buster/php | grep '<h1>.*php .2:' | sed -E 's/.*\(2:([0-9.+]+)\).*/\1/')
VERSION_7_4=$(shell curl -sL https://packages.debian.org/fr/bullseye/php | grep '<h1>.*php .2:' | sed -E 's/.*\(2:([0-9.+]+)\).*/\1/')
all: pull build
variables:
@echo "Composer_1: ${COMPOSER1_VERSION}"
@echo "Composer: ${COMPOSER_VERSION}"
@echo "Composer setup hash: ${SHA384_COMPOSER_SETUP}"
@echo "Commposer bin hash: ${SHA256_COMPOSER_BIN}"
@echo "${VERSION_7_0}"
#@echo "${VERSION_7_1}"
#@echo "${VERSION_7_2}"
@echo "${VERSION_7_3}"
@echo "${VERSION_7_4}"
update_composer_version:
for f in tests_php/vars/*; do \
sed -i 's/composer_version:.*/composer_version: $(COMPOSER_VERSION)/' $$f; \
done
git add tests_php/vars/*
git commit -m "update to composer $(COMPOSER_VERSION)"
pull:
docker pull bearstech/debian:stretch
docker pull bearstech/debian:buster
docker pull bearstech/debian:bullseye
#remove images with Sury dependance : 7.1 7.2
build: 7.0 7.3 7.4
7.4 : 7.4-fpm 7.4-composer 7.4-cli
7.3 : 7.3-fpm 7.3-composer 7.3-cli
7.2 : 7.2-fpm 7.2-composer 7.2-cli
7.1: 7.1-fpm 7.1-composer 7.1-cli
7.0: 7.0-fpm 7.0-composer 7.0-cli
# debian packages
7.0-fpm: 7.0-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php:7.0 \
-f Dockerfile.debian \
--build-arg PHP_VERSION=$(VERSION_7_0) \
--build-arg PHP_MINOR_VERSION=0 \
.
7.0-cli:
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-cli:7.0 \
-f Dockerfile.debian-cli \
--build-arg DEBIAN_VERSION=stretch \
--build-arg PHP_VERSION=$(VERSION_7_0) \
--build-arg PHP_MINOR_VERSION=0 \
.
7.0-composer: 7.0-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-composer:7.0 \
-f Dockerfile.7.x-composer \
--build-arg PHP_MINOR_VERSION=0 \
--build-arg SHA384_COMPOSER_SETUP=$(SHA384_COMPOSER_SETUP) \
--build-arg SHA256_COMPOSER_BIN="dc9dfdd2ffb1180d785b5a3d581c946ec6da135f55c9959f21b96fea7d7fb12d" \
--build-arg COMPOSER_VERSION="2.2.10" \
--build-arg SHA256_COMPOSER1_BIN=$(SHA256_COMPOSER1_BIN) \
--build-arg COMPOSER1_VERSION=$(COMPOSER1_VERSION) \
.
7.3-fpm: 7.3-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php:7.3 \
-f Dockerfile.debian \
--build-arg PHP_VERSION=$(VERSION_7_3) \
--build-arg PHP_MINOR_VERSION=3 \
.
7.3-cli:
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-cli:7.3 \
-f Dockerfile.debian-cli \
--build-arg DEBIAN_VERSION=buster \
--build-arg PHP_VERSION=$(VERSION_7_3) \
--build-arg PHP_MINOR_VERSION=3 \
.
7.3-composer: 7.3-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-composer:7.3 \
-f Dockerfile.7.x-composer \
--build-arg PHP_MINOR_VERSION=3 \
--build-arg SHA384_COMPOSER_SETUP=$(SHA384_COMPOSER_SETUP) \
--build-arg SHA256_COMPOSER_BIN=$(SHA256_COMPOSER_BIN) \
--build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) \
--build-arg SHA256_COMPOSER1_BIN=$(SHA256_COMPOSER1_BIN) \
--build-arg COMPOSER1_VERSION=$(COMPOSER1_VERSION) \
.
7.4-fpm: 7.4-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php:7.4 \
-f Dockerfile.debian \
--build-arg PHP_VERSION=$(VERSION_7_4) \
--build-arg PHP_MINOR_VERSION=4 \
.
docker tag bearstech/php:7.4 bearstech/php:latest
7.4-cli:
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-cli:7.4 \
-f Dockerfile.debian-cli \
--build-arg DEBIAN_VERSION=bullseye \
--build-arg PHP_VERSION=$(VERSION_7_4) \
--build-arg PHP_MINOR_VERSION=4 \
.
docker tag bearstech/php-cli:7.4 bearstech/php-cli:latest
7.4-composer: 7.4-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-composer:7.4 \
-f Dockerfile.7.x-composer \
--build-arg PHP_MINOR_VERSION=4 \
--build-arg SHA384_COMPOSER_SETUP=$(SHA384_COMPOSER_SETUP) \
--build-arg SHA256_COMPOSER_BIN=$(SHA256_COMPOSER_BIN) \
--build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) \
--build-arg SHA256_COMPOSER1_BIN=$(SHA256_COMPOSER1_BIN) \
--build-arg COMPOSER1_VERSION=$(COMPOSER1_VERSION) \
.
docker tag bearstech/php-composer:7.4 bearstech/php-composer:latest
# sury packages
7.1-fpm: 7.1-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php:7.1 \
-f Dockerfile.7.x \
--build-arg PHP_MINOR_VERSION=1 \
.
7.1-cli:
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-cli:7.1 \
-f Dockerfile.7.x-cli \
--build-arg PHP_MINOR_VERSION=1 \
--build-arg PHP_VERSION=$(VERSION_7_1) \
.
7.1-composer: 7.1-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-composer:7.1 \
-f Dockerfile.7.x-composer \
--build-arg PHP_MINOR_VERSION=1 \
--build-arg SHA384_COMPOSER_SETUP=$(SHA384_COMPOSER_SETUP) \
--build-arg SHA256_COMPOSER_BIN=$(SHA256_COMPOSER_BIN) \
--build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) \
--build-arg SHA256_COMPOSER1_BIN=$(SHA256_COMPOSER1_BIN) \
--build-arg COMPOSER1_VERSION=$(COMPOSER1_VERSION) \
.
7.2-fpm: 7.2-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php:7.2 \
-f Dockerfile.7.x \
--build-arg PHP_MINOR_VERSION=2 \
.
7.2-cli:
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-cli:7.2 \
-f Dockerfile.7.x-cli \
--build-arg PHP_MINOR_VERSION=2 \
--build-arg PHP_VERSION=$(VERSION_7_2) \
.
7.2-composer: 7.2-cli
docker build \
$(DOCKER_BUILD_ARGS) \
--no-cache \
-t bearstech/php-composer:7.2 \
-f Dockerfile.7.x-composer \
--build-arg PHP_MINOR_VERSION=2 \
--build-arg SHA384_COMPOSER_SETUP=$(SHA384_COMPOSER_SETUP) \
--build-arg SHA256_COMPOSER_BIN=$(SHA256_COMPOSER_BIN) \
--build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) \
--build-arg SHA256_COMPOSER1_BIN=$(SHA256_COMPOSER1_BIN) \
--build-arg COMPOSER1_VERSION=$(COMPOSER1_VERSION) \
.
push:
docker push bearstech/php:7.0
docker push bearstech/php:7.1
docker push bearstech/php:7.2
docker push bearstech/php:7.3
docker push bearstech/php:7.4
docker push bearstech/php:latest
docker push bearstech/php-cli:7.0
docker push bearstech/php-cli:7.1
docker push bearstech/php-cli:7.2
docker push bearstech/php-cli:7.3
docker push bearstech/php-cli:7.4
docker push bearstech/php-cli:latest
docker push bearstech/php-composer:7.0
docker push bearstech/php-composer:7.1
docker push bearstech/php-composer:7.2
docker push bearstech/php-composer:7.3
docker push bearstech/php-composer:7.4
docker push bearstech/php-composer:latest
remove_image:
docker rmi bearstech/php:7.0
docker rmi bearstech/php:7.1
docker rmi bearstech/php:7.2
docker rmi bearstech/php:latest
docker rmi bearstech/php-cli:7.0
docker rmi bearstech/php-cli:7.1
docker rmi bearstech/php-cli:7.2
docker rmi bearstech/php-cli:latest
docker rmi bearstech/php-composer:7.0
docker rmi bearstech/php-composer:7.1
docker rmi bearstech/php-composer:7.2
docker rmi bearstech/php-composer:7.4
docker rmi bearstech/php-composer:latest
clean:
rm -rf bin
tests_php/bin/goss:
mkdir -p tests_php/bin
curl -o tests_php/bin/goss -L https://github.com/aelsabbahy/goss/releases/download/v${GOSS_VERSION}/goss-linux-amd64
chmod +x tests_php/bin/goss
tests_php/tools: tests_php/bin/goss
test-7.0: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
--entrypoint "" \
bearstech/php:7.0 \
goss -g php-dev.yaml --vars vars/7_0.yaml validate --max-concurrent 4 --format documentation
test-cli-7.0: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-cli:7.0 \
goss -g php-dev.yaml --vars vars/7_0.yaml validate --max-concurrent 4 --format documentation
test-composer-7.0: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-composer:7.0 \
/bin/bash -c "goss -g php-composer.yaml --vars vars/7_0.yaml validate --max-concurrent 4 --format documentation && goss -g php_test_composer.yaml validate --format documentation"
test-7.1: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
--entrypoint "" \
bearstech/php:7.1 \
goss -g php-dev.yaml --vars vars/7_1.yaml validate --max-concurrent 4 --format documentation
test-cli-7.1: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-cli:7.1 \
goss -g php-dev.yaml --vars vars/7_1.yaml validate --max-concurrent 4 --format documentation
test-composer-7.1: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-composer:7.1 \
/bin/bash -c "goss -g php-composer.yaml --vars vars/7_1.yaml validate --max-concurrent 4 --format documentation && goss -g php_test_composer.yaml validate --format documentation"
test-7.2: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
--entrypoint "" \
bearstech/php:7.2 \
goss -g php-dev.yaml --vars vars/7_2.yaml validate --max-concurrent 4 --format documentation
test-cli-7.2: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-cli:7.2 \
goss -g php-dev.yaml --vars vars/7_2.yaml validate --max-concurrent 4 --format documentation
test-composer-7.2: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-composer:7.2 \
/bin/bash -c "goss -g php-composer.yaml --vars vars/7_2.yaml validate --max-concurrent 4 --format documentation && goss -g php_test_composer.yaml validate --format documentation"
test-7.3: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
--entrypoint "" \
bearstech/php:7.3 \
goss -g php-dev.yaml --vars vars/7_3.yaml validate --max-concurrent 4 --format documentation
test-cli-7.3: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-cli:7.3 \
goss -g php-dev.yaml --vars vars/7_3.yaml validate --max-concurrent 4 --format documentation
test-composer-7.3: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-composer:7.3 \
/bin/bash -c "goss -g php-composer.yaml --vars vars/7_3.yaml validate --max-concurrent 4 --format documentation && goss -g php_test_composer.yaml validate --format documentation"
test-7.4: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
--entrypoint "" \
bearstech/php:7.4 \
goss -g php-dev.yaml --vars vars/7_4.yaml validate --max-concurrent 4 --format documentation
test-cli-7.4: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-cli:7.4 \
goss -g php-dev.yaml --vars vars/7_4.yaml validate --max-concurrent 4 --format documentation
test-composer-7.4: tests_php/bin/goss
@docker run --rm -t \
-v `pwd`/tests_php/bin/goss:/usr/local/bin/goss \
-v `pwd`/tests_php:/goss \
-w /goss \
bearstech/php-composer:7.4 \
/bin/bash -c "goss -g php-composer.yaml --vars vars/7_4.yaml validate --max-concurrent 4 --format documentation && goss -g php_test_composer.yaml validate --format documentation"
test-html-7.0: tests_php/bin/goss
make -C tests_php do_docker_compose PHP_VERSION=7.0
test-html-7.1: tests_php/bin/goss
make -C tests_php do_docker_compose PHP_VERSION=7.1
test-html-7.2: tests_php/bin/goss
make -C tests_php do_docker_compose PHP_VERSION=7.2
test-html-7.3: tests_php/bin/goss
make -C tests_php do_docker_compose PHP_VERSION=7.3
test-html-7.4: tests_php/bin/goss
make -C tests_php do_docker_compose PHP_VERSION=7.4
test-html: test-html-7.0 test-html-7.1 test-html-7.2 test-html-7.3 test-html-7.4
tests-7.0: test-7.0 test-cli-7.0 test-composer-7.0 test-html-7.0
tests-7.1: test-7.1 test-cli-7.1 test-composer-7.1 test-html-7.1
tests-7.2: test-7.2 test-cli-7.2 test-composer-7.2 test-html-7.2
tests-7.3: test-7.3 test-cli-7.3 test-composer-7.3 test-html-7.3
tests-7.4: test-7.4 test-cli-7.4 test-composer-7.4 test-html-7.4
down:
#disable tests for unmaintened images tests-7.1 tests-7.2
tests: tests-7.0 tests-7.3 tests-7.4