Skip to content

Commit 746792a

Browse files
chipitsineagentzh
authored andcommitted
feature: added travis-ci support.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
1 parent d64c492 commit 746792a

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.travis.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
sudo: required
2+
dist: trusty
3+
4+
os: linux
5+
6+
language: c
7+
8+
cache:
9+
directories:
10+
- download-cache
11+
12+
addons:
13+
apt:
14+
packages:
15+
- mysql-server
16+
17+
compiler:
18+
- gcc
19+
- clang
20+
21+
env:
22+
global:
23+
- LUAJIT_PREFIX=/opt/luajit21
24+
- LUAJIT_LIB=$LUAJIT_PREFIX/lib
25+
- LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
26+
- LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1
27+
- LUA_INCLUDE_DIR=$LUAJIT_INC
28+
- LUA_CMODULE_DIR=/lib
29+
- JOBS=3
30+
- NGX_BUILD_JOBS=$JOBS
31+
- TEST_NGINX_SLEEP=0.006
32+
matrix:
33+
- NGINX_VERSION=1.9.15
34+
35+
services:
36+
- postgresql
37+
38+
before_install:
39+
- sudo apt-get install -qq -y axel cpanminus libtest-base-perl libtext-diff-perl liburi-perl libwww-perl libtest-longstring-perl liblist-moreutils-perl > build.log 2>&1 || (cat build.log && exit 1)
40+
41+
install:
42+
- if [ ! -d download-cache ]; then mkdir download-cache; fi
43+
- if [ ! -f download-cache/drizzle7-2011.07.21.tar.gz ]; then wget -O download-cache/drizzle7-2011.07.21.tar.gz http://openresty.org/download/drizzle7-2011.07.21.tar.gz; fi
44+
- git clone https://github.com/openresty/nginx-devel-utils.git
45+
- git clone https://github.com/openresty/openresty.git ../openresty
46+
- git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
47+
- git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module
48+
- git clone https://github.com/openresty/test-nginx.git
49+
- git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git
50+
- git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
51+
- git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module
52+
- git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module
53+
- git clone https://github.com/openresty/xss-nginx-module.git ../xss-nginx-module
54+
- git clone https://github.com/openresty/set-misc-nginx-module.git ../set-misc-nginx-module
55+
- git clone https://github.com/openresty/array-var-nginx-module.git ../array-var-nginx-module
56+
- git clone https://github.com/openresty/drizzle-nginx-module.git ../drizzle-nginx-module
57+
- git clone https://github.com/calio/form-input-nginx-module.git ../form-input-nginx-module
58+
- git clone https://github.com/FRiCKLE/ngx_postgres.git ../postgres-nginx-module
59+
- git clone https://github.com/openresty/openresty.git ../ngx_openresty
60+
61+
before_script:
62+
- mysql -uroot -e 'create database ngx_test; grant all on ngx_test.* to "ngx_test"@"%" identified by "ngx_test"; flush privileges;'
63+
- psql -c "create database ngx_test;" -U postgres
64+
- psql -c "create user ngx_test with password 'ngx_test';" -U postgres
65+
- psql -c "grant all privileges on database ngx_test to ngx_test;" -U postgres
66+
67+
script:
68+
- tar xzf download-cache/drizzle7-2011.07.21.tar.gz && cd drizzle7-2011.07.21
69+
- ./configure --prefix=/usr --without-server > build.log 2>&1 || (cat build.log && exit 1)
70+
- sudo PATH=$PATH make libdrizzle-1.0 install-libdrizzle-1.0 > build.log 2>&1 || (cat build.log && exit 1)
71+
- cd ../luajit2
72+
- 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)
73+
- sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)
74+
- cd ../test-nginx && sudo cpanm . && cd ..
75+
- export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH
76+
- export NGX_BUILD_CC=$CC
77+
- sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1)
78+
- nginx -V
79+
- prove -r t

0 commit comments

Comments
 (0)