Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use newer imagemagick, fail on dl fail. #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ heroku-buildpack-imagemagick
=================================

This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for vendoring the ImageMagick binaries into your project.

Set the version using the IMAGE_MAGICK_VERSION env var in your environment.
16 changes: 13 additions & 3 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,30 @@ indent() {
echo "-----> Install ImageMagick"

BUILD_DIR=$1
CACHE_DIR=$2
VENDOR_DIR="$BUILD_DIR/vendor"
INSTALL_DIR="$VENDOR_DIR/imagemagick"
CACHE_FILE="$CACHE_DIR/imagemagick.tar.gz"


if [ ! -f $CACHE_FILE ]; then
# install imagemagick
IMAGE_MAGICK_VERSION="6.9.2-0"
IMAGE_MAGICK_VERSION="${IMAGE_MAGICK_VERSION:-6.9.3-1}"
IMAGE_MAGICK_FILE="ImageMagick-$IMAGE_MAGICK_VERSION.tar.gz"
IMAGE_MAGICK_DIR="ImageMagick-$IMAGE_MAGICK_VERSION"
IMAGE_MAGICK_URL="http://www.imagemagick.org/download/$IMAGE_MAGICK_FILE"
# SSL cert used on imagemagick not recognized by heroku.
IMAGE_MAGICK_URL="http://www.imagemagick.org/download/releases/$IMAGE_MAGICK_FILE"

echo "-----> Downloading ImageMagick from $IMAGE_MAGICK_URL"
curl -L --silent $IMAGE_MAGICK_URL | tar xz
wget $IMAGE_MAGICK_URL -P $BUILD_DIR | indent

echo "-----> Extracting ImageMagick from $BUILD_DIR/$IMAGE_MAGICK_FILE"
if [ ! -f $BUILD_DIR/$IMAGE_MAGICK_FILE ]; then
echo "Error: Unable to download image magick" | indent
ls $BUILD_DIR | indent
exit 1;
fi
tar xvf $BUILD_DIR/$IMAGE_MAGICK_FILE | indent

echo "-----> Building ImageMagick"
cd $IMAGE_MAGICK_DIR
Expand Down