This repository has been archived by the owner on Jan 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
50 lines (40 loc) · 3.1 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
.PHONY: all
DOCKER_RUN_TEST_OPTIONS = --user www-data -w /home/www-data --rm
all: php test-php
.PHONY: php
php:
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php -t kreait/php:7.3 -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-dev -t kreait/php:7.3-dev -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm -t kreait/php:7.3-fpm -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm-dev -t kreait/php:7.3-fpm-dev -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php -t kreait/php:7.4 -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-dev -t kreait/php:7.4-dev -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm -t kreait/php:7.4-fpm -f php/Dockerfile php
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm-dev -t kreait/php:7.4-fpm-dev -f php/Dockerfile php
.PHONY: test-php
test-php:
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.3 bash -c "php -v | grep '7\.3'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.3-dev bash -c "php -v | grep '7\.3'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.3-fpm bash -c "php -v | grep '7\.3'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.3-fpm-dev bash -c "php -v | grep '7\.3'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.4 bash -c "php -v | grep '7\.4'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.4-dev bash -c "php -v | grep '7\.4'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.4-fpm bash -c "php -v | grep '7\.4'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.4-fpm-dev bash -c "php -v | grep '7\.4'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.3-dev bash -c "php -v | grep 'Xdebug'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.3-fpm-dev bash -c "php -v | grep 'Xdebug'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.4-dev bash -c "php -v | grep 'Xdebug'"
docker container run $(DOCKER_RUN_TEST_OPTIONS) kreait/php:7.4-fpm-dev bash -c "php -v | grep 'Xdebug'"
.PHONY: deploy
deploy:
docker push kreait/php:7.3
docker push kreait/php:7.3-dev
docker push kreait/php:7.3-fpm
docker push kreait/php:7.3-fpm-dev
docker push kreait/php:7.4
docker push kreait/php:7.4-dev
docker push kreait/php:7.4-fpm
docker push kreait/php:7.4-fpm-dev
.PHONY: clean
clean:
docker image ls -q kreait/php | xargs docker rmi -f