This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 5cde5ae  feat: upgrade luarocks to 3.8.0 which converts git:// to 
https:// (#5825)
5cde5ae is described below

commit 5cde5ae0040f9fa7468dae12649276f07b0e9031
Author: 罗泽轩 <spacewander...@gmail.com>
AuthorDate: Sat Dec 18 08:29:57 2021 +0800

    feat: upgrade luarocks to 3.8.0 which converts git:// to https:// (#5825)
    
    The Luarocks 2.x is already broken.
---
 .github/workflows/fuzzing-ci.yaml          | 1 -
 Makefile                                   | 8 ++------
 ci/common.sh                               | 1 -
 ci/linux_apisix_current_luarocks_runner.sh | 2 --
 ci/linux_apisix_master_luarocks_runner.sh  | 2 --
 docs/en/latest/FAQ.md                      | 3 +--
 docs/zh/latest/FAQ.md                      | 4 +---
 utils/linux-install-luarocks.sh            | 9 +++++----
 8 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/fuzzing-ci.yaml 
b/.github/workflows/fuzzing-ci.yaml
index b23ec2d..bb132da 100644
--- a/.github/workflows/fuzzing-ci.yaml
+++ b/.github/workflows/fuzzing-ci.yaml
@@ -50,7 +50,6 @@ jobs:
         sudo apt-get install -y git openresty curl openresty-openssl111-dev 
unzip make gcc libldap2-dev
         ./utils/linux-install-luarocks.sh
 
-        git config --global url.https://github.com/.insteadOf git://github.com/
         make deps
         make init
         make run
diff --git a/Makefile b/Makefile
index adcd64d..2b25def 100644
--- a/Makefile
+++ b/Makefile
@@ -155,12 +155,8 @@ deps: runtime
                $(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) 
variables.OPENSSL_INCDIR $(addprefix $(ENV_OPENSSL_PREFIX), /include); \
                $(ENV_LUAROCKS) install rockspec/apisix-master-0.rockspec 
--tree=deps --only-deps --local $(ENV_LUAROCKS_SERVER_OPT); \
        else \
-               $(call func_echo_warn_status, "WARNING: You're not using 
LuaRocks 3.x; please add the following items to your LuaRocks config file:"); \
-               echo "variables = {"; \
-               echo "    OPENSSL_LIBDIR=$(addprefix $(ENV_OPENSSL_PREFIX), 
/lib)"; \
-               echo "    OPENSSL_INCDIR=$(addprefix $(ENV_OPENSSL_PREFIX), 
/include)"; \
-               echo "}"; \
-               $(ENV_LUAROCKS) install rockspec/apisix-master-0.rockspec 
--tree=deps --only-deps --local $(ENV_LUAROCKS_SERVER_OPT); \
+               $(call func_echo_warn_status, "WARNING: You're not using 
LuaRocks 3.x; please remove the luarocks and reinstall it via 
https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh";);
 \
+               exit 1; \
        fi
 
 
diff --git a/ci/common.sh b/ci/common.sh
index ec8b7e6..612236e 100644
--- a/ci/common.sh
+++ b/ci/common.sh
@@ -26,7 +26,6 @@ export_or_prefix() {
 create_lua_deps() {
     echo "Create lua deps"
 
-    git config --global url.https://github.com/.insteadOf git://github.com/
     make deps
     # maybe reopen this feature later
     # luarocks install luacov-coveralls --tree=deps --local > build.log 2>&1 
|| (cat build.log && exit 1)
diff --git a/ci/linux_apisix_current_luarocks_runner.sh 
b/ci/linux_apisix_current_luarocks_runner.sh
index 2682a4f..a143d47 100755
--- a/ci/linux_apisix_current_luarocks_runner.sh
+++ b/ci/linux_apisix_current_luarocks_runner.sh
@@ -32,8 +32,6 @@ script() {
 
     sudo rm -rf /usr/local/apisix
 
-    git config --global url.https://github.com/.insteadOf git://github.com/
-
     # install APISIX with local version
     sudo luarocks install rockspec/apisix-master-0.rockspec --only-deps > 
build.log 2>&1 || (cat build.log && exit 1)
     sudo luarocks make rockspec/apisix-master-0.rockspec > build.log 2>&1 || 
(cat build.log && exit 1)
diff --git a/ci/linux_apisix_master_luarocks_runner.sh 
b/ci/linux_apisix_master_luarocks_runner.sh
index ed3e58c..a75fdf6 100755
--- a/ci/linux_apisix_master_luarocks_runner.sh
+++ b/ci/linux_apisix_master_luarocks_runner.sh
@@ -36,8 +36,6 @@ script() {
     mkdir tmp && cd tmp
     cp -r ../utils ./
 
-    git config --global url.https://github.com/.insteadOf git://github.com/
-
     # install APISIX by luarocks
     sudo luarocks install $APISIX_MAIN > build.log 2>&1 || (cat build.log && 
exit 1)
     cp ../bin/apisix /usr/local/bin/apisix
diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md
index 8038b9c..9f56094 100644
--- a/docs/en/latest/FAQ.md
+++ b/docs/en/latest/FAQ.md
@@ -66,7 +66,6 @@ See more [etcd 
why](https://etcd.io/docs/latest/learning/why/#comparison-chart).
 There are two possibilities when encountering slow luarocks:
 
 1. Server used for luarocks installation is blocked
-2. There is a place between your network and github server to block the 'git' 
protocol
 
 For the first problem, you can use https_proxy or use the `--server` option to 
specify a luarocks server that you can access or access faster.
 Run the `luarocks config rocks_servers` command(this command is supported 
after luarocks 3.0) to see which server are available.
@@ -78,7 +77,7 @@ We already provide a wrapper in the Makefile to simplify your 
job:
 make deps ENV_LUAROCKS_SERVER=https://luarocks.cn
 ```
 
-If using a proxy doesn't solve this problem, you can add `--verbose` option 
during installation to see exactly how slow it is. Excluding the first case, 
only the second that the `git` protocol is blocked. Then we can run `git config 
--global url."https://".insteadOf git://` to using the 'HTTPS' protocol instead 
of `git`.
+If using a proxy doesn't solve this problem, you can add `--verbose` option 
during installation to see exactly how slow it is.
 
 ## How to support gray release via Apache APISIX?
 
diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md
index 816093f..514885c 100644
--- a/docs/zh/latest/FAQ.md
+++ b/docs/zh/latest/FAQ.md
@@ -65,7 +65,6 @@ APISIX 需要一个配置中心,上面提到的很多功能是传统关系型
 遇到 luarocks 慢的问题,有以下两种可能:
 
 1. luarocks 安装所使用的服务器不能访问
-2. 你所在的网络到 github 服务器之间有地方对 `git` 协议进行封锁
 
 针对第一个问题,你可以使用 https_proxy 或者使用 `--server` 选项来指定一个你可以访问或者访问更快的
 luarocks 服务。 运行 `luarocks config rocks_servers` 命令(这个命令在 luarocks 3.0 版本后开始支持)
@@ -77,8 +76,7 @@ luarocks 服务。 运行 `luarocks config rocks_servers` 命令(这个命令
 make deps ENV_LUAROCKS_SERVER=https://luarocks.cn
 ```
 
-如果使用代理仍然解决不了这个问题,那可以在安装的过程中添加 `--verbose` 选项来查看具体是慢在什么地方。排除前面的
-第一种情况,只可能是第二种,`git` 协议被封。这个时候可以执行 `git config --global 
url."https://".insteadOf git://` 命令使用 `https` 协议替代。
+如果使用代理仍然解决不了这个问题,那可以在安装的过程中添加 `--verbose` 选项来查看具体是慢在什么地方。
 
 ## 如何通过 APISIX 支持灰度发布?
 
diff --git a/utils/linux-install-luarocks.sh b/utils/linux-install-luarocks.sh
index 6a6d6b4..f0e9a8e 100755
--- a/utils/linux-install-luarocks.sh
+++ b/utils/linux-install-luarocks.sh
@@ -22,9 +22,10 @@ if [ -z ${OPENRESTY_PREFIX} ]; then
     OPENRESTY_PREFIX="/usr/local/openresty"
 fi
 
-wget https://github.com/luarocks/luarocks/archive/v3.4.0.tar.gz
-tar -xf v3.4.0.tar.gz
-cd luarocks-3.4.0 || exit
+LUAROCKS_VER=3.8.0
+wget https://github.com/luarocks/luarocks/archive/v"$LUAROCKS_VER".tar.gz
+tar -xf v"$LUAROCKS_VER".tar.gz
+cd luarocks-"$LUAROCKS_VER" || exit
 
 OR_BIN="$OPENRESTY_PREFIX/bin/openresty"
 OR_VER=$($OR_BIN -v 2>&1 | awk -F '/' '{print $2}' | awk -F '.' '{print 
$1"."$2}')
@@ -41,7 +42,7 @@ fi
 make build > build.log 2>&1 || (cat build.log && exit 1)
 sudo make install > build.log 2>&1 || (cat build.log && exit 1)
 cd .. || exit
-rm -rf luarocks-3.4.0
+rm -rf luarocks-"$LUAROCKS_VER"
 
 mkdir ~/.luarocks || true
 

Reply via email to