22# Travis CI Bash Script for Installing Nginx on Travis CI and Testing Configurations
33# https://github.com/mitchellkrogza
44
5- set -e
6- set -x
7-
8- DIR=$( realpath $( dirname " $0 " ) )
9- USER=$( whoami)
10- PHP_VERSION=$( phpenv version-name)
11- ROOT=$( realpath " $DIR /.." )
12- PORT=9000
13- SERVER=" /tmp/php.sock"
14-
15- function tpl {
16- sed \
17- -e " s|{DIR}|$DIR |g" \
18- -e " s|{USER}|$USER |g" \
19- -e " s|{PHP_VERSION}|$PHP_VERSION |g" \
20- -e " s|{ROOT}|$ROOT |g" \
21- -e " s|{PORT}|$PORT |g" \
22- -e " s|{SERVER}|$SERVER |g" \
23- < $1 > $2
24- }
5+ # set -e
6+ # set -x
7+
8+ # DIR=$(realpath $(dirname "$0"))
9+ # USER=$(whoami)
10+ # PHP_VERSION=$(phpenv version-name)
11+ # ROOT=$(realpath "$DIR/..")
12+ # PORT=9000
13+ # SERVER="/tmp/php.sock"
14+
15+ # function tpl {
16+ # sed \
17+ # -e "s|{DIR}|$DIR|g" \
18+ # -e "s|{USER}|$USER|g" \
19+ # -e "s|{PHP_VERSION}|$PHP_VERSION|g" \
20+ # -e "s|{ROOT}|$ROOT|g" \
21+ # -e "s|{PORT}|$PORT|g" \
22+ # -e "s|{SERVER}|$SERVER|g" \
23+ # < $1 > $2
24+ # }
2525
2626# Make some working directories.
27- mkdir " $DIR /nginx"
28- mkdir " $DIR /nginx/sites-enabled"
29- mkdir " $DIR /var"
27+ # mkdir "$DIR/nginx"
28+ # mkdir "$DIR/nginx/sites-enabled"
29+ # mkdir "$DIR/var"
3030
3131# Configure the PHP handler.
32- if [ " $PHP_VERSION " = ' hhvm' ] || [ " $PHP_VERSION " = ' hhvm-nightly' ]
33- then
34- HHVM_CONF=" $DIR /nginx/hhvm.ini"
32+ # if [ "$PHP_VERSION" = 'hhvm' ] || [ "$PHP_VERSION" = 'hhvm-nightly' ]
33+ # then
34+ # HHVM_CONF="$DIR/nginx/hhvm.ini"
3535
36- tpl " $DIR /hhvm.tpl" " $HHVM_CONF "
36+ # tpl "$DIR/hhvm.tpl" "$HHVM_CONF"
3737
38- cat " $HHVM_CONF "
38+ # cat "$HHVM_CONF"
3939
40- hhvm \
41- --mode=daemon \
42- --config=" $HHVM_CONF "
43- else
44- PHP_FPM_BIN=" $HOME /.phpenv/versions/$PHP_VERSION /sbin/php-fpm"
45- PHP_FPM_CONF=" $DIR /nginx/php-fpm.conf"
40+ # hhvm \
41+ # --mode=daemon \
42+ # --config="$HHVM_CONF"
43+ # else
44+ # PHP_FPM_BIN="$HOME/.phpenv/versions/$PHP_VERSION/sbin/php-fpm"
45+ # PHP_FPM_CONF="$DIR/nginx/php-fpm.conf"
4646
4747 # Build the php-fpm.conf.
48- tpl " $DIR /php-fpm.tpl" " $PHP_FPM_CONF "
48+ # tpl "$DIR/php-fpm.tpl" "$PHP_FPM_CONF"
4949
5050 # Start php-fpm
51- " $PHP_FPM_BIN " --fpm-config " $PHP_FPM_CONF "
52- fi
51+ # "$PHP_FPM_BIN" --fpm-config "$PHP_FPM_CONF"
52+ # fi
5353
5454# Build the default nginx config files.
55- tpl " $DIR /nginx.tpl" " $DIR /nginx/nginx.conf"
56- tpl " $DIR /fastcgi.tpl" " $DIR /nginx/fastcgi.conf"
57- tpl " $DIR /defaultsite.tpl" " $DIR /nginx/sites-enabled/defaultsite.conf"
55+ # tpl "$DIR/nginx.tpl" "$DIR/nginx/nginx.conf"
56+ # tpl "$DIR/fastcgi.tpl" "$DIR/nginx/fastcgi.conf"
57+ # tpl "$DIR/defaultsite.tpl" "$DIR/nginx/sites-enabled/defaultsite.conf"
5858
5959# Start nginx.
60- nginx -c " $DIR /nginx/nginx.conf"
60+ # nginx -c "$DIR/nginx/nginx.conf"
61+ echo $TRAVIS_BUILD_DIR
62+ ls -la /etc/nginx
0 commit comments