Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit 5410e33

Browse files
linting
1 parent 7ee086c commit 5410e33

File tree

134 files changed

+239
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+239
-222
lines changed

Diff for: .editorconfig

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ root = true
44
charset = utf-8
55
end_of_line = lf
66
insert_final_newline = true
7-
indent_size = 4
7+
indent_size = 2
88
indent_style = space
99
trim_trailing_whitespace = true
1010

11-
[*.{json,yml,yaml}]
12-
indent_size = 2
11+
[*.sh]
12+
indent_size = 4
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

Diff for: .github/linters/.dockerfilelintrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
rules:
22
invalid_command: off
3+
base_image_tag: off

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Lua is a lightweight, high-level, multi-paradigm programming language designed p
9797
> - doing arbitrarily complex access control and security checks in Lua before requests actually reach the upstream backends,
9898
> - manipulating response headers in an arbitrary way (by Lua)
9999
> - fetching backend information from external storage backends (like redis, memcached, mysql, postgresql) and use that information to choose which upstream backend to access on-the-fly,
100-
> - coding up arbitrarily complex web applications in a content handler using synchronous but still non-blocking access to the database backends and other > storage,
100+
> - coding up arbitrarily complex web applications in a content handler using synchronous but still non-blocking access to the database backends and other storage,
101101
> - doing very complex URL dispatch in Lua at rewrite phase,
102102
> - using Lua to implement advanced caching mechanism for Nginx's subrequests and arbitrary locations.
103103
>

Diff for: bin/_common.sh

+20-14
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@
44
source supported_versions
55

66
function docker_tag_exists() {
7-
curl --silent -f -lSL "https://index.docker.io/v1/repositories/$1/tags/$2" > /dev/null
7+
curl --silent -f -lSL "https://index.docker.io/v1/repositories/$1/tags/$2" >/dev/null
88
echo $?
99
}
1010

1111
function get_versions() {
1212
OS=$1
1313
VERSIONS=()
14-
if [ "$OS" == "alpine" ]; then echo "${ALPINE[@]}"
15-
elif [ "$OS" == "amazonlinux" ]; then echo "${AMAZONLINUX[@]}"
16-
elif [ "$OS" == "centos" ]; then echo "${CENTOS[@]}"
17-
elif [ "$OS" == "debian" ]; then echo "${DEBIAN[@]}"
18-
elif [ "$OS" == "fedora" ]; then echo "${FEDORA[@]}"
19-
elif [ "$OS" == "ubuntu" ]; then echo "${UBUNTU[@]}"
14+
if [ "$OS" == "alpine" ]; then
15+
echo "${ALPINE[@]}"
16+
elif [ "$OS" == "amazonlinux" ]; then
17+
echo "${AMAZONLINUX[@]}"
18+
elif [ "$OS" == "centos" ]; then
19+
echo "${CENTOS[@]}"
20+
elif [ "$OS" == "debian" ]; then
21+
echo "${DEBIAN[@]}"
22+
elif [ "$OS" == "fedora" ]; then
23+
echo "${FEDORA[@]}"
24+
elif [ "$OS" == "ubuntu" ]; then
25+
echo "${UBUNTU[@]}"
2026
fi
2127
}
2228

@@ -25,11 +31,11 @@ function loop_over_nginx_with_os() {
2531
FUNC=$2
2632

2733
LEN_VER_NGINX=${#NGINX[@]}
28-
for (( I=0; I<LEN_VER_NGINX; I++ )); do
34+
for ((I = 0; I < LEN_VER_NGINX; I++ )); do
2935
NGINX_VER="${NGINX[$I]}"
3036

3137
LAST_VER_NGINX=0
32-
if [ "$((I+1))" == "$LEN_VER_NGINX" ]; then
38+
if [ "$((I + 1))" == "$LEN_VER_NGINX" ]; then
3339
LAST_VER_NGINX=1
3440
fi
3541

@@ -48,11 +54,11 @@ function loop_over_nginx() {
4854
FUNC=$1
4955

5056
LEN_VER_NGINX=${#NGINX[@]}
51-
for (( I=0; I<LEN_VER_NGINX; I++ )); do
57+
for ((I = 0; I < LEN_VER_NGINX; I++ )); do
5258
export NGINX_VER="${NGINX[$I]}"
5359

5460
export LAST_VER_NGINX=0
55-
if [ "$((I+1))" == "$LEN_VER_NGINX" ]; then
61+
if [ "$((I + 1))" == "$LEN_VER_NGINX" ]; then
5662
export LAST_VER_NGINX=1
5763
fi
5864

@@ -85,14 +91,14 @@ function loop_over_os() {
8591
FUNC=$2
8692

8793
LEN_VER_OS=${#VERSIONS[@]}
88-
for (( J=0; J<LEN_VER_OS; J++ )); do
94+
for ((J = 0; J < LEN_VER_OS; J++ )); do
8995
export OS_VER="${VERSIONS[$J]}";
9096

9197
export LAST_VER_OS=0
92-
if [ "$((J+1))" == "$LEN_VER_OS" ]; then
98+
if [ "$((J + 1))" == "$LEN_VER_OS" ]; then
9399
export LAST_VER_OS=1
94100
fi
95101

96-
${FUNC};
102+
${FUNC}
97103
done
98104
}

Diff for: bin/benchmark.sh

+43-43
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ sudo apt-get install \
1313
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
1414
sudo apt-key fingerprint 0EBFCD88
1515
sudo add-apt-repository \
16-
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
17-
$(lsb_release -cs) \
18-
stable"
16+
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
17+
$(lsb_release -cs) \
18+
stable"
1919
sudo apt-get update
2020
sudo apt-get install docker-ce docker-ce-cli containerd.io
2121
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
@@ -27,96 +27,96 @@ npm install artillery
2727
docker-compose -f docker-compose.test.yml up -d
2828

2929
echo "ARTILLERY - NGINX"
30-
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.1.txt
30+
./node_modules/.bin/artillery run test/artillery-nginx.yml >artillery.nginx.1.txt
3131
echo "ARTILLERY - NGINX-LUA"
32-
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.1.txt
32+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml >artillery.nginx-lua.1.txt
3333
echo "ARTILLERY - OPENRESTY"
34-
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.1.txt
34+
./node_modules/.bin/artillery run test/artillery-openresty.yml >artillery.openresty.1.txt
3535

3636
echo "ARTILLERY - NGINX"
37-
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.2.txt
37+
./node_modules/.bin/artillery run test/artillery-nginx.yml >artillery.nginx.2.txt
3838
echo "ARTILLERY - NGINX-LUA"
39-
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.2.txt
39+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml >artillery.nginx-lua.2.txt
4040
echo "ARTILLERY - OPENRESTY"
41-
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.2.txt
41+
./node_modules/.bin/artillery run test/artillery-openresty.yml >artillery.openresty.2.txt
4242

4343
echo "ARTILLERY - NGINX"
44-
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.3.txt
44+
./node_modules/.bin/artillery run test/artillery-nginx.yml >artillery.nginx.3.txt
4545
echo "ARTILLERY - NGINX-LUA"
46-
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.3.txt
46+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml >artillery.nginx-lua.3.txt
4747
echo "ARTILLERY - OPENRESTY"
48-
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.3.txt
48+
./node_modules/.bin/artillery run test/artillery-openresty.yml >artillery.openresty.3.txt
4949

5050
echo "ARTILLERY - NGINX"
51-
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.4.txt
51+
./node_modules/.bin/artillery run test/artillery-nginx.yml >artillery.nginx.4.txt
5252
echo "ARTILLERY - NGINX-LUA"
53-
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.4.txt
53+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml >artillery.nginx-lua.4.txt
5454
echo "ARTILLERY - OPENRESTY"
55-
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.4.txt
55+
./node_modules/.bin/artillery run test/artillery-openresty.yml >artillery.openresty.4.txt
5656

5757
echo "ARTILLERY - NGINX"
58-
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.5.txt
58+
./node_modules/.bin/artillery run test/artillery-nginx.yml >artillery.nginx.5.txt
5959
echo "ARTILLERY - NGINX-LUA"
60-
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.5.txt
60+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml >artillery.nginx-lua.5.txt
6161
echo "ARTILLERY - OPENRESTY"
62-
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.5.txt
62+
./node_modules/.bin/artillery run test/artillery-openresty.yml >artillery.openresty.5.txt
6363

6464
#####
6565

6666
echo "ARTILLERY - ALPINE"
67-
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.1.txt
67+
./node_modules/.bin/artillery run test/artillery-alpine.yml >artillery.alpine.1.txt
6868
echo "ARTILLERY - UBUNTU"
69-
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.1.txt
69+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml >artillery.ubuntu.1.txt
7070
echo "ARTILLERY - DEBIAN"
71-
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.1.txt
71+
./node_modules/.bin/artillery run test/artillery-debian.yml >artillery.debian.1.txt
7272
echo "ARTILLERY - FEDORA"
73-
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.1.txt
73+
./node_modules/.bin/artillery run test/artillery-fedora.yml >artillery.fedora.1.txt
7474
echo "ARTILLERY - CENTOS"
75-
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.1.txt
75+
./node_modules/.bin/artillery run test/artillery-centos.yml >artillery.centos.1.txt
7676

7777
echo "ARTILLERY - ALPINE"
78-
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.2.txt
78+
./node_modules/.bin/artillery run test/artillery-alpine.yml >artillery.alpine.2.txt
7979
echo "ARTILLERY - UBUNTU"
80-
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.2.txt
80+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml >artillery.ubuntu.2.txt
8181
echo "ARTILLERY - DEBIAN"
82-
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.2.txt
82+
./node_modules/.bin/artillery run test/artillery-debian.yml >artillery.debian.2.txt
8383
echo "ARTILLERY - FEDORA"
84-
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.2.txt
84+
./node_modules/.bin/artillery run test/artillery-fedora.yml >artillery.fedora.2.txt
8585
echo "ARTILLERY - CENTOS"
86-
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.2.txt
86+
./node_modules/.bin/artillery run test/artillery-centos.yml >artillery.centos.2.txt
8787

8888
echo "ARTILLERY - ALPINE"
89-
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.3.txt
89+
./node_modules/.bin/artillery run test/artillery-alpine.yml >artillery.alpine.3.txt
9090
echo "ARTILLERY - UBUNTU"
91-
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.3.txt
91+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml >artillery.ubuntu.3.txt
9292
echo "ARTILLERY - DEBIAN"
93-
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.3.txt
93+
./node_modules/.bin/artillery run test/artillery-debian.yml >artillery.debian.3.txt
9494
echo "ARTILLERY - FEDORA"
95-
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.3.txt
95+
./node_modules/.bin/artillery run test/artillery-fedora.yml >artillery.fedora.3.txt
9696
echo "ARTILLERY - CENTOS"
97-
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.3.txt
97+
./node_modules/.bin/artillery run test/artillery-centos.yml >artillery.centos.3.txt
9898

9999
echo "ARTILLERY - ALPINE"
100-
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.4.txt
100+
./node_modules/.bin/artillery run test/artillery-alpine.yml >artillery.alpine.4.txt
101101
echo "ARTILLERY - UBUNTU"
102-
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.4.txt
102+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml >artillery.ubuntu.4.txt
103103
echo "ARTILLERY - DEBIAN"
104-
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.4.txt
104+
./node_modules/.bin/artillery run test/artillery-debian.yml >artillery.debian.4.txt
105105
echo "ARTILLERY - FEDORA"
106-
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.4.txt
106+
./node_modules/.bin/artillery run test/artillery-fedora.yml >artillery.fedora.4.txt
107107
echo "ARTILLERY - CENTOS"
108-
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.4.txt
108+
./node_modules/.bin/artillery run test/artillery-centos.yml >artillery.centos.4.txt
109109

110110
echo "ARTILLERY - ALPINE"
111-
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.5.txt
111+
./node_modules/.bin/artillery run test/artillery-alpine.yml >artillery.alpine.5.txt
112112
echo "ARTILLERY - UBUNTU"
113-
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.5.txt
113+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml >artillery.ubuntu.5.txt
114114
echo "ARTILLERY - DEBIAN"
115-
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.5.txt
115+
./node_modules/.bin/artillery run test/artillery-debian.yml >artillery.debian.5.txt
116116
echo "ARTILLERY - FEDORA"
117-
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.5.txt
117+
./node_modules/.bin/artillery run test/artillery-fedora.yml >artillery.fedora.5.txt
118118
echo "ARTILLERY - CENTOS"
119-
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.5.txt
119+
./node_modules/.bin/artillery run test/artillery-centos.yml >artillery.centos.5.txt
120120

121121
echo Nginx
122122
TESTS=$(grep -r virtual docs/benchmark/reports/different_images/*nginx.* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')

Diff for: bin/docker-metadata.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ function metadata() {
1616
IMG_EXISTS=$(docker image ls -q fabiocicerchia/nginx-lua:"$PATCH-$OS$OS_VER" | wc -l)
1717
if [ "$IMG_EXISTS" -ne "0" ]; then
1818
{
19-
echo -e "# fabiocicerchia/nginx-lua:$PATCH-$OS$OS_VER\n";
20-
echo '```json';
21-
docker image inspect "fabiocicerchia/nginx-lua:$PATCH-$OS$OS_VER";
22-
echo '```';
23-
} > "docs/metadata/$PATCH-$OS$OS_VER.md"
19+
echo -e "# fabiocicerchia/nginx-lua:$PATCH-$OS$OS_VER\n"
20+
echo '```json'
21+
docker image inspect "fabiocicerchia/nginx-lua:$PATCH-$OS$OS_VER"
22+
echo '```'
23+
} >"docs/metadata/$PATCH-$OS$OS_VER.md"
2424
fi
2525
}
2626

Diff for: bin/docker-push.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ source supported_versions
66

77
function docker_push() {
88
TAG=$1
9-
EXITCODE=$(docker push fabiocicerchia/nginx-lua:"$TAG"; echo $?)
9+
EXITCODE=$(
10+
docker push fabiocicerchia/nginx-lua:"$TAG";
11+
echo $?
12+
)
1013
if [ "$EXITCODE" -ne "0" ]; then
1114
docker push fabiocicerchia/nginx-lua:"$TAG"
1215
fi

Diff for: bin/generate-dockerfiles.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ function init_dockerfile() {
88
DOCKERFILE_PATH="nginx/$NGINX_VER/$OS/$OS_VER"
99
DOCKERFILE="$DOCKERFILE_PATH/Dockerfile"
1010

11-
mkdir -p "$DOCKERFILE_PATH" 2> /dev/null
11+
mkdir -p "$DOCKERFILE_PATH" 2>/dev/null
1212
cp "tpl/Dockerfile.$OS" "$DOCKERFILE"
1313

1414
if [ "$(uname)" == "Darwin" ]; then
1515
sed -i "" "s/{{DOCKER_IMAGE}}/fabiocicerchia\/nginx-lua/" "$DOCKERFILE"
16-
sed -i "" "s/{{DOCKER_IMAGE_OS}}/$OS/" "$DOCKERFILE"
17-
sed -i "" "s/{{DOCKER_IMAGE_TAG}}/$OS_VER/" "$DOCKERFILE"
18-
sed -i "" "s/{{VER_NGINX}}/$NGINX_VER/" "$DOCKERFILE"
16+
sed -i "" "s/{{DOCKER_IMAGE_OS}}/$OS/" "$DOCKERFILE"
17+
sed -i "" "s/{{DOCKER_IMAGE_TAG}}/$OS_VER/" "$DOCKERFILE"
18+
sed -i "" "s/{{VER_NGINX}}/$NGINX_VER/" "$DOCKERFILE"
1919
else
2020
sed -i "s/{{DOCKER_IMAGE}}/fabiocicerchia\/nginx-lua/" "$DOCKERFILE"
21-
sed -i "s/{{DOCKER_IMAGE_OS}}/$OS/" "$DOCKERFILE"
22-
sed -i "s/{{DOCKER_IMAGE_TAG}}/$OS_VER/" "$DOCKERFILE"
23-
sed -i "s/{{VER_NGINX}}/$NGINX_VER/" "$DOCKERFILE"
21+
sed -i "s/{{DOCKER_IMAGE_OS}}/$OS/" "$DOCKERFILE"
22+
sed -i "s/{{DOCKER_IMAGE_TAG}}/$OS_VER/" "$DOCKERFILE"
23+
sed -i "s/{{VER_NGINX}}/$NGINX_VER/" "$DOCKERFILE"
2424
fi
2525
}
2626

Diff for: bin/generate-supported-versions.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ fetch_latest() {
1616
VER=""
1717
PAGE=1
1818
while [ "$VER" = "" ] && [ $PAGE -lt 100 ]; do
19-
VER=$(wget -q "https://hub.docker.com/v2/repositories/library/$DISTRO/tags?page=$PAGE" -O - \
20-
| jq -rc '.results[] | select( .images[].digest == "'"$DIGEST"'" and .name != "latest" ) | .name' \
21-
| egrep "$FILTER" | sort -Vr | head -n 1)
19+
VER=$(wget -q "https://hub.docker.com/v2/repositories/library/$DISTRO/tags?page=$PAGE" -O - |
20+
jq -rc '.results[] | select( .images[].digest == "'"$DIGEST"'" and .name != "latest" ) | .name' |
21+
egrep "$FILTER" | sort -Vr | head -n 1)
2222
((PAGE+=1))
2323
done
2424

@@ -27,7 +27,8 @@ fetch_latest() {
2727

2828
set -eux
2929

30-
VER_NGINX=$(DISTRO=nginx; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | cut -d: -f3 | grep -E "[0-9]+\.[0-9]+\.[0-9]+" | grep -E -v "alpine|perl" | sort -Vr | head -n 1)
30+
DISTRO=nginx
31+
VER_NGINX=$(wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | cut -d: -f3 | grep -E "[0-9]+\.[0-9]+\.[0-9]+" | grep -E -v "alpine|perl" | sort -Vr | head -n 1)
3132
NGINX=()
3233
for VER in $VER_NGINX; do
3334
NGINX+=("$VER")
@@ -91,13 +92,13 @@ unset IFS
9192

9293
cp supported_versions supported_versions.bak
9394

94-
echo "NGINX=(\"${NGINX[*]}\")" | sed 's/ /" "/g' > supported_versions
95-
echo "ALPINE=(\"${ALPINE[*]}\")" | sed 's/ /" "/g' >> supported_versions
96-
echo "AMAZONLINUX=(\"${AMAZONLINUX[*]}\")" | sed 's/ /" "/g' >> supported_versions
97-
echo "CENTOS=(\"${CENTOS[*]}\")" | sed 's/ /" "/g' >> supported_versions
98-
echo "DEBIAN=(\"${DEBIAN[*]}\")" | sed 's/ /" "/g' >> supported_versions
99-
echo "FEDORA=(\"${FEDORA[*]}\")" | sed 's/ /" "/g' >> supported_versions
100-
echo "UBUNTU=(\"${UBUNTU[*]}\")" | sed 's/ /" "/g' >> supported_versions
95+
echo "NGINX=(\"${NGINX[*]}\")" | sed 's/ /" "/g' >supported_versions
96+
echo "ALPINE=(\"${ALPINE[*]}\")" | sed 's/ /" "/g' >>supported_versions
97+
echo "AMAZONLINUX=(\"${AMAZONLINUX[*]}\")" | sed 's/ /" "/g' >>supported_versions
98+
echo "CENTOS=(\"${CENTOS[*]}\")" | sed 's/ /" "/g' >>supported_versions
99+
echo "DEBIAN=(\"${DEBIAN[*]}\")" | sed 's/ /" "/g' >>supported_versions
100+
echo "FEDORA=(\"${FEDORA[*]}\")" | sed 's/ /" "/g' >>supported_versions
101+
echo "UBUNTU=(\"${UBUNTU[*]}\")" | sed 's/ /" "/g' >>supported_versions
101102

102103
DIFF=$(diff supported_versions supported_versions.bak | wc -l | tr -d ' ')
103104
rm supported_versions.bak

Diff for: bin/test.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ source supported_versions
77
function test() {
88
DOCKER_TAG=$1
99

10-
docker rm -f nginx_lua_test 2> /dev/null || true
10+
docker rm -f nginx_lua_test 2>/dev/null || true
1111

1212
FOUND=$(docker image ls -q fabiocicerchia/nginx-lua:"$DOCKER_TAG" | wc -l)
1313
if [ "$FOUND" -ne "0" ]; then
1414
docker run -d --name nginx_lua_test -p 8080:80 -v "$PWD"/test/nginx-lua.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:"$DOCKER_TAG"
1515
COUNT=0
16-
until [ $COUNT -eq 20 ] || [ "$(curl --output /dev/null --silent --head --fail http://localhost:8080; echo $?)" == "0" ]; do
16+
until [ $COUNT -eq 20 ] || [ "$(
17+
curl --output /dev/null --silent --head --fail http://localhost:8080;
18+
echo $?
19+
)" == "0" ]; do
1720
echo -n '.'; sleep 0.5;
1821
COUNT=$((COUNT+1))
1922
done
2023
curl -v http://localhost:8080 | grep "Welcome to nginx" || exit 1
2124
curl -v http://localhost:8080/lua_content | grep "Hello world" || exit 1
2225
docker rm -f nginx_lua_test
23-
fi
26+
fi
2427
}
2528

2629
function runtest() {

Diff for: bin/update-readme.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
head -n "$(grep -n START_SUPPORTED_TAGS README.md | cut -d: -f1)" README.md > README.md.tmp
4-
./bin/readme-tags.sh >> README.md.tmp
5-
tail -n "$(($(wc -l < README.md)-$(grep -n END_SUPPORTED_TAGS README.md | cut -d: -f1)+1))" README.md >> README.md.tmp
3+
head -n "$(grep -n START_SUPPORTED_TAGS README.md | cut -d: -f1)" README.md >README.md.tmp
4+
./bin/readme-tags.sh >>README.md.tmp
5+
tail -n "$(($(wc -l < README.md)-$(grep -n END_SUPPORTED_TAGS README.md | cut -d: -f1)+1))" README.md >>README.md.tmp
66
mv README.md.tmp README.md

0 commit comments

Comments
 (0)