Skip to content

Commit

Permalink
rework compile to stop using cache altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaher committed Mar 26, 2012
1 parent 87f55b5 commit f5998c6
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,13 @@ if [ -f www/Procfile ]; then
mv www/Procfile .
fi

# unpack cache
for COMP in APACHE PHP; do
DIR=`eval echo '$'${COMP}_PATH`
VERSION=`eval echo '$'${COMP}_VERSION`
[ `cat $CACHE_DIR/$DIR/VERSION 2>/dev/null` == "$VERSION" ] || continue
APACHE_URL="https://s3.amazonaws.com/php-lp-tmaher/apache-$APACHE_VERSION.tar.gz"
echo "-----> Bundling Apache version $APACHE_VERSION"
curl --silent --max-time 60 --location "$APACHE_URL" | tar xz

rm -rf $DIR
if [ -d $CACHE_DIR/$DIR ]; then
cp -r $CACHE_DIR/$DIR $DIR
fi
done

# install apache if needed
if [ ! -d $APACHE_PATH ] || [ `cat ${APACHE_PATH}/VERSION` != $APACHE_VERSION ]; then
[ -d $APACHE_PATH ] && rm -rf $APACHE_PATH
APACHE_URL="https://s3.amazonaws.com/php-lp-tmaher/apache-$APACHE_VERSION.tar.gz"
echo "-----> Bundling Apacheeee version $APACHE_VERSION"
curl --silent --max-time 60 --location $APACHE_URL | tar xz
fi

# install php if needed
if [ ! -d $PHP_PATH ] || [ `cat ${PHP_PATH}/VERSION` != $PHP_VERSION ]; then
[ -d $PHP_PATH ] && rm -rf $PHP_PATH
PHP_URL="https://s3.amazonaws.com/php-lp-tmaher/php-$PHP_VERSION.tar.gz"
echo "-----> Bundling PHP version $PHP_VERSION"
curl --silent --max-time 60 --location $PHP_URL | tar xz
fi
PHP_URL="https://s3.amazonaws.com/php-lp-tmaher/php-$PHP_VERSION.tar.gz"
echo "-----> Bundling PHP version $PHP_VERSION"
curl --silent --max-time 60 --location "$PHP_URL" | tar xz

# update config files
cp $LP_DIR/conf/httpd.conf $APACHE_PATH/conf
Expand All @@ -83,9 +63,5 @@ EOF

chmod +x boot.sh

# repack cache
mkdir -p $CACHE_DIR
for DIR in $APACHE_PATH $PHP_PATH ; do
rm -rf $CACHE_DIR/$DIR
cp -R $DIR $CACHE_DIR/$DIR
done
# clean the cache
rm -rf $CACHE_DIR/*

0 comments on commit f5998c6

Please sign in to comment.