-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildall.sh
executable file
·48 lines (41 loc) · 1.36 KB
/
buildall.sh
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
#!/bin/bash
##################################################################################
# Builds an entire release with all supported NGINX versions and Linux OS versions
##################################################################################
NGINX_VERSIONS=('1.18.0' '1.24.0' '1.25.5')
LINUX_DISTROS=('ubuntu18' 'ubuntu20' 'ubuntu22')
rm log.txt 2>/dev/null
#
# Avoid building modules for platforms NGINX does not support
#
function isValidBuild() {
local LINUX_DISTRO_PARAM=$1
local NGINX_VERSION_PARAM=$2
if [ "$LINUX_DISTRO_PARAM" == 'ubuntu24' ] && [[ '1.25.5' > "$NGINX_VERSION_PARAM" ]]; then
echo 'false'
elif [ "$LINUX_DISTRO_PARAM" == 'debian12' ] && [[ '1.25.1' > "$NGINX_VERSION_PARAM" ]]; then
echo 'false'
else
echo 'true'
fi
}
#
# Build modules for all supported environments and versions
#
for LINUX_DISTRO in ${LINUX_DISTROS[@]}
do
for NGINX_VERSION in ${NGINX_VERSIONS[@]}
do
if [ "$(isValidBuild $LINUX_DISTRO $NGINX_VERSION)" == 'true' ]; then
echo "Building the NGINX $NGINX_VERSION phantom token module for $LINUX_DISTRO ..."
export NGINX_VERSION=$NGINX_VERSION
export LINUX_DISTRO=$LINUX_DISTRO
./build.sh
if [ $? -ne 0 ]; then
exit 1
fi
else
echo "Skipping unsupported build for NGINX $NGINX_VERSION and $LINUX_DISTRO ..."
fi
done
done