forked from iphoting/heroku-buildpack-php-tyler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage_nginx
executable file
·37 lines (26 loc) · 1.13 KB
/
package_nginx
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
#!/bin/bash
set -e
if [ "$NGINX_VERSION" == "" ]; then
echo "must set NGINX_VERSION, i.e NGINX_VERSION=1.2.0"
exit 1
fi
basedir="$( cd -P "$( dirname "$0" )" && pwd )"
# make a temp directory
tempdir="$( mktemp -t nginx_XXXX )"
rm -rf $tempdir
mkdir -p $tempdir
pushd $tempdir
# download and extract nginx
curl -L http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o - | tar xz
# download and extract pcre into contrib directory
pushd nginx-$NGINX_VERSION/contrib
curl -L ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz -o - | tar zx
popd
# build and package nginx for heroku
vulcan build -v -s nginx-$NGINX_VERSION -o $tempdir/nginx-$NGINX_VERSION-heroku.tar.gz -p /app/vendor/nginx -c './configure --prefix=/app/vendor/nginx --with-pcre=contrib/pcre-8.21 --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module && make install'
popd
cp $tempdir/nginx-$NGINX_VERSION-heroku.tar.gz .
echo "+ Binaries available at ./nginx-$NGINX_VERSION-heroku.tar.gz"
echo "+ Upload this package to Amazon S3."
# upload to s3
#s3cmd put -rr $tempdir/nginx-$NGINX_VERSION-heroku.tar.gz s3://$S3_BUCKET