forked from brefphp/extra-php-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (38 loc) · 1.25 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
SHELL := /bin/bash
php_versions = 72 73 74
docker-images:
PWD=pwd
set -e; \
for dir in layers/*; do \
for php_version in $(php_versions); do \
echo "###############################################"; \
echo "###############################################"; \
echo "### Building $${dir} PHP$${php_version}"; \
echo "###"; \
cd ${PWD} ; cd $${dir} ; \
docker build -t bref/$${dir}-php-$${php_version} --build-arg PHP_VERSION=$${php_version} ${DOCKER_BUILD_FLAGS} . ; \
echo ""; \
done \
done
# The PHP runtimes
layers: docker-images
PWD=pwd
rm -rf export/layer-*.zip || true
mkdir export/tmp
set -e; \
for dir in layers/*; do \
for php_version in $(php_versions); do \
echo "###############################################"; \
echo "###############################################"; \
echo "### Exporting $${dir} PHP$${php_version}"; \
echo "###"; \
cd ${PWD} ; rm -rf export/tmp/* || true ; cd export/tmp ; \
docker run --entrypoint "tar" bref/$${dir}-php-$${php_version} -ch -C /opt . | tar -x ; \
zip --quiet -X --recurse-paths ../`echo "$${dir}-php-$${php_version}" | sed -e "s/layers\//layer-/g"`.zip . ; \
echo ""; \
done \
done
rm -rf export/tmp
publish: layers
php ./bref-extra publish
php ./bref-extra list