-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
111 lines (98 loc) · 5.65 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
PKG_VERSION=1.26.2+mod.4
PKG_REL_PREFIX=1hn1
ifdef NO_CACHE
DOCKER_NO_CACHE=--no-cache
endif
LUAJIT_DEB_VERSION=2.1.20241113-1hn1
MODSECURITY_DEB_VERSION=3.0.12-2hn1
LOGUNLIMITED_BUILDER=logunlimited
# Ubuntu 24.04
deb-ubuntu2404: build-ubuntu2404
docker run --rm -v ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04:/dist nginx-ubuntu2404 bash -c \
"cp /src/*${PKG_VERSION}* /dist/"
docker run --rm -it nginx-ubuntu2404 /src/run-nginx-tests.sh 2>&1 | sudo tee ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04/nginx-tests-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04.log
sudo xz --force ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04/nginx-tests-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04.log
sudo tar zcf nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04.tar.gz ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04/
build-ubuntu2404: buildkit-logunlimited
sudo mkdir -p nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04
PKG_REL_DISTRIB=ubuntu24.04; \
(set -x; \
git config -l | sed -n '/^submodule\.[^.]*\.url/{s|^submodule\.||;s|\.url=|=|;p}' | sort; \
git submodule status; \
docker buildx build --progress plain --builder ${LOGUNLIMITED_BUILDER} --load \
${DOCKER_NO_CACHE} \
--build-arg OS_TYPE=ubuntu --build-arg OS_VERSION=24.04 \
--build-arg PKG_REL_DISTRIB=$${PKG_REL_DISTRIB} \
--build-arg PKG_VERSION=${PKG_VERSION} \
--build-arg LUAJIT_DEB_VERSION=${LUAJIT_DEB_VERSION} \
--build-arg LUAJIT_DEB_OS_ID=ubuntu24.04 \
--build-arg MODSECURITY_DEB_VERSION=${MODSECURITY_DEB_VERSION} \
--build-arg MODSECURITY_DEB_OS_ID=ubuntu24.04 \
-t nginx-ubuntu2404 . \
) 2>&1 | sudo tee nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04/nginx_${PKG_VERSION}-${PKG_REL_PREFIX}${PKG_REL_DISTRIB}.build.log && \
sudo xz --force nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu24.04/nginx_${PKG_VERSION}-${PKG_REL_PREFIX}${PKG_REL_DISTRIB}.build.log
run-ubuntu2404:
docker run --rm -it nginx-ubuntu2404 bash
# Ubuntu 22.04
deb-ubuntu2204: build-ubuntu2204
docker run --rm -v ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04:/dist nginx-ubuntu2204 bash -c \
"cp /src/*${PKG_VERSION}* /dist/"
docker run --rm -it nginx-ubuntu2204 /src/run-nginx-tests.sh 2>&1 | sudo tee ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04/nginx-tests-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04.log
sudo xz --force ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04/nginx-tests-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04.log
sudo tar zcf nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04.tar.gz ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04/
build-ubuntu2204: buildkit-logunlimited
sudo mkdir -p nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04
PKG_REL_DISTRIB=ubuntu22.04; \
(set -x; \
git config -l | sed -n '/^submodule\.[^.]*\.url/{s|^submodule\.||;s|\.url=|=|;p}' | sort; \
git submodule status; \
docker buildx build --progress plain --builder ${LOGUNLIMITED_BUILDER} --load \
${DOCKER_NO_CACHE} \
--build-arg OS_TYPE=ubuntu --build-arg OS_VERSION=22.04 \
--build-arg PKG_REL_DISTRIB=$${PKG_REL_DISTRIB} \
--build-arg PKG_VERSION=${PKG_VERSION} \
--build-arg LUAJIT_DEB_VERSION=${LUAJIT_DEB_VERSION} \
--build-arg LUAJIT_DEB_OS_ID=ubuntu22.04 \
--build-arg MODSECURITY_DEB_VERSION=${MODSECURITY_DEB_VERSION} \
--build-arg MODSECURITY_DEB_OS_ID=ubuntu22.04 \
-t nginx-ubuntu2204 . \
) 2>&1 | sudo tee nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04/nginx_${PKG_VERSION}-${PKG_REL_PREFIX}${PKG_REL_DISTRIB}.build.log && \
sudo xz --force nginx-${PKG_VERSION}-${PKG_REL_PREFIX}ubuntu22.04/nginx_${PKG_VERSION}-${PKG_REL_PREFIX}${PKG_REL_DISTRIB}.build.log
run-ubuntu2204:
docker run --rm -it nginx-ubuntu2204 bash
# Debian 12
deb-debian12: build-debian12
docker run --rm -v ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12:/dist nginx-debian12 bash -c \
"cp /src/*${PKG_VERSION}* /dist/"
docker run --rm -it nginx-debian12 /src/run-nginx-tests.sh 2>&1 | sudo tee ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12/nginx-tests-${PKG_VERSION}-${PKG_REL_PREFIX}debian12.log
sudo xz --force ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12/nginx-tests-${PKG_VERSION}-${PKG_REL_PREFIX}debian12.log
sudo tar zcf nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12.tar.gz ./nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12/
build-debian12: buildkit-logunlimited
sudo mkdir -p nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12
PKG_REL_DISTRIB=debian12; \
(set -x; \
git config -l | sed -n '/^submodule\.[^.]*\.url/{s|^submodule\.||;s|\.url=|=|;p}' | sort; \
git submodule status; \
docker buildx build --progress plain --builder ${LOGUNLIMITED_BUILDER} --load \
${DOCKER_NO_CACHE} \
--build-arg OS_TYPE=debian --build-arg OS_VERSION=12 \
--build-arg PKG_REL_DISTRIB=$${PKG_REL_DISTRIB} \
--build-arg PKG_VERSION=${PKG_VERSION} \
--build-arg LUAJIT_DEB_VERSION=${LUAJIT_DEB_VERSION} \
--build-arg LUAJIT_DEB_OS_ID=debian12 \
--build-arg MODSECURITY_DEB_VERSION=${MODSECURITY_DEB_VERSION} \
--build-arg MODSECURITY_DEB_OS_ID=debian12 \
-t nginx-debian12 . \
) 2>&1 | sudo tee nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12/nginx_${PKG_VERSION}-${PKG_REL_PREFIX}${PKG_REL_DISTRIB}.build.log && \
sudo xz --force nginx-${PKG_VERSION}-${PKG_REL_PREFIX}debian12/nginx_${PKG_VERSION}-${PKG_REL_PREFIX}${PKG_REL_DISTRIB}.build.log
run-debian12:
docker run --rm -it nginx-debian12 bash
buildkit-logunlimited:
if ! docker buildx inspect logunlimited 2>/dev/null; then \
docker buildx create --bootstrap --name ${LOGUNLIMITED_BUILDER} \
--driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=-1 \
--driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=-1; \
fi
exec:
docker exec -it $$(docker ps -q) bash
.PHONY: deb-debian12 run-debian12 build-debian12 deb-ubuntu2204 run-ubuntu2204 build-ubuntu2204 buildkit-logunlimited exec