-
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) new setup + compatible with new CLI/tests
- Loading branch information
1 parent
cd758d2
commit ec1e70d
Showing
10 changed files
with
129 additions
and
211 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,94 @@ | ||
set -e | ||
|
||
OPENRESTY_INSTALL=$CACHE_DIR/openresty | ||
LUAROCKS_INSTALL=$CACHE_DIR/luarocks | ||
SERF_INSTALL=$CACHE_DIR/serf | ||
|
||
mkdir -p $CACHE_DIR | ||
|
||
if [ ! "$(ls -A $CACHE_DIR)" ]; then | ||
# Not in cache | ||
|
||
# --------------- | ||
# Install OpenSSL | ||
# --------------- | ||
OPENSSL_BASE=openssl-$OPENSSL | ||
curl -L http://www.openssl.org/source/$OPENSSL_BASE.tar.gz | tar xz | ||
|
||
# ----------------- | ||
# Install OpenResty | ||
# ----------------- | ||
OPENRESTY_BASE=openresty-$OPENRESTY | ||
mkdir -p $OPENRESTY_INSTALL | ||
curl -L https://openresty.org/download/$OPENRESTY_BASE.tar.gz | tar xz | ||
|
||
pushd $OPENRESTY_BASE | ||
./configure \ | ||
--prefix=$OPENRESTY_INSTALL \ | ||
--with-openssl=../$OPENSSL_BASE \ | ||
--with-ipv6 \ | ||
--with-pcre-jit \ | ||
--with-http_ssl_module \ | ||
--with-http_realip_module \ | ||
--with-http_stub_status_module \ | ||
--without-lua_resty_websocket \ | ||
--without-lua_resty_upload \ | ||
--without-lua_resty_mysql \ | ||
--without-lua_resty_redis \ | ||
--without-http_redis_module \ | ||
--without-http_redis2_module \ | ||
--without-lua_redis_parser | ||
make | ||
make install | ||
popd | ||
|
||
rm -rf $OPENRESTY_BASE | ||
|
||
# ---------------- | ||
# Install Luarocks | ||
# ---------------- | ||
LUAROCKS_BASE=luarocks-$LUAROCKS | ||
mkdir -p $LUAROCKS_INSTALL | ||
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE | ||
|
||
pushd $LUAROCKS_BASE | ||
git checkout v$LUAROCKS | ||
./configure \ | ||
--prefix=$LUAROCKS_INSTALL \ | ||
--lua-suffix=jit \ | ||
--with-lua=$OPENRESTY_INSTALL/luajit \ | ||
--with-lua-include=$OPENRESTY_INSTALL/luajit/include/luajit-2.1 | ||
make build | ||
make install | ||
popd | ||
|
||
rm -rf $LUAROCKS_BASE | ||
|
||
# ------------ | ||
# Install Serf | ||
# ------------ | ||
mkdir -p $SERF_INSTALL | ||
pushd $SERF_INSTALL | ||
wget https://releases.hashicorp.com/serf/${SERF}/serf_${SERF}_linux_amd64.zip | ||
unzip serf_${SERF}_linux_amd64.zip | ||
popd | ||
fi | ||
|
||
export PATH=$PATH:$OPENRESTY_INSTALL/nginx/sbin:$OPENRESTY_INSTALL/bin:$LUAROCKS_INSTALL/bin:$SERF_INSTALL | ||
|
||
eval `luarocks path` | ||
|
||
# ------------------------------------- | ||
# Install ccm & setup Cassandra cluster | ||
# ------------------------------------- | ||
if [ "$TEST_SUITE" != "unit" ]; then | ||
pip install --user PyYAML six | ||
git clone https://github.com/pcmanus/ccm.git | ||
pushd ccm | ||
./setup.py install --user | ||
popd | ||
ccm create test -v binary:$CASSANDRA -n 1 -d | ||
ccm start -v | ||
ccm status | ||
fi | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,59 +1,45 @@ | ||
sudo: false | ||
|
||
notifications: | ||
email: false | ||
|
||
addons: | ||
postgresql: "9.4" | ||
apt: | ||
packages: | ||
- sed | ||
- net-tools | ||
- dnsmasq | ||
- uuid-dev | ||
- net-tools | ||
- libpcre3-dev | ||
- build-essential | ||
|
||
env: | ||
global: | ||
- LUAJIT=2.1 | ||
- SERF=0.7.0 | ||
- LUAROCKS=2.3.0 | ||
- OPENRESTY=1.9.7.3 | ||
- CASSANDRA=2.2.4 | ||
- OPENSSL=1.0.2f | ||
- SERF=0.7.0 | ||
- DNSMASQ=2.75 | ||
- CASSANDRA_HOSTS=127.0.0.1 | ||
- OPENRESTY_DIR=$HOME/openresty-$OPENRESTY | ||
- SERF_DIR=$HOME/serf | ||
- DNSMASQ_DIR=$HOME/dnsmasq | ||
- LUA_DIR=$HOME/lua | ||
- LUAROCKS_DIR=$HOME/luarocks | ||
- CASSANDRA=2.2.4 | ||
- OPENRESTY=1.9.7.3 | ||
- $CACHE_DIR=$HOME/cache | ||
matrix: | ||
- TEST_SUITE=unit | ||
- TEST_SUITE=integration | ||
DATABASE=cassandra | ||
- TEST_SUITE=plugins | ||
DATABASE=cassandra | ||
- TEST_SUITE=integration | ||
DATABASE=postgres | ||
- TEST_SUITE=plugins | ||
DATABASE=postgres | ||
|
||
before_install: | ||
- source .ci/setenv_kong.sh | ||
- bash .ci/setup_cassandra.sh | ||
- source .ci/setup_env.sh | ||
|
||
install: | ||
- luarocks purge --tree=$LUAROCKS_DIR | ||
- luarocks install busted | ||
- luarocks install luacov-coveralls | ||
- luarocks install luacheck | ||
- luarocks make | ||
- make dev | ||
|
||
script: | ||
- make lint | ||
- .ci/run_tests.sh | ||
|
||
cache: | ||
apt: true | ||
pip: true | ||
directories: | ||
- $LUA_DIR | ||
- $LUAROCKS_DIR | ||
- $SERF_DIR | ||
- $DNSMASQ_DIR | ||
- $OPENRESTY_DIR | ||
- $CACHE_DIR | ||
- $HOME/.ccm/repository | ||
|
Oops, something went wrong.