Skip to content

Commit fe1b7e8

Browse files
authored
chore: definable of openresty version (#327)
1 parent 2a1b948 commit fe1b7e8

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

build-apisix-base.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set -x
44

55
version=${version:-0.0.0}
66

7+
OPENRESTY_VERSION=${OPENRESTY_VERSION:-1.21.4.1}
8+
if [ "$OPENRESTY_VERSION" == "source" ] || [ "$OPENRESTY_VERSION" == "default" ]; then
9+
OPENRESTY_VERSION="1.21.4.1"
10+
fi
11+
712
if ([ $# -gt 0 ] && [ "$1" == "latest" ]) || [ "$version" == "latest" ]; then
813
ngx_multi_upstream_module_ver="master"
914
mod_dubbo_ver="master"
@@ -31,9 +36,8 @@ repo=$(basename "$prev_workdir")
3136
workdir=$(mktemp -d)
3237
cd "$workdir" || exit 1
3338

34-
or_ver="1.21.4.1"
35-
wget --no-check-certificate https://openresty.org/download/openresty-${or_ver}.tar.gz
36-
tar -zxvpf openresty-${or_ver}.tar.gz > /dev/null
39+
wget --no-check-certificate https://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz
40+
tar -zxvpf openresty-${OPENRESTY_VERSION}.tar.gz > /dev/null
3741

3842
if [ "$repo" == ngx_multi_upstream_module ]; then
3943
cp -r "$prev_workdir" ./ngx_multi_upstream_module-${ngx_multi_upstream_module_ver}
@@ -92,11 +96,11 @@ else
9296
fi
9397

9498
cd ngx_multi_upstream_module-${ngx_multi_upstream_module_ver} || exit 1
95-
./patch.sh ../openresty-${or_ver}
99+
./patch.sh ../openresty-${OPENRESTY_VERSION}
96100
cd ..
97101

98102
cd apisix-nginx-module-${apisix_nginx_module_ver}/patch || exit 1
99-
./patch.sh ../../openresty-${or_ver}
103+
./patch.sh ../../openresty-${OPENRESTY_VERSION}
100104
cd ../..
101105

102106
cd wasm-nginx-module-${wasm_nginx_module_ver} || exit 1
@@ -111,14 +115,16 @@ no_pool_patch=${no_pool_patch:-}
111115
# version of grpc-client-nginx-module
112116
grpc_engine_path="-DNGX_GRPC_CLI_ENGINE_PATH=$OR_PREFIX/libgrpc_engine.so -DNGX_HTTP_GRPC_CLI_ENGINE_PATH=$OR_PREFIX/libgrpc_engine.so"
113117

114-
cd openresty-${or_ver} || exit 1
118+
cd openresty-${OPENRESTY_VERSION} || exit 1
115119

120+
if [[ "$OPENRESTY_VERSION" == 1.21.4.1 ]] || [[ "$OPENRESTY_VERSION" == 1.19.* ]]; then
116121
# FIXME: remove this once 1.21.4.2 is released
117122
rm -rf bundle/LuaJIT-2.1-20220411
118123
lj_ver=2.1-20230119
119124
wget "https://github.com/openresty/luajit2/archive/v$lj_ver.tar.gz" -O "LuaJIT-$lj_ver.tar.gz"
120125
tar -xzf LuaJIT-$lj_ver.tar.gz
121126
mv luajit2-* bundle/LuaJIT-2.1-20220411
127+
fi
122128

123129
or_limit_ver=0.08
124130
if [ ! -d "bundle/lua-resty-limit-traffic-$or_limit_ver" ]; then

0 commit comments

Comments
 (0)