Script which replicates the build-and-test done by Travis-CI

This allows developers to build nginx and run the test suite locally by
running just one single command.
pull/55/head
Adrian Perez de Castro 2016-08-18 18:16:30 +03:00
parent f051caa108
commit a1bb63c93b
No known key found for this signature in database
GPG Key ID: 91C559DBE4C9123B
1 changed files with 25 additions and 0 deletions

25
t/build-and-run Executable file
View File

@ -0,0 +1,25 @@
#! /bin/bash
set -e
if [[ $# -lt 1 || $# -gt 2 ]] ; then
echo "Usage: $0 <nginx-version> [1]" 1>&2
exit 1
fi
readonly NGINX=$1
if [[ $2 -eq 1 ]] ; then
readonly DYNAMIC=$2
fi
cd "$(dirname "$0")/.."
wget -O - http://nginx.org/download/nginx-${NGINX}.tar.gz | tar -xzf -
rm -rf prefix/
cd nginx-${NGINX}
./configure \
--add-${DYNAMIC:+dynamic-}module=.. \
--with-http_addition_module \
--prefix="$(pwd)/../prefix"
make install
cd ..
exec ./t/run prefix ${DYNAMIC}