-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci) setup enhancements and updates
- update Luarocks version - simpler .travis.yml with a .ci/setenv_kong.sh script - allow caching of multiple versions of OpenResty - luacov in a dependency of luacov-coveralls, hence not needed - update setup_lua.sh script with latest Lua versions and improvements - remove "VERSION" suffix from ENV variables
- Loading branch information
1 parent
ba2a16c
commit 6eba6ba
Showing
7 changed files
with
90 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export LUA_DIR=$HOME/lua | ||
export LUAROCKS_DIR=$HOME/luarocks | ||
export OPENRESTY_DIR=$HOME/openresty-$OPENRESTY | ||
export DNSMASQ_DIR=$HOME/dnsmasq | ||
export SERF_DIR=$HOME/serf | ||
|
||
export PATH=$LUA_DIR/bin:$LUAROCKS_DIR/bin:$OPENRESTY_DIR/nginx/sbin:$SERF_DIR:$DNSMASQ_DIR/usr/local/sbin:$PATH | ||
|
||
bash .ci/setup_lua.sh | ||
bash .ci/setup_openresty.sh | ||
bash .ci/setup_serf.sh | ||
bash .ci/setup_dnsmasq.sh | ||
|
||
eval `luarocks path` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,102 @@ | ||
#!/bin/bash | ||
|
||
# A script for setting up environment for travis-ci testing. | ||
# Sets up Lua and Luarocks. | ||
# LUA must be "lua5.1", "lua5.2" or "luajit". | ||
# luajit2.0 - master v2.0 | ||
# luajit2.1 - master v2.1 | ||
|
||
set -e | ||
|
||
mkdir -p $LUA_DIR | ||
if [ "$(ls -A $LUA_DIR)" ]; then | ||
echo "Lua found from cache at $LUA_DIR" | ||
exit | ||
fi | ||
|
||
LUAJIT="no" | ||
LUAJIT_BASE="LuaJIT" | ||
|
||
source .ci/platform.sh | ||
|
||
############ | ||
# Lua/LuaJIT | ||
############ | ||
|
||
if [ "$LUA_VERSION" == "luajit" ]; then | ||
if [ "$LUA" == "luajit" ]; then | ||
LUAJIT="yes" | ||
LUA_VERSION="luajit-2.0" | ||
elif [ "$LUA_VERSION" == "luajit-2.0" ]; then | ||
LUA="luajit-2.0" | ||
elif [ "$LUA" == "luajit-2.0" ]; then | ||
LUAJIT="yes" | ||
elif [ "$LUA_VERSION" == "luajit-2.1" ]; then | ||
elif [ "$LUA" == "luajit-2.1" ]; then | ||
LUAJIT="yes" | ||
fi | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
mkdir -p $LUAJIT_DIR | ||
|
||
# If cache is empty, download and compile | ||
if [ ! "$(ls -A $LUAJIT_DIR)" ]; then | ||
git clone https://github.com/luajit/luajit $LUAJIT_DIR | ||
pushd $LUAJIT_DIR | ||
|
||
if [ "$LUA_VERSION" == "luajit-2.0" ]; then | ||
git checkout v2.0.4 | ||
elif [ "$LUA_VERSION" == "luajit-2.1" ]; then | ||
git checkout v2.1 | ||
fi | ||
|
||
make | ||
make install PREFIX=$LUAJIT_DIR | ||
popd | ||
|
||
if [ "$LUA_VERSION" == "luajit-2.1" ]; then | ||
ln -sf $LUAJIT_DIR/bin/luajit-2.1.0-beta1 $LUAJIT_DIR/bin/luajit | ||
fi | ||
|
||
ln -sf $LUAJIT_DIR/bin/luajit $LUAJIT_DIR/bin/lua | ||
git clone https://github.com/luajit/luajit $LUAJIT_BASE | ||
pushd $LUAJIT_BASE | ||
|
||
if [ "$LUA" == "luajit-2.0" ]; then | ||
git checkout v2.0.4 | ||
elif [ "$LUA" == "luajit-2.1" ]; then | ||
git checkout v2.1 | ||
perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile | ||
fi | ||
|
||
LUA_INCLUDE="$LUAJIT_DIR/include/$LUA_VERSION" | ||
make | ||
make install PREFIX=$LUA_DIR | ||
popd | ||
|
||
ln -sf $LUA_DIR/bin/luajit $LUA_DIR/bin/lua | ||
else | ||
if [ "$LUA_VERSION" == "lua5.1" ]; then | ||
if [ "$LUA" == "lua5.1" ]; then | ||
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz | ||
pushd lua-5.1.5 | ||
elif [ "$LUA_VERSION" == "lua5.2" ]; then | ||
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz | ||
pushd lua-5.2.3 | ||
elif [ "$LUA_VERSION" == "lua5.3" ]; then | ||
curl http://www.lua.org/ftp/lua-5.3.0.tar.gz | tar xz | ||
pushd lua-5.3.0 | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz | ||
pushd lua-5.2.4 | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz | ||
pushd lua-5.3.2 | ||
fi | ||
|
||
make $PLATFORM | ||
make install INSTALL_TOP=$LUA_DIR | ||
popd | ||
|
||
LUA_INCLUDE="$LUA_DIR/include" | ||
fi | ||
|
||
########## | ||
# Luarocks | ||
########## | ||
|
||
LUAROCKS_BASE=luarocks-$LUAROCKS_VERSION | ||
CONFIGURE_FLAGS="" | ||
LUAROCKS_BASE=luarocks-$LUAROCKS | ||
|
||
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE | ||
|
||
pushd $LUAROCKS_BASE | ||
git checkout v$LUAROCKS_VERSION | ||
|
||
git checkout v$LUAROCKS | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
LUA_DIR=$LUAJIT_DIR | ||
elif [ "$LUA_VERSION" == "lua5.1" ]; then | ||
CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.1" | ||
elif [ "$LUA_VERSION" == "lua5.2" ]; then | ||
CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.2" | ||
elif [ "$LUA_VERSION" == "lua5.3" ]; then | ||
CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.3" | ||
CONFIGURE_FLAGS="--with-lua-include=$LUA_DIR/include/$LUA" | ||
elif [ "$LUA" == "lua5.1" ]; then | ||
CONFIGURE_FLAGS="--lua-version=5.1 --with-lua-include=$LUA_DIR/include" | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
CONFIGURE_FLAGS="--lua-version=5.2 --with-lua-include=$LUA_DIR/include" | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
CONFIGURE_FLAGS="--lua-version=5.3 --with-lua-include=$LUA_DIR/include" | ||
fi | ||
|
||
./configure \ | ||
--prefix=$LUAROCKS_DIR \ | ||
--with-lua-bin=$LUA_DIR/bin \ | ||
--with-lua-include=$LUA_INCLUDE \ | ||
$CONFIGURE_FLAGS | ||
|
||
make build && make install | ||
make build | ||
make install | ||
popd | ||
|
||
rm -rf $LUAROCKS_BASE | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
rm -rf $LUAJIT_BASE; | ||
elif [ "$LUA" == "lua5.1" ]; then | ||
rm -rf lua-5.1.5; | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
rm -rf lua-5.2.4; | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
rm -rf lua-5.3.2; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters