You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/11/15 11:39:58 UTC
[apisix] branch master updated: ci: refactor runners (#2722)
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 02ec388 ci: refactor runners (#2722)
02ec388 is described below
commit 02ec388a6f95c9a3ca93e7f52ac94b89e0f54687
Author: 罗泽轩 <sp...@gmail.com>
AuthorDate: Sun Nov 15 19:39:50 2020 +0800
ci: refactor runners (#2722)
---
.travis/common.sh | 36 +++++++++++++++++++++
.travis/linux_apisix_current_luarocks_runner.sh | 26 ++-------------
.travis/linux_apisix_master_luarocks_runner.sh | 27 ++--------------
.travis/linux_openresty_mtls_runner.sh | 41 ++++-------------------
.travis/linux_openresty_runner.sh | 37 ++-------------------
.travis/linux_tengine_runner.sh | 43 +++----------------------
.travis/osx_openresty_runner.sh | 13 +++-----
utils/linux-install-luarocks.sh | 26 +++++++++++++++
utils/linux-install-openresty.sh | 25 ++++++++++++++
9 files changed, 111 insertions(+), 163 deletions(-)
diff --git a/.travis/common.sh b/.travis/common.sh
new file mode 100644
index 0000000..62760a6
--- /dev/null
+++ b/.travis/common.sh
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -ex
+
+export_or_prefix() {
+ export OPENRESTY_PREFIX="/usr/local/openresty-debug"
+ export APISIX_MAIN="https://raw.githubusercontent.com/apache/incubator-apisix/master/rockspec/apisix-master-0.rockspec"
+ export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
+}
+
+create_lua_deps() {
+ echo "Create lua deps cache"
+
+ make deps
+ # maybe reopen this feature later
+ # luarocks install luacov-coveralls --tree=deps --local > build.log 2>&1 || (cat build.log && exit 1)
+
+ sudo rm -rf build-cache/deps
+ sudo cp -r deps build-cache/
+ sudo cp rockspec/apisix-master-0.rockspec build-cache/
+}
diff --git a/.travis/linux_apisix_current_luarocks_runner.sh b/.travis/linux_apisix_current_luarocks_runner.sh
index 5cc3397..71ea2e7 100755
--- a/.travis/linux_apisix_current_luarocks_runner.sh
+++ b/.travis/linux_apisix_current_luarocks_runner.sh
@@ -16,36 +16,16 @@
# limitations under the License.
#
-set -ex
-
-export_or_prefix() {
- export OPENRESTY_PREFIX="/usr/local/openresty-debug"
-}
+. ./.travis/common.sh
do_install() {
- wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
- sudo apt-get -y update --fix-missing
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
-
- sudo apt-get update
- sudo apt-get install openresty-debug=1.17.8.2\* lua5.1 liblua5.1-0-dev
-
- wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz
- tar -xf v2.4.4.tar.gz
- cd luarocks-2.4.4
- ./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1)
- make build > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- rm -rf luarocks-2.4.4
-
+ ./utils/linux-install-openresty.sh
+ ./utils/linux-install-luarocks.sh
./utils/linux-install-etcd-client.sh
}
script() {
export_or_prefix
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
openresty -V
sudo rm -rf /usr/local/apisix
diff --git a/.travis/linux_apisix_master_luarocks_runner.sh b/.travis/linux_apisix_master_luarocks_runner.sh
index 558582a..7fb3664 100755
--- a/.travis/linux_apisix_master_luarocks_runner.sh
+++ b/.travis/linux_apisix_master_luarocks_runner.sh
@@ -16,37 +16,16 @@
# limitations under the License.
#
-set -ex
-
-export_or_prefix() {
- export OPENRESTY_PREFIX="/usr/local/openresty-debug"
- export APISIX_MAIN="https://raw.githubusercontent.com/apache/incubator-apisix/master/rockspec/apisix-master-0.rockspec"
-}
+. ./.travis/common.sh
do_install() {
- wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
- sudo apt-get -y update --fix-missing
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
-
- sudo apt-get update
- sudo apt-get install openresty-debug=1.17.8.2\* lua5.1 liblua5.1-0-dev
-
- wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz
- tar -xf v2.4.4.tar.gz
- cd luarocks-2.4.4
- ./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1)
- make build > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- rm -rf luarocks-2.4.4
-
+ ./utils/linux-install-openresty.sh
+ ./utils/linux-install-luarocks.sh
./utils/linux-install-etcd-client.sh
}
script() {
export_or_prefix
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
openresty -V
sudo rm -rf /usr/local/apisix
diff --git a/.travis/linux_openresty_mtls_runner.sh b/.travis/linux_openresty_mtls_runner.sh
index bf7a704..386c04d 100755
--- a/.travis/linux_openresty_mtls_runner.sh
+++ b/.travis/linux_openresty_mtls_runner.sh
@@ -16,22 +16,7 @@
# limitations under the License.
#
-set -ex
-
-export_or_prefix() {
- export OPENRESTY_PREFIX="/usr/local/openresty-debug"
-}
-
-create_lua_deps() {
- echo "Create lua deps cache"
-
- make deps
- luarocks install luacov-coveralls --tree=deps --local > build.log 2>&1 || (cat build.log && exit 1)
-
- sudo rm -rf build-cache/deps
- sudo cp -r deps build-cache/
- sudo cp rockspec/apisix-master-0.rockspec build-cache/
-}
+. ./.travis/common.sh
before_install() {
sudo cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1)
@@ -40,23 +25,9 @@ before_install() {
do_install() {
export_or_prefix
- wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
- sudo apt-get -y update --fix-missing
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
-
- sudo apt-get update
- sudo apt-get install openresty-debug=1.17.8.2\* lua5.1 liblua5.1-0-dev
-
- wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz
- tar -xf v2.4.4.tar.gz
- cd luarocks-2.4.4
- ./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1)
- make build > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- rm -rf luarocks-2.4.4
+ ./utils/linux-install-openresty.sh
+ ./utils/linux-install-luarocks.sh
sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)
./utils/linux-install-etcd-client.sh
@@ -89,7 +60,6 @@ do_install() {
script() {
export_or_prefix
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
openresty -V
@@ -159,8 +129,9 @@ apisix:
}
after_success() {
- cat luacov.stats.out
- luacov-coveralls
+ #cat luacov.stats.out
+ #luacov-coveralls
+ echo "done"
}
case_opt=$1
diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh
index d02ed87..686f0e0 100755
--- a/.travis/linux_openresty_runner.sh
+++ b/.travis/linux_openresty_runner.sh
@@ -16,23 +16,7 @@
# limitations under the License.
#
-set -ex
-
-export_or_prefix() {
- export OPENRESTY_PREFIX="/usr/local/openresty-debug"
-}
-
-create_lua_deps() {
- echo "Create lua deps cache"
-
- make deps
- # maybe reopen this feature later
- # luarocks install luacov-coveralls --tree=deps --local > build.log 2>&1 || (cat build.log && exit 1)
-
- sudo rm -rf build-cache/deps
- sudo cp -r deps build-cache/
- sudo cp rockspec/apisix-master-0.rockspec build-cache/
-}
+. ./.travis/common.sh
before_install() {
sudo cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1)
@@ -59,23 +43,9 @@ before_install() {
do_install() {
export_or_prefix
- wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
- sudo apt-get -y update --fix-missing
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
-
- sudo apt-get update
- sudo apt-get install openresty-debug=1.17.8.2\* lua5.1 liblua5.1-0-dev
-
- wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz
- tar -xf v2.4.4.tar.gz
- cd luarocks-2.4.4
- ./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1)
- make build > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- rm -rf luarocks-2.4.4
+ ./utils/linux-install-openresty.sh
+ ./utils/linux-install-luarocks.sh
sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)
./utils/linux-install-etcd-client.sh
@@ -129,7 +99,6 @@ do_install() {
script() {
export_or_prefix
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
openresty -V
diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh
index a8a6d37..fc7c40d 100755
--- a/.travis/linux_tengine_runner.sh
+++ b/.travis/linux_tengine_runner.sh
@@ -16,23 +16,7 @@
# limitations under the License.
#
-set -ex
-
-export_or_prefix() {
- export OPENRESTY_PREFIX="/usr/local/openresty-debug"
-}
-
-create_lua_deps() {
- echo "Create lua deps cache"
-
- rm -rf deps
- make deps
- luarocks install luacov-coveralls --tree=deps --local > build.log 2>&1 || (cat build.log && exit 1)
-
- sudo rm -rf build-cache/deps
- sudo cp -r deps build-cache/
- sudo cp rockspec/apisix-master-0.rockspec build-cache/
-}
+. ./.travis/common.sh
before_install() {
sudo cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1)
@@ -63,26 +47,15 @@ tengine_install() {
return
fi
- export OPENRESTY_VERSION=1.15.8.3
+ export OPENRESTY_VERSION=1.17.8.2
wget https://openresty.org/download/openresty-$OPENRESTY_VERSION.tar.gz
tar zxf openresty-$OPENRESTY_VERSION.tar.gz
wget https://codeload.github.com/alibaba/tengine/tar.gz/2.3.2
tar zxf 2.3.2
- wget https://codeload.github.com/openresty/luajit2/tar.gz/v2.1-20190912
- tar zxf v2.1-20190912
- wget https://codeload.github.com/simplresty/ngx_devel_kit/tar.gz/v0.3.1
- tar zxf v0.3.1
- rm -rf openresty-$OPENRESTY_VERSION/bundle/nginx-1.15.8
+ rm -rf openresty-$OPENRESTY_VERSION/bundle/nginx-1.17.8
mv tengine-2.3.2 openresty-$OPENRESTY_VERSION/bundle/
- rm -rf openresty-$OPENRESTY_VERSION/bundle/LuaJIT-2.1-20190507
- mv luajit2-2.1-20190912 openresty-$OPENRESTY_VERSION/bundle/
-
- rm -rf openresty-$OPENRESTY_VERSION/bundle/ngx_devel_kit-0.3.1rc1
- mv ngx_devel_kit-0.3.1 openresty-$OPENRESTY_VERSION/bundle/
-
- sed -i "s/= auto_complete 'LuaJIT';/= auto_complete 'luajit2';/g" openresty-$OPENRESTY_VERSION/configure
sed -i 's/= auto_complete "nginx";/= auto_complete "tengine";/g' openresty-$OPENRESTY_VERSION/configure
cd openresty-$OPENRESTY_VERSION
@@ -234,14 +207,7 @@ do_install() {
tengine_install
- wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz
- tar -xf v2.4.4.tar.gz
- cd luarocks-2.4.4
- ./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1)
- make build > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- rm -rf luarocks-2.4.4
+ ./utils/linux-install-luarocks.sh
if [ ! -f "build-cache/apisix-master-0.rockspec" ]; then
create_lua_deps
@@ -278,7 +244,6 @@ do_install() {
script() {
export_or_prefix
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
openresty -V
diff --git a/.travis/osx_openresty_runner.sh b/.travis/osx_openresty_runner.sh
index f2e9b83..96d8524 100755
--- a/.travis/osx_openresty_runner.sh
+++ b/.travis/osx_openresty_runner.sh
@@ -16,11 +16,7 @@
# limitations under the License.
#
-set -ex
-
-export_or_prefix() {
- export OPENRESTY_PREFIX=$(brew --prefix openresty/brew/openresty-debug)
-}
+. ./.travis/common.sh
before_install() {
if [ "$TRAVIS_OS_NAME" == "" ]; then
@@ -63,7 +59,6 @@ script() {
fi
export_or_prefix
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH
etcd &
sleep 1
@@ -84,7 +79,8 @@ script() {
sudo mkdir -p /usr/local/var/log/nginx/
sudo touch /usr/local/var/log/nginx/error.log
sudo chmod 777 /usr/local/var/log/nginx/error.log
- APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -I./ -r t/admin/*.t
+ #APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -I./ -r t/admin/*.t
+ prove -Itest-nginx/lib -I./ -r t/admin/*.t
}
after_success() {
@@ -92,7 +88,8 @@ after_success() {
exit 0
fi
- $PWD/deps/bin/luacov-coveralls
+ #$PWD/deps/bin/luacov-coveralls
+ echo "done"
}
case_opt=$1
diff --git a/utils/linux-install-luarocks.sh b/utils/linux-install-luarocks.sh
new file mode 100755
index 0000000..2432c36
--- /dev/null
+++ b/utils/linux-install-luarocks.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+wget https://github.com/luarocks/luarocks/archive/v2.4.4.tar.gz
+tar -xf v2.4.4.tar.gz
+cd luarocks-2.4.4 || exit
+./configure --prefix=/usr > build.log 2>&1 || (cat build.log && exit 1)
+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-2.4.4
diff --git a/utils/linux-install-openresty.sh b/utils/linux-install-openresty.sh
new file mode 100755
index 0000000..098a59f
--- /dev/null
+++ b/utils/linux-install-openresty.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
+sudo apt-get -y update --fix-missing
+sudo apt-get -y install software-properties-common
+sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
+
+sudo apt-get update
+sudo apt-get install openresty-debug=1.17.8.2\* lua5.1 liblua5.1-0-dev