mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-14 08:51:29 +08:00
travis(optimize): use build-cache for lua folder deps
. (#551)
This commit is contained in:
parent
de3c95da21
commit
70ea8f612c
@ -16,6 +16,15 @@ export_or_prefix() {
|
||||
export OPENRESTY_PREFIX="/usr/local/openresty-debug"
|
||||
}
|
||||
|
||||
create_lua_deps() {
|
||||
sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local
|
||||
sudo luarocks install --lua-dir=${OPENRESTY_PREFIX}/luajit lua-resty-libr3 --tree=deps --local
|
||||
echo "Create lua deps cache"
|
||||
sudo rm -rf build-cache/deps
|
||||
sudo cp -r deps build-cache/
|
||||
sudo cp rockspec/apisix-dev-1.0-0.rockspec build-cache/
|
||||
}
|
||||
|
||||
before_install() {
|
||||
sudo cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1)
|
||||
}
|
||||
@ -36,8 +45,17 @@ do_install() {
|
||||
|
||||
export_or_prefix
|
||||
|
||||
sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-dev-1.0-0.rockspec --tree=deps --only-deps --local
|
||||
sudo luarocks install --lua-dir=${OPENRESTY_PREFIX}/luajit lua-resty-libr3 --tree=deps --local
|
||||
if [ ! -f "build-cache/apisix-dev-1.0-0.rockspec" ]; then
|
||||
create_lua_deps
|
||||
else
|
||||
diff rockspec/apisix-dev-1.0-0.rockspec build-cache/apisix-dev-1.0-0.rockspec > /dev/null
|
||||
if [ $0 == 0 ]; then
|
||||
echo "Use lua deps cache"
|
||||
sudo cp -r build-cache/deps ./
|
||||
else
|
||||
create_lua_deps
|
||||
fi
|
||||
fi
|
||||
|
||||
git clone https://github.com/iresty/test-nginx.git test-nginx
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user