-
Notifications
You must be signed in to change notification settings - Fork 75
/
Makefile
65 lines (52 loc) · 2.61 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
SHELL := /bin/bash
.PHONY: images docker-build pull-all docs docs-watch
.ONESHELL:
images: docker/*/Dockerfile docker/Dockerfile.*
.ONESHELL:
pull-all:
for file in $$(find docker/ -maxdepth 1 -type f -iname 'Dockerfile.*'); do \
NAME=$$(echo $$file | sed 's/^.*\.//'); \
echo "=> Pulling image $$NAME"; docker pull "ghcr.io/juliusknorr/nextcloud-dev-$${NAME}"; \
done
for file in $$(find docker -maxdepth 2 -type f -iname 'Dockerfile'); do \
NAME=$$(basename $$(dirname $$file)); \
echo "=> Pulling image $$NAME"; docker pull "ghcr.io/juliusknorr/nextcloud-dev-$${NAME}"; \
done
pull-installed:
docker image ls | grep juliusknorr/nextcloud-dev | cut -f 1 -d " "
docker image ls | grep juliusknorr/nextcloud-dev | cut -f 1 -d " " | xargs -L 1 docker pull
# Empty target to always build
docker-build:
docker/%/Dockerfile: docker-build
NAME=$$(basename $$(dirname $@)); \
echo "=> Building dockerfile" $@ as ghcr.io/juliusknorr/nextcloud-dev-$$NAME:latest; \
(cd docker && docker build -t ghcr.io/juliusknorr/nextcloud-dev-$$NAME:latest -f $$NAME/Dockerfile .)
docker/Dockerfile.%: docker-build
NAME=$$(echo $$(basename $@) | sed 's/^.*\.//'); \
echo "=> Building dockerfile" $@ as ghcr.io/juliusknorr/nextcloud-dev-$$NAME:latest; \
(cd docker && docker build -t ghcr.io/juliusknorr/nextcloud-dev-$$NAME:latest -f Dockerfile.$$NAME .)
check: dockerfilelint shellcheck
.ONESHELL:
dockerfilelint:
for file in $$(find docker/ -type f -iname 'Dockerfile.*' -maxdepth 1); do dockerfilelint $$file; done;
for file in $$(find docker -type f -iname 'Dockerfile' -maxdepth 2); do dockerfilelint $$file; done;
.ONESHELL:
shellcheck:
for file in $$(find . -type f -iname '*.sh' -not -path './wip/*'); do shellcheck --format=gcc -x $$file; done;
for file in $$(find ./scripts -type f); do shellcheck --format=gcc -x $$file; done;
.ONESHELL:
template-apply:
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:7.1/' > docker/Dockerfile.php71
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:7.2/' > docker/Dockerfile.php72
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:7.3/' > docker/Dockerfile.php73
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:7.4/' > docker/Dockerfile.php74
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:8.0/' > docker/Dockerfile.php80
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:8.1/' > docker/Dockerfile.php81
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:8.2/' > docker/php82/Dockerfile
cat docker/Dockerfile.php.template | sed 's/php:8.2/php:8.3/' > docker/php83/Dockerfile
docs:
pip3 install mkdocs
mkdocs
docs-watch:
pip3 install mkdocs
mkdocs serve