Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1285 lines (1047 sloc) 32.2 KB
# OpenResty Tester Deployment Script for Amazon Linux AMI
jobs = 3;
ngx_redis_version = 0.3.7;
nginx_version = 1.15.8;
openresty_version = 1.15.8.1rc0;
redis_version = 3.2.8;
ngx_auth_request_version = 0.2;
pcre_version = 8.42;
force = 0;
ragel_version = 6.9;
valgrind_version = 3.13.0;
libev_version = 4.15;
systemtap_version = 3.2;
perl516_version = 5.16.2;
bison_version = 3.0.4;
ccache_version = 3.1.9;
luajit_branch = v2.1-agentzh;
openssl_version = 1.1.0j;
#luajit_branch = v2.1-agentzh-no-stitch;
use_lua_resty_core = 0;
use_stap = 0;
nginx_cc_opt = '-O1 -I/opt/ssl/include';
nginx_ld_opt = '-L/opt/ssl/lib';
luajit_xcflags = '-DLUAJIT_NUMMODE=2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_ENABLE_GC64 -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2';
[%- BLOCK nginx_test_config %]
env TEST_NGINX_EVENT_TYPE '';
env MOCKEAGAIN '';
env TEST_NGINX_RESOLVER '127.0.0.1';
# warm-up the DNS cache with the domtains used in our tests.
sh 'dig @127.0.0.1 openresty.org || exit 0';
sh 'dig @127.0.0.1 agentzh.org || exit 0';
sh 'dig @127.0.0.1 sregex.org || exit 0';
sh 'dig @127.0.0.1 g.sregex.org || exit 0';
sh 'dig @127.0.0.1 www.google.com || exit 0';
[%- IF (type == "" OR type == "r" OR type == "w") AND name != "stream-lua" %]
env TEST_NGINX_USE_STAP $use_stap;
[%- ELSE %]
env TEST_NGINX_USE_STAP '';
[%- END %]
env NGX_BUILD_CC_OPTS '-I/opt/systemtap/include';
[%- UNLESS type.match("o") %]
env NGX_BUILD_CC_OPTS '-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC $NGX_BUILD_CC_OPTS';
[%- END %]
env NGX_BUILD_CC 'ccache gcc47';
env CCACHE_BASEDIR '$PWD';
dep ccache;
[%- IF type.match("o") %]
env NGX_BUILD_OPT '-O3 -funsigned-char';
env NGX_BUILD_NO_DEBUG 1;
env NGX_BUILD_EXTRA_CONFIG_OPTS '--with-threads';
[%- ELSE %]
env NGX_BUILD_OPT $nginx_cc_opt;
env NGX_BUILD_LD_OPTS $nginx_ld_opt;
env NGX_BUILD_NO_DEBUG '';
[%- END %]
env NGX_BUILD_JOBS $jobs;
env NGX_BUILD_DTRACE 1;
env LD_LIBRARY_PATH ~/git/mockeagain:$LD_LIBRARY_PATH;
env LD_PRELOAD '';
[%- IF type.match("l") %]
env TEST_NGINX_CHECK_LEAK 1;
env LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH;
[%- ELSE %]
env TEST_NGINX_CHECK_LEAK '';
[%- END %]
[%- IF type.match("h") -%]
env TEST_NGINX_USE_HUP 1;
[%- ELSE %]
env TEST_NGINX_USE_HUP '';
[%- END %]
env TEST_NGINX_SLEEP 0.015;
[%- IF type.match("v") -%]
env LD_LIBRARY_PATH '/opt/luajit-sysm/lib:$LD_LIBRARY_PATH';
env TEST_NGINX_USE_VALGRIND 1;
[%- ELSE -%]
env LD_LIBRARY_PATH '/opt/luajit/lib:$LD_LIBRARY_PATH';
env TEST_NGINX_USE_VALGRIND '';
[%- END %]
[%- IF type.match("r") -%]
env TEST_NGINX_EVENT_TYPE poll;
#env MOCKEAGAIN_VERBOSE 1;
env LD_PRELOAD '~/git/mockeagain/mockeagain.so';
env MOCKEAGAIN r;
dep mockeagain;
[%- END -%]
[%- IF type.match("w") -%]
env TEST_NGINX_POSTPONE_OUTPUT 1;
env TEST_NGINX_EVENT_TYPE poll;
#env MOCKEAGAIN_VERBOSE 1;
env MOCKEAGAIN w;
env LD_PRELOAD '~/git/mockeagain/mockeagain.so';
dep mockeagain;
[%- END -%]
sh 'PAGER= git log HEAD^..HEAD';
sh 'if [ -n "$force" -a "$force" != "0" ]; then rm -rf buildroot/nginx-$nginx_version*; test -f config && touch config || exit 0; fi';
[%- UNLESS no_build -%]
sh './util/build.sh $nginx_version || ( [ -z "$force" -o "$force" = "0" ] && touch config && ./util/build.sh $nginx_version )';
[%- END -%]
sh 'nginx -V && ldd `which nginx`|grep -E "lua|pcre|drizzle|ssl"';
[%- UNLESS no_test -%]
sh 'killall nginx || exit 0';
sh 'if [ "$use_lua_resty_core" = "1" ]; then export TEST_NGINX_INIT_BY_LUA="package.path = \'$HOME/git/lua-resty-core/lib/?.lua;$HOME/git/lua-resty-lrucache/lib/?.lua;\' .. (package.path or \'\') jit.opt.start(\'minstitch=0\') require \'resty.core\' require(\'resty.core.base\').set_string_buf_size(1) require(\'resty.core.regex\').set_buf_grow_ratio(1)"; fi; prove -I../test-nginx/lib -r t || exit 0';
[%- END -%]
[%- IF type.match("v") -%]
dep luajit_sysmalloc;
dep valgrind;
[%- END %]
dep run-caching-nameserver;
[% END -%]
ngx-lua-tests-firewall-reject {
test 'sudo iptables -S|grep -- "-A OUTPUT -p udp -m udp --dport 10086 -j REJECT"';
sh 'sudo iptables -I OUTPUT 1 -p udp --dport 10086 -j REJECT';
dep iptables;
}
ngx-lua-tests-firewall-drop-tcp {
test 'sudo iptables -S|grep -- "-A OUTPUT -p tcp --dst 127.0.0.2 --dport 12345 -j DROP"';
sh 'sudo iptables -I OUTPUT 1 -p tcp --dst 127.0.0.2 --dport 12345 -j DROP';
dep iptables;
}
ngx-lua-tests-firewall-drop-udp {
test 'sudo iptables -S|grep -- "-A OUTPUT -p udp --dst 127.0.0.2 --dport 12345 -j DROP"';
sh 'sudo iptables -I OUTPUT 1 -p udp --dst 127.0.0.2 --dport 12345 -j DROP';
dep iptables;
}
ngx-lua-tests-firewall-rules {
dep ngx-lua-tests-firewall-reject;
dep ngx-lua-tests-firewall-drop-tcp;
dep ngx-lua-tests-firewall-drop-udp;
}
iptables {
prog iptables;
yum iptables;
}
run-caching-nameserver {
running '/named -u ';
sh 'sudo service named start';
dep named caching-nameserver-config;
}
named {
prog named;
yum caching-nameserver;
}
caching-nameserver-config {
test 'grep 8.8.8.8 /etc/named.conf';
sh 'sudo wget http://agentzh.org/misc/nginx/test/caching-nameserver.conf -O /etc/named.conf';
sh 'sudo chmod a+r /etc/named.conf';
}
openssl {
file /opt/ssl/bin/openssl;
test '/opt/ssl/bin/openssl version|grep "OpenSSL $openssl_version"';
env LD_LIBRARY_PATH /opt/ssl/lib:$LD_LIBRARY_PATH;
cwd /tmp;
fetch https://www.openssl.org/source/openssl-$openssl_version.tar.gz;
tarball openssl-$openssl_version.tar.gz;
sh 'cd openssl-$openssl_version && patch -p1 < ~/git/openresty/patches/openssl-1.1.0d-sess_set_get_cb_yield.patch && ./config no-threads no-asm shared enable-ssl3 enable-ssl3-method --libdir=lib -g --prefix=/opt/ssl -DPURIFY && sed -i \'s/ -O3 / -O1 /g\' Makefile && make -j$jobs && sudo make install_sw';
dep cc cxx openresty;
}
luajit_sysmalloc {
always;
cwd ~/git/luajit2;
sh 'sudo rm -rf /opt/luajit-sysm; git reset --hard; git checkout $luajit_branch && git merge origin/$luajit_branch && make CC=gcc47 CCDEBUG=-g XCFLAGS="-DLUAJIT_USE_VALGRIND -I/opt/valgrind/include -DLUAJIT_USE_SYSMALLOC $luajit_xcflags" -B -j$jobs PREFIX=/opt/luajit-sysm && sudo make install PREFIX=/opt/luajit-sysm';
dep luajit-git valgrind;
}
luajit {
always;
cwd ~/git/luajit2;
sh 'sudo rm -rf /opt/luajit; git reset --hard; git checkout $luajit_branch && git merge origin/$luajit_branch && make CC=gcc47 CCDEBUG=-g XCFLAGS="$luajit_xcflags" -B -j$jobs PREFIX=/opt/luajit && sudo make install PREFIX=/opt/luajit';
dep luajit-git;
}
luajit-git {
git git://github.com/openresty/luajit2.git ~/git/luajit2 $luajit_branch;
}
[% BLOCK build_lua_lib %]
always;
cwd ~/git/[% name %];
env PATH '~/git/lua-nginx-module/work/nginx/sbin:$PATH';
[%- PROCESS nginx_test_config no_build=1 -%]
dep ngx_lua nginx-module-test [% name %];
[% END %]
[% BLOCK build_nginx_module %]
always;
cwd ~/git/[% name %]-nginx-module;
env PATH '~/git/[% name %]-nginx-module/work/nginx/sbin:/usr/local/openresty-debug/bin:$PATH';
env PCRE_LIB /opt/pcrejit/lib;
env PCRE_INC /opt/pcrejit/include;
env OPENSSL_LIB /opt/ssl/lib;
env OPENSSL_INC /opt/ssl/include;
env LIBDRIZZLE_INC /opt/drizzle/include/libdrizzle-1.0;
env LIBDRIZZLE_LIB /opt/drizzle/lib;
env LUAJIT_LIB /opt/luajit/lib;
env LUAJIT_INC `echo -n /opt/luajit/include/luajit-*`;
[%- PROCESS nginx_test_config no_build=0 %]
dep nginx-module-test [% "ngx_" _ name.replace("-", "_", "g") %];
dep gd-devel;
[% END -%]
[%- mods = [
'array_var', 'redis2', 'lua',
'srcache', 'memc', 'set_misc', 'xss',
'drizzle', 'rds_json', 'echo',
'postgres', 'eval',
'headers_more', 'rds_csv',
'encrypted_session', 'form_input',
'coolkit', 'iconv', 'example_lua',
'lua_upstream', 'replace_filter',
'stream_echo', 'stream_lua',
]
-%]
[%- lualibs = [
'resty-memcached', 'resty-redis',
'resty-mysql', 'resty-string',
'resty-upload', 'resty-dns',
'resty-websocket', 'resty-lock',
'resty-logger-socket', 'resty-core',
'resty-upstream-healthcheck',
'resty-lrucache', 'resty-limit-traffic',
'resty-signal', 'resty-shell',
#'tablepool',
]
%]
[%- lualib_authors = {
'resty-logger-socket' => 'cloudflare',
}
%]
[%- cpu_mods = {
array_var => 1,
xss => 1,
set_misc => 1,
coolkit => 1,
encrypted_session => 1,
example_lua => 1,
lua_upstream => 1,
headers_more => 1,
}
-%]
t {
[% FOREACH name IN mods -%]
dep t-ngx_[% name %];
[% END -%]
[% FOREACH name IN lualibs -%]
dep t-lua-[% name %];
[% END -%]
dep t-sregex;
dep t-resty-cli;
}
to {
[% FOREACH name IN mods -%]
dep to-ngx_[% name %];
[% END -%]
}
tv {
dep tv1 tv2;
dep tv-sregex;
dep tv-resty-cli;
}
tv1 {
[% i = 0 -%]
[% WHILE i < 3 -%]
[%- name = mods.$i %]
dep tv-ngx_[% name %];
[%- i = i + 1 -%]
[% END %]
}
tv2 {
[% WHILE i < mods.size -%]
[%- name = mods.$i %]
dep tv-ngx_[% name %];
[%- i = i + 1 -%]
[% END %]
}
tr {
[% FOREACH name IN mods -%]
[%- IF cpu_mods.$name; NEXT; END -%]
dep tr-ngx_[% name %];
[% END -%]
[% FOREACH name IN lualibs -%]
dep tr-lua-[% name %];
[% END -%]
}
trv {
dep trv1 trv2;
}
trv1 {
[% i = 0 -%]
[% WHILE i < 3 -%]
[%- name = mods.$i %]
[%- IF cpu_mods.$name; i = i + 1; NEXT; END %]
dep trv-ngx_[% name %];
[%- i = i + 1 -%]
[% END %]
[% FOREACH name IN lualibs -%]
dep trv-lua-[% name %];
[% END -%]
}
trv2 {
[% WHILE i < mods.size -%]
[%- name = mods.$i %]
[%- IF cpu_mods.$name; i = i + 1; NEXT; END %]
dep trv-ngx_[% name %];
[%- i = i + 1 -%]
[% END %]
}
tw {
[% FOREACH name IN mods -%]
[%- IF cpu_mods.$name; NEXT; END -%]
dep tw-ngx_[% name %];
[% END -%]
[% FOREACH name IN lualibs -%]
dep tw-lua-[% name %];
[% END -%]
}
twv {
dep twv1 twv2;
}
twv1 {
[% i = 0 -%]
[% WHILE i < 3 -%]
[%- name = mods.$i %]
[%- IF cpu_mods.$name; i = i + 1; NEXT; END %]
dep twv-ngx_[% name %];
[%- i = i + 1 -%]
[% END %]
[% FOREACH name IN lualibs -%]
dep trv-lua-[% name %];
[% END -%]
}
twv2 {
[% WHILE i < mods.size -%]
[%- name = mods.$i %]
[%- IF cpu_mods.$name; i = i + 1; NEXT; END %]
dep twv-ngx_[% name %];
[%- i = i + 1 -%]
[% END %]
}
th {
[% FOREACH name IN mods -%]
dep th-ngx_[% name %];
[% END -%]
[% FOREACH name IN lualibs -%]
dep th-lua-[% name %];
[% END -%]
}
thv {
[% FOREACH name IN mods -%]
dep thv-ngx_[% name %];
[% END -%]
[% FOREACH name IN lualibs -%]
dep thv-lua-[% name %];
[% END -%]
}
tl {
[% FOREACH name IN mods -%]
dep tl-ngx_[% name %];
[% END -%]
[% FOREACH name IN lualibs -%]
dep tl-lua-[% name %];
[% END -%]
}
ngx_stream_echo {
git git://github.com/openresty/stream-echo-nginx-module.git ~/git/stream-echo-nginx-module;
}
ngx_stream_lua {
git git://github.com/openresty/stream-lua-nginx-module.git ~/git/stream-lua-nginx-module;
}
ngx_srcache {
git git://github.com/openresty/srcache-nginx-module.git ~/git/srcache-nginx-module;
dep ndk ngx_set_misc ngx_redis ngx_xss;
dep ngx_redis2 ngx_eval ngx_echo ngx_headers_more;
dep ngx_lua ngx_rds_json ngx_drizzle ngx_postgres;
dep ngx_memc;
}
ngx_memc {
git git://github.com/openresty/memc-nginx-module.git ~/git/memc-nginx-module;
dep ragel;
}
ragel {
prog ragel;
test 'ragel -v|grep "$ragel_version"';
cwd /tmp;
fetch http://www.colm.net/files/ragel/ragel-$ragel_version.tar.gz;
tarball ragel-$ragel_version.tar.gz;
sh 'cd ragel-$ragel_version && ./configure && make -j$jobs && sudo make install';
dep cxx;
}
cxx {
prog g++;
yum gcc-c++;
dep make;
}
ngx_postgres {
git git://github.com/openresty/ngx_postgres.git ~/git/postgres-nginx-module;
env LIBPQ_INC /usr/include/pgsql92;
env LIBPQ_LIB /usr/lib64/pgsql92;
dep libpq;
}
ngx_replace_filter {
git git://github.com/openresty/replace-filter-nginx-module.git ~/git/replace-filter-nginx-module;
}
sregex {
always;
#file ~/git/mockeagain/mockeagain.so;
sh 'cd ~/git/sregex && make -j$jobs || make clean all';
env PATH /usr/local/openresty-debug/luajit/bin:/opt/bison/bin:$PATH;
dep sregex-git;
dep cc bison openresty-debug;
dep perl516-IPC-Run3 perl516-Test-LongString perl516-Test-Base perl516;
dep perl516-Test-Differences;
}
resty-cli {
git git://github.com/openresty/resty-cli.git ~/git/resty-cli;
dep ngx_lua;
dep perl-IPC-Run test-longstring test-base text-diff;
}
lua-tablepool {
git git://github.com/openresty/lua-tablepool.git ~/git/lua-tablepool;
}
perl516 {
file '/opt/perl516/bin/perl';
test '/opt/perl516/bin/perl -v|grep "$perl516_version"';
cwd /tmp;
fetch http://www.cpan.org/src/5.0/perl-$perl516_version.tar.gz;
tarball perl-$perl516_version.tar.gz;
sh 'cd perl-$perl516_version && sh Configure -Doptimize="-g -O2" -Dcc=gcc47 -Dprefix=/opt/perl516 -des && make -j$jobs && sudo make install';
dep cc;
}
perl516-Test-LongString {
test '/opt/perl516/bin/perl -MTest::LongString -e1';
sh 'echo y|sudo /opt/perl516/bin/cpan -i Test::LongString';
dep perl516;
}
perl516-Test-Differences {
test '/opt/perl516/bin/perl -MTest::Differences -e1';
sh 'echo y|sudo /opt/perl516/bin/cpan -i Test::Differences';
dep perl516;
}
perl516-Test-Base {
test '/opt/perl516/bin/perl -e "require(q{Test/Base.pm});"';
sh 'echo y|sudo /opt/perl516/bin/cpan -i Test::Base';
dep perl516;
}
perl516-IPC-Run3 {
test '/opt/perl516/bin/perl -MIPC::Run3 -e1';
sh 'echo y|sudo /opt/perl516/bin/cpan -i IPC::Run3';
dep perl516;
}
perl-IPC-Run {
test 'perl -MIPC::Run -e1';
yum perl-IPC-Run;
}
perl-IPC-Run3 {
test 'perl -MIPC::Run3 -e1';
yum perl-IPC-Run3;
}
t-sregex {
always;
cwd ~/git/sregex;
sh 'PAGER= git log HEAD^..HEAD';
sh 'PATH=/opt/perl516/bin:$PATH make test -j$jobs';
dep sregex;
}
tv-sregex {
always;
cwd ~/git/sregex;
sh 'PAGER= git log HEAD^..HEAD';
sh 'PATH=/opt/perl516/bin:$PATH make valtest -j$jobs';
dep sregex;
}
[% FOREACH type = ['', 'v'] -%]
t[% type %]-resty-cli {
[%- PROCESS build_lua_lib name="resty-cli" -%]
[%- IF type == "v" -%]
env TEST_RESTY_USE_VALGRIND 1;
[%- ELSE %]
env TEST_RESTY_USE_VALGRIND '';
[%- END %]
dep build-ngx_lua;
}
[% END -%]
bison {
file /opt/bison/bin/bison;
test '/opt/bison/bin/bison --version|grep "$bison_version"';
cwd /tmp;
fetch http://ftp.gnu.org/gnu/bison/bison-$bison_version.tar.gz;
tarball bison-$bison_version.tar.gz;
sh 'cd bison-$bison_version/ && CC=gcc47 ./configure --prefix=/opt/bison && make -j$jobs && sudo make install';
dep cc;
}
sregex-git {
git git://github.com/openresty/sregex.git ~/git/sregex;
}
libpq {
#file /usr/lib64/libpq.so;
file /usr/include/pgsql92/libpq-fe.h;
yum postgresql92-devel;
}
ngx_drizzle {
env LIBDRIZZLE_INC /opt/drizzle/include/libdrizzle-1.0;
env LIBDRIZZLE_LIB /opt/drizzle/lib;
git git://github.com/openresty/drizzle-nginx-module.git ~/git/drizzle-nginx-module;
dep libdrizzle;
}
libdrizzle {
file /opt/drizzle/lib/libdrizzle.so;
file /opt/drizzle/include/libdrizzle-1.0/libdrizzle/drizzle.h;
cwd /tmp;
fetch http://agentzh.org/misc/nginx/drizzle7-2011.07.21.tar.gz;
tarball drizzle7-2011.07.21.tar.gz;
sh 'cd drizzle7-2011.07.21/ && ./configure --without-server --prefix=/opt/drizzle && make libdrizzle-1.0 && sudo make install-libdrizzle-1.0';
dep cc;
}
ngx_rds_json {
git git://github.com/openresty/rds-json-nginx-module.git ~/git/rds-json-nginx-module;
}
ngx_rds_csv {
git git://github.com/openresty/rds-csv-nginx-module.git ~/git/rds-csv-nginx-module;
}
ngx_array_var {
git git://github.com/openresty/array-var-nginx-module.git ~/git/array-var-nginx-module;
dep ndk;
}
ngx_encrypted_session {
git git://github.com/openresty/encrypted-session-nginx-module.git ~/git/encrypted-session-nginx-module;
dep ndk;
}
ngx_form_input {
git git://github.com/calio/form-input-nginx-module ~/git/form-input-nginx-module;
dep ndk;
}
ngx_xss {
git git://github.com/openresty/xss-nginx-module.git ~/git/xss-nginx-module;
dep ragel;
}
ngx_redis2 {
git git://github.com/openresty/redis2-nginx-module.git ~/git/redis2-nginx-module;
dep ragel;
}
ngx_eval {
git git://github.com/openresty/nginx-eval-module.git ~/git/eval-nginx-module;
}
ngx_echo {
git git://github.com/openresty/echo-nginx-module.git ~/git/echo-nginx-module;
}
ngx_example_lua {
git git://github.com/agentzh/nginx-example-lua-module.git ~/git/example-lua-nginx-module;
env LUAJIT_LIB /opt/luajit/lib;
env LUAJIT_INC `echo -n /opt/luajit/include/luajit-*`;
dep ngx_lua;
}
ngx_lua_upstream {
git git://github.com/openresty/lua-upstream-nginx-module.git ~/git/lua-upstream-nginx-module;
env LUAJIT_LIB /opt/luajit/lib;
env LUAJIT_INC `echo -n /opt/luajit/include/luajit-*`;
dep ngx_lua lua-resty-core;
}
ngx_lua {
git git://github.com/openresty/lua-nginx-module.git ~/git/lua-nginx-module;
env LUAJIT_LIB /opt/luajit/lib;
env LUAJIT_INC `echo -n /opt/luajit/include/luajit-*`;
dep luajit ndk lua-resty-core;
}
pcrejit {
env PCRE_LIB /opt/pcrejit/lib;
env PCRE_INC /opt/pcrejit/include;
file /opt/pcrejit/lib/libpcre.so;
file /opt/pcrejit/include/pcre.h;
test '/opt/pcrejit/bin/pcre-config --version|grep "$pcre_version"';
cwd /tmp;
fetch ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$pcre_version.tar.bz2;
tarball pcre-$pcre_version.tar.bz2;
sh 'cd pcre-$pcre_version && CFLAGS="-g -O" CXXFLAGS="-g -O" ./configure --enable-jit --enable-utf8 --prefix=/opt/pcrejit && make -j$jobs && sudo make install';
}
ngx_auth_request {
file ~/work/nginx/ngx_http_auth_request_module-$ngx_auth_request_version;
cwd ~/work/nginx;
fetch http://mdounin.ru/files/ngx_http_auth_request_module-$ngx_auth_request_version.tar.gz;
tarball ngx_http_auth_request_module-$ngx_auth_request_version.tar.gz;
}
ngx_coolkit {
git git://github.com/FRiCKLE/ngx_coolkit.git ~/git/coolkit-nginx-module;
}
openresty-debug {
test '/usr/local/openresty-debug/nginx/sbin/nginx -V 2>&1 |grep "$openresty_version$"';
#file /usr/local/openresty-debug/luajit/include/luajit-2.0/lua.h;
file /usr/local/openresty-debug/luajit/lib/libluajit-5.1.so;
file /usr/local/openresty-debug/nginx/sbin/nginx;
cwd /tmp;
fetch http://agentzh.org/misc/nginx/openresty-$openresty_version.tar.gz;
tarball openresty-$openresty_version.tar.gz;
sh 'cd openresty-$openresty_version && ./configure --with-cc=gcc47 --with-cc-opt="$nginx_cc_opt" --with-ld-opt="$nginx_ld_opt" --prefix=/usr/local/openresty-debug --with-luajit --with-stream_ssl_preread_module --with-http_drizzle_module --with-libdrizzle=/opt/drizzle --with-http_iconv_module -j$jobs --with-debug --with-luajit-xcflags="-DLUAJIT_USE_VALGRIND -I/opt/valgrind/include $luajit_xcflags" && make -j$jobs && sudo make install';
dep libdrizzle openssl pcre valgrind;
}
[% FOREACH name IN lualibs %]
lua-[% name %] {
[%- author = lualib_authors.$name %]
[%- IF NOT author; author = "openresty"; END %]
git git://github.com/[% author %]/lua-[% name %].git ~/git/lua-[% name %];
[%- IF name == "resty-core" %]
dep lua-resty-lrucache;
[%- END %]
[%- IF name == "resty-shell" %]
dep lua-tablepool lua-resty-signal;
[%- END %]
[%- IF name == "resty-signal" %]
sh 'cd ~/git/lua-resty-signal && LD_PRELOAD= make';
dep cc;
[%- END %]
dep ngx_lua;
dep no-pool-nginx;
}
[% END %]
ngx_headers_more {
git git://github.com/openresty/headers-more-nginx-module.git ~/git/headers-more-nginx-module;
}
nginx-devel-utils {
git git://github.com/openresty/nginx-devel-utils.git ~/git/nginx-devel-utils;
dep no-pool-nginx;
dep openresty;
dep patch;
}
ngx_set_misc {
git git://github.com/openresty/set-misc-nginx-module ~/git/set-misc-nginx-module;
}
ngx_iconv {
git git://github.com/calio/iconv-nginx-module ~/git/iconv-nginx-module;
dep ndk;
}
no-pool-nginx {
git git://github.com/openresty/no-pool-nginx.git ~/git/no-pool-nginx;
dep patch;
}
openresty {
git git://github.com/openresty/openresty.git ~/git/openresty;
}
git {
prog git;
yum git;
}
mockeagain {
always;
#file ~/git/mockeagain/mockeagain.so;
sh 'cd ~/git/mockeagain && LD_PRELOAD= make';
dep mockeagain-git;
dep cc;
}
mockeagain-git {
git git://github.com/openresty/mockeagain.git ~/git/mockeagain;
}
run-redis {
running 'redis-server -';
sh '(echo "daemonize yes"; echo "loglevel warning")|redis-server -';
dep redis;
}
redis {
prog redis-server;
test 'redis-server -v|grep $redis_version';
cwd /tmp;
fetch 'http://download.redis.io/releases/redis-$redis_version.tar.gz';
tarball redis-$redis_version.tar.gz;
sh 'cd redis-$redis_version/ && ARCH= make -j$jobs && ARCH= sudo make install';
dep cc;
}
run-postgres {
running 'postgres: writer process';
sh 'sudo service postgresql start || (sleep 10 && sudo service postgresql start) || sudo service postgresql initdb';
dep run-postgres2;
}
run-postgres2 {
running 'postgres: writer process';
sh 'sudo service postgresql start || (sleep 10 && sudo service postgresql start) || sudo service postgresql initdb';
dep postgres;
}
postgres {
prog pg_ctl;
yum postgresql-server;
# vim /var/lib/pgsql9/data/pg_hba.conf
# psql> create user ngx_test with password 'ngx_test';
# psql> create database ngx_test;
# psql> grant all privileges on database ngx_test to ngx_test;
}
run-mysql {
running 'mysqld --';
sh 'sudo service mysqld start || (sleep 10 && sudo service mysqld start)';
dep mysql;
}
mysql {
prog mysqld_safe;
yum mysql mysql-server;
# mysql -u root
# mysql> create database ngx_test;
# mysql> create user 'ngx_test'@'localhost' identified by 'ngx_test';
# mysql> grant all privileges on ngx_test.* to 'ngx_test'@'localhost' with grant option;
# mysql> create database world;
# mysql> use world;
# mysql> source world.sql;
}
run-memcached {
running 'memcached -d -p 11211';
sh 'memcached -d -p 11211 -l 127.0.0.1';
dep memcached;
}
memcached {
prog memcached;
yum memcached;
}
nginx-module-test {
always;
env PATH $PWD/work/nginx/sbin:$HOME/git/nginx-devel-utils:$PATH;
dep prove test-nginx no-pool-nginx nginx-devel-utils axel perl-protocol-websocket;
dep cc openssl pcre;
}
perl-protocol-websocket {
test 'perl -MProtocol::WebSocket -e1';
cpan Protocol::WebSocket;
}
pcre {
prog pcre-config;
yum pcre-devel;
}
axel {
prog axel;
cwd /tmp;
fetch 'http://alioth.debian.org/frs/download.php/3016/axel-2.4.tar.bz2';
tarball axel-2.4.tar.bz2;
sh 'cd axel-2.4 && ./configure && make && sudo make install';
dep cc;
}
cc {
prog gcc47;
yum gcc47;
dep make;
}
make {
prog make;
yum make;
}
prove {
prog prove;
yum perl-Test-Harness;
}
test-nginx {
git git://github.com/openresty/test-nginx.git ~/git/test-nginx;
dep test-base time-hires test-longstring list-moreutils perl-http-response;
dep ab weighttp;
}
perl-http-response {
test 'perl -MHTTP::Response -e1';
cpan HTTP::Response;
}
ab {
prog ab;
yum httpd-tools;
}
weighttp {
prog weighttp;
git https://github.com/lighttpd/weighttp ~/git/weighttp;
cwd ~/git/weighttp;
sh './waf configure && ./waf build && sudo ./waf install';
dep libev python;
}
python {
prog python;
yum python;
}
libev {
file /usr/local/lib/libev.so;
file /usr/local/include/ev.h;
cwd /tmp;
fetch http://dist.schmorp.de/libev/Attic/libev-$libev_version.tar.gz;
tarball libev-$libev_version.tar.gz;
sh 'cd libev-$libev_version && ./configure && make -j$jobs && sudo make install';
dep cxx cc;
}
list-moreutils {
test 'perl -MList::MoreUtils -e1';
yum perl-List-MoreUtils;
}
test-longstring {
test 'perl -MTest::LongString -e1';
cpan Test::LongString;
}
time-hires {
test 'perl -MTime::HiRes -e1';
yum perl-Time-HiRes;
}
test-base {
test 'perl -e "require(q{Test/Base.pm});"';
yum perl-Test-Base;
dep text-diff;
}
text-diff {
test 'perl -MText::Diff -e1';
yum perl-Text-Diff;
}
patch {
prog patch;
yum patch;
}
ndk {
git git://github.com/simpl/ngx_devel_kit.git ~/git/ndk-nginx-module;
}
ngx_redis {
file ~/work/nginx/ngx_http_redis-$ngx_redis_version;
cwd ~/work/nginx;
fetch http://people.freebsd.org/~osa/ngx_http_redis-$ngx_redis_version.tar.gz;
tarball ngx_http_redis-$ngx_redis_version.tar.gz;
}
cpan {
prog cpan;
yum perl-CPAN;
dep cc;
}
[% types = ['', 'v', 'r', 'rv', 'w', 'wv', 'h', 'hv', 'l', 'o'] %]
[% FOREACH type = types %]
t[% type %]-ngx_srcache {
[%- PROCESS build_nginx_module name="srcache" type=type -%]
dep run-memcached run-redis run-mysql run-postgres;
}
t[% type %]-ngx_rds_json {
[%- PROCESS build_nginx_module name="rds-json" -%]
dep run-mysql run-postgres;
dep ngx_drizzle ngx_eval ngx_echo ngx_xss ndk ngx_set_misc ngx_array_var ngx_form_input ngx_postgres;
}
t[% type %]-ngx_rds_csv {
[%- PROCESS build_nginx_module name="rds-csv" -%]
dep run-mysql run-postgres;
dep ngx_eval ngx_echo ngx_xss ndk ngx_set_misc ngx_array_var;
dep ngx_drizzle ngx_form_input ngx_postgres;
}
t[% type %]-ngx_drizzle {
[%- PROCESS build_nginx_module name="drizzle" -%]
dep run-mysql;
dep ngx_lua ngx_echo ngx_rds_json;
dep ngx_headers_more ndk ngx_set_misc;
}
[%- IF NOT type.match("[wr]") -%]
t[% type %]-ngx_encrypted_session {
[%- PROCESS build_nginx_module name="encrypted-session" -%]
dep ngx_echo ndk ngx_set_misc ngx_lua;
}
t[% type %]-ngx_array_var {
[%- PROCESS build_nginx_module name="array-var" -%]
dep ngx_echo ndk ngx_set_misc;
}
t[% type %]-ngx_set_misc {
[%- PROCESS build_nginx_module name="set-misc" -%]
dep ndk ngx_echo ngx_iconv;
}
t[% type %]-ngx_headers_more {
[%- PROCESS build_nginx_module name="headers-more" -%]
dep ngx_eval ngx_echo ngx_lua;
}
t[% type %]-ngx_example_lua {
[%- PROCESS build_nginx_module name="example-lua" -%]
dep ngx_echo ngx_lua;
}
t[% type %]-ngx_lua_upstream {
[%- PROCESS build_nginx_module name="lua-upstream" -%]
dep ngx_echo ngx_lua ngx_set_misc;
}
t[% type %]-ngx_xss {
[%- PROCESS build_nginx_module name="xss" -%]
dep ngx_echo ndk ngx_lua;
}
[%- END %]
t[% type %]-ngx_lua {
[%- IF NOT type.match("[wr]") -%]
env LD_PRELOAD '~/git/mockeagain/mockeagain.so';
dep mockeagain;
[%- END -%]
[%- PROCESS build_nginx_module name="lua" -%]
dep run-memcached run-redis run-mysql mockeagain;
dep pcrejit ndk ngx_set_misc;
dep ngx_echo ngx_memc ngx_headers_more;
dep ngx_drizzle ngx_srcache;
dep ngx_rds_json ngx_coolkit ngx_redis2 ngx_lua_upstream;
dep lua-resty-core openresty-debug;
dep ngx-lua-tests-firewall-rules;
dep ngx_stream_lua;
dep systemtap;
}
t[% type %]-ngx_memc {
[%- PROCESS build_nginx_module name="memc" -%]
dep run-memcached;
dep ndk ngx_eval ngx_echo ngx_lua;
}
t[% type %]-ngx_redis2 {
[%- PROCESS build_nginx_module name="redis2" -%]
dep run-redis;
dep ndk ngx_eval ngx_echo ngx_set_misc ngx_lua;
}
t[% type %]-ngx_echo {
[%- PROCESS build_nginx_module name="echo" -%]
dep ndk ngx_set_misc ngx_eval ngx_xss;
dep ngx_rds_json ngx_headers_more ngx_lua;
}
t[% type %]-ngx_eval {
[%- PROCESS build_nginx_module name="eval" -%]
dep run-memcached ngx_echo ngx_memc;
}
t[% type %]-ngx_form_input {
[%- PROCESS build_nginx_module name="form-input" -%]
dep ngx_echo ndk ngx_set_misc ngx_array_var;
}
t[% type %]-ngx_postgres {
[%- PROCESS build_nginx_module name="postgres" -%]
dep ngx_echo ngx_lua ngx_eval ngx_rds_json;
dep ndk ngx_set_misc ngx_form_input ngx_coolkit;
dep ngx_auth_request run-postgres;
}
t[% type %]-ngx_iconv {
[%- PROCESS build_nginx_module name="iconv" -%]
dep ngx_echo ndk ngx_set_misc ngx_lua ngx_rds_json ngx_headers_more ngx_form_input;
}
t[% type %]-ngx_coolkit {
[%- PROCESS build_nginx_module name="coolkit" -%]
dep ngx-coolkit-build-script;
dep ngx_echo ndk ngx_set_misc ngx_lua ngx_rds_json;
}
t[% type %]-ngx_replace_filter {
env SREGEX_INC ~/git/sregex/src;
env SREGEX_LIB ~/git/sregex;
[%- PROCESS build_nginx_module name="replace-filter" -%]
dep sregex ngx_echo ngx_lua;
}
t[% type %]-ngx_stream_echo {
[%- PROCESS build_nginx_module name="stream-echo" -%]
dep ngx_lua;
}
t[% type %]-ngx_stream_lua {
[%- PROCESS build_nginx_module name="stream-lua" -%]
dep ngx-lua-tests-firewall-rules;
dep run-memcached run-redis mockeagain pcrejit;
dep ngx_lua ngx_echo ngx_stream_echo ngx_headers_more ngx_memc;
}
[% FOREACH name IN lualibs %]
t[% type %]-lua-[% name %] {
[%- PROCESS build_lua_lib name="lua-" _ name -%]
[%- IF name == "lua-resty-mysql" %]
env TEST_NGINX_MYSQL_PATH /var/lib/mysql/mysql.sock;
[%- END -%]
[%- IF name != "lua-resty-core" %]
dep lua-resty-core;
[%- END %]
dep build-ngx_lua;
}
[% END -%]
[%- END %]
ngx-coolkit-build-script {
file ~/git/coolkit-nginx-module/util/build.sh;
test 'test -x ~/git/coolkit-nginx-module/util/build.sh';
cwd ~/git/coolkit-nginx-module/util;
fetch 'http://agentzh.org/misc/nginx/ngx-coolkit-build.sh';
sh 'mv ngx-coolkit-build.sh build.sh && chmod +x build.sh';
}
valgrind {
env PATH /opt/valgrind/bin:$PATH;
file /opt/valgrind/bin/valgrind;
test '/opt/valgrind/bin/valgrind --version|grep $valgrind_version';
cwd /tmp;
fetch ftp://sourceware.org/pub/valgrind/valgrind-$valgrind_version.tar.bz2;
tarball valgrind-$valgrind_version.tar.bz2;
sh 'cd valgrind-$valgrind_version && ./configure --prefix=/opt/valgrind && make -j$jobs && sudo make install';
dep cc;
}
opsboy {
git git://github.com/openresty/opsboy.git ~/git/opsboy;
dep cc pegex tt2;
}
tt2 {
test 'perl -MTemplate -e1';
yum perl-Template-Toolkit;
}
parse-recdescent {
test 'perl -MParse::RecDescent -e1';
yum perl-Parse-RecDescent;
}
pegex {
test 'perl -MPegex -e1';
sh 'echo y|sudo cpan -i Pegex';
}
[% type="" %]
build-ngx_lua {
[%- PROCESS build_nginx_module name="lua" no_test=1 -%]
dep run-memcached run-redis run-mysql mockeagain;
dep pcrejit ndk ngx_set_misc ngx_auth_request;
dep ngx_echo ngx_memc ngx_headers_more;
dep ngx_drizzle;
dep ngx_rds_json ngx_coolkit;
dep openresty-debug;
}
gd-devel {
file /usr/include/gd.h;
yum gd-devel;
}
systemtap {
dep stap kernel-debuginfo stapusr-grp stapdev-grp;
}
stapusr-grp {
test 'groups `whoami`|grep stapusr > /dev/null';
sh 'sudo usermod -a -G stapusr `whoami`';
}
stapdev-grp {
test 'groups `whoami`|grep stapdev > /dev/null';
sh 'sudo usermod -a -G stapdev `whoami`';
}
kernel-debuginfo {
test 'ls /usr/lib/debug/lib/modules/`uname -r`/kernel/* > /dev/null 2>&1';
debuginfo 'kernel-`uname -r`';
}
stap {
env PATH /opt/systemtap/bin:$PATH;
file /opt/systemtap/bin/stap;
test '/opt/systemtap/bin/stap --version 2>&1 | grep "version $systemtap_version"';
cwd /tmp;
fetch http://sourceware.org/systemtap/ftp/releases/systemtap-$systemtap_version.tar.gz;
tarball systemtap-$systemtap_version.tar.gz;
sh 'cd systemtap-$systemtap_version && ./configure --prefix=/opt/systemtap --disable-docs --disable-publican --disable-refdocs && make -j$jobs && sudo rm -rf /opt/systemtap && sudo make install';
dep cc elfutils-devel msgfmt;
}
msgfmt {
prog msgfmt;
yum gettext;
}
elfutils-devel {
file /usr/include/dwarf.h;
#file /usr/lib/libdw.so;
yum elfutils-devel;
}
yum-utils {
prog debuginfo-install;
yum yum-utils;
}
wget {
prog wget;
yum wget;
}
tar {
prog tar;
yum install tar;
}
ccache {
prog ccache;
test 'ccache -V|grep -q "version $ccache_version"';
cwd /tmp;
fetch http://samba.org/ftp/ccache/ccache-$ccache_version.tar.bz2;
tarball ccache-$ccache_version.tar.bz2;
sh 'cd ccache-$ccache_version && ./configure && make -j$jobs && sudo make install';
}
You can’t perform that action at this time.