Skip to content

Commit 5ad4116

Browse files
committed
Upstream Pull Request: Replace vulcan building with heroku run
This should replace vulcan building of PHP with `heroku run`. I didn't get the s3 script to authorize correctly yet. Vulcan has been deprecated and is no longer maintained or supported (https://github.com/heroku/vulcan). Ref: mchung#45
1 parent 603d52e commit 5ad4116

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

support/package_php

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,25 @@ if [ "$S3_BUCKET" == "" ]; then
2222
exit 1
2323
fi
2424

25-
basedir="$( cd -P "$( dirname "$0" )" && pwd )"
26-
27-
# make a temp directory
28-
tempdir="$( mktemp -t php_XXXX )"
29-
rm -rf $tempdir
30-
mkdir -p $tempdir
31-
pushd $tempdir
25+
if [ "$HEROKU_APP" == "" ]; then
26+
echo "must set HEROKU_APP, i.e. HEROKU_APP=my-octopus"
27+
exit 1
28+
fi
3229

3330
# download and extract php
34-
curl -L http://us.php.net/get/php-$PHP_VERSION.tar.bz2/from/www.php.net/mirror -o php.tgz
35-
tar xzvf php.tgz
36-
3731
# build and package php for heroku
38-
vulcan build -v -s php-$PHP_VERSION -o $tempdir/php-$PHP_VERSION-with-fpm-heroku.tar.gz -p /app/vendor/php -c \
39-
"./configure --prefix=/app/vendor/php \
32+
# upload to s3
33+
heroku run --app $HEROKU_APP \
34+
"mkdir /tmp/aws; \
35+
curl -L https://raw.github.com/CubicApps/heroku-buildpack-wordpress/master/support/aws/s3 -o /tmp/aws/s3; \
36+
curl -L https://raw.github.com/CubicApps/heroku-buildpack-wordpress/master/support/aws/hmac -o /tmp/aws/hmac; \
37+
chmod 755 /tmp/aws/s3 /tmp/aws/hmac; \
38+
rm -rf /app/vendor/php; \
39+
curl -L http://us.php.net/get/php-$PHP_VERSION.tar.bz2/from/www.php.net/mirror -o /tmp/php.tar.bz2; \
40+
cd /tmp ; \
41+
tar xvjf php.tar.bz2; \
42+
cd php-$PHP_VERSION; \
43+
./configure --prefix=/app/vendor/php \
4044
--with-mysql \
4145
--with-pdo-mysql \
4246
--with-iconv \
@@ -67,7 +71,8 @@ vulcan build -v -s php-$PHP_VERSION -o $tempdir/php-$PHP_VERSION-with-fpm-heroku
6771
--without-sqlite3 \
6872
&& make install \
6973
&& /app/vendor/php/bin/pear config-set php_dir /app/vendor/php \
70-
&& yes '' | /app/vendor/php/bin/pecl install memcache"
71-
72-
# upload to s3
73-
$basedir/aws/s3 put $S3_BUCKET php-$PHP_VERSION-with-fpm-heroku.tar.gz $tempdir/php-$PHP_VERSION-with-fpm-heroku.tar.gz
74+
&& yes '' | /app/vendor/php/bin/pecl install memcache ; \
75+
cd /app/vendor/php; \
76+
tar cvfz /tmp/php-$PHP_VERSION-with-fpm-heroku.tar.gz . ; \
77+
cd /tmp/; \
78+
aws/s3 put $S3_BUCKET php-$PHP_VERSION-with-fpm-heroku.tar.gz /tmp/php-$PHP_VERSION-with-fpm-heroku.tar.gz"

0 commit comments

Comments
 (0)