forked from nginx-clojure/nginx-clojure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
124 lines (106 loc) · 4.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
sudo: required
dist: xenial
language: clojure
lein: 2.6.1
jdk:
- openjdk8
compiler:
- gcc
addons:
hosts:
- mysql-0
- localhost
# apt:
# packages:
# - libgd-dev
# - libssl-dev
# - libgeoip-dev
cache:
directories:
- local-caches
env:
global:
- LD_LIBRARY_PATH="$JAVA_HOME/jre/lib/amd64/server"
# - PCRE_VER=8.41
- NGINX_VER=1.20.2
services:
- mysql
- redis-server
before_install:
- cat /etc/hosts
install:
# - if [ ! -f local-caches/pcre-$PCRE_VER.tar.gz ]; then wget -P local-caches http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-$PCRE_VER.tar.gz; fi
- if [ ! -f local-caches/nginx-$NGINX_VER.tar.gz ]; then wget -P local-caches https://nginx.org/download/nginx-$NGINX_VER.tar.gz; fi
- export NC_PJ_HOME=$(pwd)
- sudo ln -s /home/travis /home/who
- sudo chown travis /home/who
# - sudo apt install -y libgd-dev libssl-dev libgeoip-dev
- mkdir -p /home/travis/git
- ln -s ${NC_PJ_HOME} /home/travis/git
before_script:
- export NC_PJ_HOME=$(pwd)
- export NGX_SRC=${NC_PJ_HOME}/nginx-$NGINX_VER
- mysql -uroot -e 'create database nctest; grant all on nctest.* to "nginxclojure"@"%" identified by "111111"; flush privileges;'
# - tar zxf local-caches/pcre-$PCRE_VER.tar.gz
- tar zxf local-caches/nginx-$NGINX_VER.tar.gz
- cd ${NGX_SRC} && ./configure --with-http_v2_module --with-select_module --with-http_ssl_module --with-http_auth_request_module --with-debug --add-module=${NC_PJ_HOME}/src/c --with-http_stub_status_module --prefix= --sbin-path=nginx --conf-path=conf/nginx.conf --error-log-path=logs/error.log --http-log-path=logs/access.log --pid-path=logs/nginx.pid --lock-path=logs/nginx.lock --http-client-body-temp-path=temp/client_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --http-scgi-temp-path=temp/scgi_temp
- make
- cp objs/nginx ${NC_PJ_HOME}/test/nginx-working-dir
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- mkdir logs temp temp/client_temp temp/fastcgi_temp temp/proxy_temp temp/scgi_temp temp/uwsgi_temp
- cd /home/who/git/nginx-clojure/
- mkdir bin
- lein with-profile +cljremotetest classpath
- lein install
- lein with-profile unittest junit compile
jobs:
include:
- stage: unit test
script:
- lein with-profile unittest junit
- stage: integration test
script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf &
- sleep 10
- tail -f logs/error.log &
- curl -v http://localhost:8080/clojure
- killall tail
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :all
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-plain.conf -s stop
- # stage name not required, will continue to use `integration test`
script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf &
- sleep 10
- tail -f logs/error.log &
- curl -v http://localhost:8080/clojure
- killall tail
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :no-async
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-threadpool.conf -s stop
- # stage name not required, will continue to use `integration test`
script:
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf &
- sleep 30
- tail -f logs/error.log &
- curl -v http://localhost:8080/clojure
- killall tail
- cd /home/who/git/nginx-clojure/
- lein with-profile cljremotetest test :all
- cd /home/who/git/nginx-clojure/test/nginx-working-dir
- ./nginx -c /home/who/git/nginx-clojure/test/nginx-working-dir/conf/nginx-coroutine.conf -s stop
after_failure:
- echo "******************************** Test Failed (Start of Nginx error.log)*****************"
- cat logs/error.log
- echo "******************************** Test Failed (End of Nginx error.log)*******************"
notifications:
email: false
branches:
only:
- master
- stable