Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: added initial travis-ci support.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
- Loading branch information
1 parent
3b484e7
commit 875f09c
Showing
1 changed file
with
60 additions
and
0 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,60 @@ | ||
sudo: required | ||
dist: trusty | ||
|
||
os: linux | ||
|
||
language: c | ||
|
||
compiler: | ||
- gcc | ||
- clang | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- mysql-server-5.6 | ||
- mysql-client-core-5.6 | ||
- mysql-client-5.6 | ||
|
||
env: | ||
global: | ||
- JOBS=3 | ||
- NGX_BUILD_JOBS=$JOBS | ||
- LUAJIT_LIB=/usr/lib64/libluajit-5.1.so | ||
- LUAJIT_INC=/usr/include/luajit-2.0 | ||
- LUA_INCLUDE_DIR=/usr/include/luajit-2.0 | ||
- LUA_CMODULE_DIR=/lib | ||
- TEST_NGINX_MYSQL_PATH=/var/run/mysqld/mysqld.sock | ||
- TEST_NGINX_SLEEP=0.006 | ||
matrix: | ||
- NGINX_VERSION=1.9.15 | ||
|
||
before_install: | ||
- sudo apt-get install -qq -y axel cpanminus libluajit-5.1-dev > build.log 2>&1 || (cat build.log && exit 1) | ||
|
||
install: | ||
- git clone https://github.com/openresty/test-nginx.git | ||
- 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/no-pool-nginx.git ../no-pool-nginx | ||
|
||
before_script: | ||
- mysql -uroot -e 'create database ngx_test; grant all on ngx_test.* to "ngx_test"@"%" identified by "ngx_test";' | ||
- wget http://downloads.mysql.com/docs/world.sql.gz && zcat world.sql.gz | mysql -uroot | ||
- mysql -uroot -e 'grant all on world.* to "ngx_test"@"%"; flush privileges;' | ||
|
||
script: | ||
- sudo cp t/data/test.crt t/data/test.key /etc/mysql | ||
- echo '[mysqld]' > ssl.cnf | ||
- echo 'ssl-ca=/etc/mysql/test.crt' >> ssl.cnf | ||
- echo 'ssl-cert=/etc/mysql/test.crt' >> ssl.cnf | ||
- echo 'ssl-key=/etc/mysql/test.key' >> ssl.cnf | ||
- sudo cp ssl.cnf /etc/mysql/conf.d | ||
- sudo service mysql restart | ||
- cd test-nginx && (sudo cpanm . > build.log 2>&1 || (cat build.log && exit 1)) && cd .. | ||
- cd lua-cjson && make && sudo PATH=$PATH make install && cd .. | ||
- export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH | ||
- ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --add-module=../lua-nginx-module --with-debug > build.log 2>&1 || (cat build.log && exit 1) | ||
- prove -r t |