This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jay Zeschin
committed
Jan 15, 2014
0 parents
commit 19b61b1
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
echo "--- {}" |