Codebase list lua-nginx-redis-connector / 8543604f-de42-4274-9ae6-d5215cc8bdfa/main .travis.yml
8543604f-de42-4274-9ae6-d5215cc8bdfa/main

Tree @8543604f-de42-4274-9ae6-d5215cc8bdfa/main (Download .tar.gz)

.travis.yml @8543604f-de42-4274-9ae6-d5215cc8bdfa/mainraw · history · blame

sudo: required
dist: trusty

os: linux

language: c

compiler: gcc

addons:
  apt:
    packages:
      - luarocks
      - redis
      - lsof

cache:
  directories:
    - download-cache

env:
  global:
    - JOBS=3
    - NGX_BUILD_JOBS=$JOBS
    - LUAJIT_PREFIX=/opt/luajit21
    - LUAJIT_LIB=$LUAJIT_PREFIX/lib
    - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1
    - LUA_INCLUDE_DIR=$LUAJIT_INC
    - OPENSSL_PREFIX=/opt/ssl
    - OPENSSL_LIB=$OPENSSL_PREFIX/lib
    - OPENSSL_INC=$OPENSSL_PREFIX/include
    - OPENSSL_VER=1.1.1f
    - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
    - TEST_NGINX_SLEEP=0.006
    - LUACHECK_VER=0.21.1
  jobs:
    - NGINX_VERSION=1.17.8

before_install:
  - sudo luarocks install luacov
  - sudo luarocks install lua-resty-redis
  - sudo luarocks install luacheck $LUACHECK_VER
  - luacheck -q .

install:
  - if [ ! -d download-cache ]; then mkdir download-cache; fi
  - if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -O download-cache/openssl-$OPENSSL_VER.tar.gz https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz; fi
  - sudo apt-get install -qq -y cpanminus axel
  - sudo cpanm --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1)
  - git clone https://github.com/openresty/openresty.git ../openresty
  - git clone https://github.com/openresty/nginx-devel-utils.git
  - git clone https://github.com/openresty/lua-cjson.git
  - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
  - git clone https://github.com/openresty/stream-lua-nginx-module.git ../stream-lua-nginx-module
  - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core
  - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache
  - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module
  - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
  - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git

script:
  - sudo iptables -A OUTPUT -p tcp --dst 127.0.0.2 --dport 12345 -j DROP
  - cd luajit2/
  - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1)
  - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)
  - cd ../lua-cjson && make && sudo PATH=$PATH make install && cd ..
  - tar zxf download-cache/openssl-$OPENSSL_VER.tar.gz
  - cd openssl-$OPENSSL_VER/
  - ./config shared --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1)
  - make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
  - sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1)
  - cd ..
  - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH
  - export NGX_BUILD_CC=$CC
  - ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-cc-opt="-I$OPENSSL_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB" --add-module=../echo-nginx-module --add-module=../lua-nginx-module --add-module=../stream-lua-nginx-module --with-stream --with-stream_ssl_module --with-debug > build.log 2>&1 || (cat build.log && exit 1)
  - nginx -V
  - ldd `which nginx`|grep -E 'luajit|ssl|pcre'
  - mkdir -p tmp
  - TMP_DIR=$PWD/tmp make test_all