-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
155 lines (120 loc) · 10.5 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
LOCAL ?= 0
DEPLOY ?= 0
BUILDX = buildx
PLATFORM = --platform=linux/amd64,linux/arm64,linux/arm/v7
REGISTRY = localhost:5000/
PUSH = --push
ifeq ($(DEPLOY),1)
REGISTRY =
endif
ifeq ($(LOCAL),1)
PUSH =
REGISTRY =
BUILDX =
PLATFORM =
endif
DOCKER_RUN_TEST_OPTIONS = --user www-data -w /home/www-data --rm
.PHONY: all
all: alpine test-alpine php test-php
.PHONY: deploy
deploy: alpine php
.PHONY: alpine alpine313 alpine314 alpine315 alpine316 alpine318 alpine319 alpine320 alpineedge
alpine: alpine319 alpine320 alpineedge
alpine313:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.13 alpine/3.13
alpine314:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.14 alpine/3.14
alpine315:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.15 alpine/3.15
alpine316:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.16 alpine/3.16
alpine318:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.18 alpine/3.18
alpine319:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.19 alpine/3.19
alpine320:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.20 -t $(REGISTRY)williarin/alpine:latest alpine/3.20 --target prod
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:3.20-dev -t $(REGISTRY)williarin/alpine:dev alpine/3.20 --target dev
alpineedge:
docker $(BUILDX) build $(PUSH) --no-cache $(PLATFORM) -t $(REGISTRY)williarin/alpine:edge alpine/edge
.PHONY: test-alpine test-alpine313 test-alpine314 test-alpine315 test-alpine316 test-alpine318 test-alpineedge
test-alpine: test-alpine319 test-alpine320 test-alpineedge
test-alpine313:
docker run --rm $(REGISTRY)williarin/alpine:3.13 /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.13 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.13'"
test-alpine314:
docker run --rm $(REGISTRY)williarin/alpine:3.14 /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.14 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.14'"
test-alpine315:
docker run --rm $(REGISTRY)williarin/alpine:3.15 /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.15 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.15'"
test-alpine316:
docker run --rm $(REGISTRY)williarin/alpine:3.16 /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.16 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.16'"
test-alpine318:
docker run --rm $(REGISTRY)williarin/alpine:3.18 /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.18 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.18'"
test-alpine319:
docker run --rm $(REGISTRY)williarin/alpine:3.19 /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.19 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.19'"
test-alpine320:
docker run --rm $(REGISTRY)williarin/alpine:3.20 /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.20'"
docker run --rm $(REGISTRY)williarin/alpine:3.20-dev /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:3.20-dev /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux v3.20'"
test-alpineedge:
docker run --rm $(REGISTRY)williarin/alpine:edge /bin/sh -c "zsh --version | grep -e '^zsh [0-9]\.[0-9]'"
docker run --rm $(REGISTRY)williarin/alpine:edge /bin/sh -c "cat /etc/os-release | grep -e 'Alpine Linux edge'"
.PHONY: php php7 php8 php81 php82 php83
php: php8 php81 php82 php83
php7:
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=7.4 --target php -t $(REGISTRY)williarin/php:7.4 php/7.4
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=7.4 --target php-dev -t $(REGISTRY)williarin/php:7.4-dev php/7.4
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=7.4 --target php-fpm -t $(REGISTRY)williarin/php:7.4-fpm php/7.4
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=7.4 --target php-fpm-dev -t $(REGISTRY)williarin/php:7.4-fpm-dev php/7.4
php8:
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.0 --target php -t $(REGISTRY)williarin/php:8.0 php/8.0
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.0 --target php-dev -t $(REGISTRY)williarin/php:8.0-dev php/8.0
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.0 --target php-fpm -t $(REGISTRY)williarin/php:8.0-fpm php/8.0
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.0 --target php-fpm-dev -t $(REGISTRY)williarin/php:8.0-fpm-dev php/8.0
php81:
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.1 --target php -t $(REGISTRY)williarin/php:8.1 php/8.1
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.1 --target php-dev -t $(REGISTRY)williarin/php:8.1-dev php/8.1
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.1 --target php-fpm -t $(REGISTRY)williarin/php:8.1-fpm php/8.1
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.1 --target php-fpm-dev -t $(REGISTRY)williarin/php:8.1-fpm-dev php/8.1
php82:
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.2 --target php -t $(REGISTRY)williarin/php:8.2 php/8.2
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.2 --target php-dev -t $(REGISTRY)williarin/php:8.2-dev php/8.2
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.2 --target php-fpm -t $(REGISTRY)williarin/php:8.2-fpm php/8.2
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.2 --target php-fpm-dev -t $(REGISTRY)williarin/php:8.2-fpm-dev php/8.2
php83:
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.3 --target php -t $(REGISTRY)williarin/php:8.3 php/8.3
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.3 --target php-dev -t $(REGISTRY)williarin/php:8.3-dev php/8.3
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.3 --target php-fpm -t $(REGISTRY)williarin/php:8.3-fpm php/8.3
docker $(BUILDX) build $(PUSH) $(PLATFORM) --no-cache --build-arg REGISTRY=$(REGISTRY) --build-arg ALPINE_VERSION=latest --build-arg PHP_VERSION=8.3 --target php-fpm-dev -t $(REGISTRY)williarin/php:8.3-fpm-dev php/8.3
.PHONY: test-php test-php7 test-php8 test-php81 test-php82 test-php83
test-php: test-php8 test-php81 test-php82 test-php83
test-php7:
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:7.4 bash -c "php -v | grep '7\.4'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:7.4-dev bash -c "php -v | grep '7\.4' && php -v | grep 'Xdebug v3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:7.4-fpm bash -c "php -v | grep '7\.4'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:7.4-fpm-dev bash -c "php -v | grep '7\.4' && php -v | grep 'Xdebug v3'"
test-php8:
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.0 bash -c "php -v | grep '8\.0'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.0-dev bash -c "php -v | grep '8\.0' && php -v | grep 'Xdebug v3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.0-fpm bash -c "php -v | grep '8\.0'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.0-fpm-dev bash -c "php -v | grep '8\.0' && php -v | grep 'Xdebug v3'"
test-php81:
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.1 bash -c "php -v | grep '8\.1'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.1-dev bash -c "php -v | grep '8\.1' && php -v | grep 'Xdebug v3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.1-fpm bash -c "php -v | grep '8\.1'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.1-fpm-dev bash -c "php -v | grep '8\.1' && php -v | grep 'Xdebug v3'"
test-php82:
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.2 bash -c "php -v | grep '8\.2'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.2-dev bash -c "php -v | grep '8\.2' && php -v | grep 'Xdebug v3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.2-fpm bash -c "php -v | grep '8\.2'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.2-fpm-dev bash -c "php -v | grep '8\.2' && php -v | grep 'Xdebug v3'"
test-php83:
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.3 bash -c "php -v | grep '8\.3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.3-dev bash -c "php -v | grep '8\.3' && php -v | grep 'Xdebug v3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.3-fpm bash -c "php -v | grep '8\.3'"
docker run $(DOCKER_RUN_TEST_OPTIONS) $(REGISTRY)williarin/php:8.3-fpm-dev bash -c "php -v | grep '8\.3' && php -v | grep 'Xdebug v3'"