From a1bb63c93bc5d07cf7ff19bfe80bcd0ae634a067 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Thu, 18 Aug 2016 18:16:30 +0300 Subject: [PATCH] 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. --- t/build-and-run | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 t/build-and-run diff --git a/t/build-and-run b/t/build-and-run new file mode 100755 index 0000000..68584b7 --- /dev/null +++ b/t/build-and-run @@ -0,0 +1,25 @@ +#! /bin/bash +set -e + +if [[ $# -lt 1 || $# -gt 2 ]] ; then + echo "Usage: $0 [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}