Skip to content

Commit

Permalink
ci: more retry on fetching lua rocks (apache#4029)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiyiyimu authored Apr 13, 2021
1 parent 3cde740 commit 206a807
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 11 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/fuzzing-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ jobs:
sudo apt-get install -y git openresty curl openresty-openssl111-dev unzip make gcc
./utils/linux-install-luarocks.sh
make deps
for (( i = 0; i < 10; i++ )); do
if [[ "$i" -eq 10 ]]; then
echo "failed to make deps in time"
exit 1
fi
make deps && break
done
make init
make run
Expand Down
10 changes: 9 additions & 1 deletion ci/linux_apisix_master_luarocks_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ script() {
sudo PATH=$PATH ./utils/install-apisix.sh remove > build.log 2>&1 || (cat build.log && exit 1)

# install APISIX by luarocks
sudo luarocks install $APISIX_MAIN > build.log 2>&1 || (cat build.log && exit 1)
for (( i = 0; i < 10; i++ )); do
if [[ "$i" -eq 10 ]]; then
echo "failed to fetch lua rocks in time"
cat build.log && exit 1
exit 1
fi
sudo luarocks install $APISIX_MAIN > build.log 2>&1 && break
i=$(( i + 1 ))
done
cp ../bin/apisix /usr/local/bin/apisix

# show install files
Expand Down
11 changes: 10 additions & 1 deletion ci/linux_openresty_common_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,16 @@ do_install() {
./utils/linux-install-openresty.sh

./utils/linux-install-luarocks.sh
sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)

for (( i = 0; i < 10; i++ )); do
if [[ "$i" -eq 10 ]]; then
echo "failed to install luacheck in time"
cat build.log && exit 1
exit 1
fi
sudo luarocks install luacheck > build.log 2>&1 && break
i=$(( i + 1 ))
done

./utils/linux-install-etcd-client.sh

Expand Down
11 changes: 10 additions & 1 deletion ci/linux_openresty_mtls_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ do_install() {
./utils/linux-install-openresty.sh

./utils/linux-install-luarocks.sh
sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)

for (( i = 0; i < 10; i++ )); do
if [[ "$i" -eq 10 ]]; then
echo "failed to install luacheck in time"
cat build.log && exit 1
exit 1
fi
sudo luarocks install luacheck > build.log 2>&1 && break
i=$(( i + 1 ))
done

./utils/linux-install-etcd-client.sh

Expand Down
10 changes: 9 additions & 1 deletion ci/linux_tengine_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,15 @@ do_install() {
fi
fi

sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)
for (( i = 0; i < 10; i++ )); do
if [[ "$i" -eq 10 ]]; then
echo "failed to install luacheck in time"
cat build.log && exit 1
exit 1
fi
sudo luarocks install luacheck > build.log 2>&1 && break
i=$(( i + 1 ))
done

./utils/linux-install-etcd-client.sh

Expand Down
20 changes: 14 additions & 6 deletions utils/install-apisix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ echo $UNAME


do_install() {
if [ "$LUAROCKS_VER" = 'luarocks 3.' ]; then
sudo luarocks install --lua-dir=$LUA_JIT_DIR $APISIX_VER --tree=/usr/local/apisix/deps --local

else
sudo luarocks install $APISIX_VER --tree=/usr/local/apisix/deps --local
fi
i=0
while true; do
if [ "$i" = "10" ]; then
echo "failed to install in time"
cat build.log && exit 1
exit 1
fi
if [ "$LUAROCKS_VER" = 'luarocks 3.' ]; then
sudo luarocks install --lua-dir=$LUA_JIT_DIR $APISIX_VER --tree=/usr/local/apisix/deps --local > build.log 2>&1 && break
else
sudo luarocks install $APISIX_VER --tree=/usr/local/apisix/deps --local > build.log 2>&1 && break
fi
i=$(( i + 1 ))
done

sudo rm -f /usr/bin/apisix
sudo ln -s /usr/local/apisix/deps/bin/apisix /usr/bin/apisix
Expand Down

0 comments on commit 206a807

Please sign in to comment.