-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (44 loc) · 1.78 KB
/
Copy pathMakefile
File metadata and controls
52 lines (44 loc) · 1.78 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
REPOSITORY?=jsunier/php-symfony-test
BUILD_DATE="$(shell date -u +"%Y-%m-%dT%H:%m:%SZ")"
COMPOSER_VERSION=2
VERSIONS=8.0 7.4 7.3 7.2 7.1
LATEST_VERSION=8.0
.PHONY: build
build: build-mysql build-postgresql
.PHONY: build-mysql
build-mysql:
for VERSION in $(VERSIONS); do \
docker build php$$VERSION/mysql --pull --build-arg BUILD_DATE=$(BUILD_DATE) --build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) -t $(REPOSITORY):php$$VERSION-mysql -t $(REPOSITORY):php$$VERSION-mariadb; \
done
docker build php${LATEST_VERSION}/mysql --pull --build-arg BUILD_DATE=$(BUILD_DATE) --build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) -t $(REPOSITORY):latest -t $(REPOSITORY):latest-mysql
.PHONY: build-postgresql
build-postgresql:
for VERSION in $(VERSIONS); do \
docker build php$$VERSION/postgresql --pull --build-arg BUILD_DATE=$(BUILD_DATE) --build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) -t $(REPOSITORY):php$$VERSION-postgresql; \
done
docker build php${LATEST_VERSION}/postgresql --pull --build-arg BUILD_DATE=$(BUILD_DATE) --build-arg COMPOSER_VERSION=$(COMPOSER_VERSION) -t $(REPOSITORY):latest-postgresql
.PHONY: pull-php
pull-php:
for VERSION in $(VERSIONS); do \
docker pull php:$$VERSION-cli; \
done
docker pull php:latest
docker pull composer:${COMPOSER_VERSION}
.PHONY: push
push: push-mysql push-postgresql
.PHONY: push-mysql
push-mysql:
for VERSION in $(VERSIONS); do \
docker push $(REPOSITORY):php$$VERSION-mysql; \
docker push $(REPOSITORY):php$$VERSION-mariadb; \
done
docker push $(REPOSITORY):latest
docker push $(REPOSITORY):latest-mysql
.PHONY: push-postgresql
push-postgresql:
for VERSION in $(VERSIONS); do \
docker push $(REPOSITORY):php$$VERSION-postgresql; \
done
docker push $(REPOSITORY):latest-postgresql
.PHONY: all
all: build-mysql build-postgresql push-mysql push-postgresql