Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Zeschin committed Jan 15, 2014
0 parents commit 19b61b1
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Heroku Buildpack: Optipng
=======================

This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for using [optipng](http://optipng.sourceforge.net/) in your application.

It is designed to be used with [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi) to combine it with the appropriate real buildpack for your app.

This is based on http://github.com/jayzes/heroku-buildpack-ffmpeg, which was in turn based on https://github.com/shunjikonishi/heroku-buildpack-ffmpeg

Usage
-----
Add a `.buildpacks` file to the root of your repo that contains this buildpack URL and your real buildpack URL:

https://github.com/jayzes/heroku-buildpack-optipng
https://github.com/heroku/heroku-buildpack-ruby

Then create an application using the multi buildpack:

$ heroku create --buildpack https://github.com/ddollar/heroku-buildpack-multi

or configure an existing application:

$ heroku config BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi

You can verify that everything is properly installed by running the following command:

$ heroku run "optipng -v"

23 changes: 23 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

indent() {
sed -u 's/^/ /'
}

echo "-----> Installing optipng"
BUILD_DIR=$1
VENDOR_DIR="vendor"
OPTIPNG_DOWNLOAD_URL="https://github.com/jayzes/heroku-buildpack-optipng/releases/download/v0.7.4/optipng"

echo "OPTIPNG_DOWNLOAD_URL = " $PNGQUANT_DOWNLOAD_URL | indent

cd $BUILD_DIR
mkdir -p $VENDOR_DIR/optipng/bin
cd $VENDOR_DIR
curl -L --silent -o optipng/bin/optipng $OPTIPNG_DOWNLOAD_URL
chmod +x optipng/bin/optipng

echo "exporting PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/optipng"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:vendor/optipng/bin"' >> $PROFILE_PATH
5 changes: 5 additions & 0 deletions bin/detect
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# this pack is valid for all apps
echo "optipng"
exit 0
2 changes: 2 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "--- {}"

0 comments on commit 19b61b1

Please sign in to comment.