Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 85 lines (65 sloc) 1.96 KB
#!/usr/bin/env bash
set -e
YELLOW='\033[1;33m'
RESET='\033[0m'
echo -e "${YELLOW}WARNING: This buildpack is no longer maintained."
echo -e
echo -e "Please choose a different buildpack or go to https://github.com/ddollar/heroku-buildpack-multi"
echo "and fork it to your own account."
echo -e
echo -e "This buildpack will cease to function at the stroke of midnight on January 1, 2017.${RESET}"
[ $(date +%Y%m%d%H%M%S) -gt "20170101000000" ] && exit 1
function indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";;
*) sed -u "$c";;
esac
}
unset GIT_DIR
for BUILDPACK in $(cat $1/.buildpacks); do
dir=$(mktemp -t buildpackXXXXX)
rm -rf $dir
url=${BUILDPACK%#*}
branch=${BUILDPACK#*#}
if [ "$branch" == "$url" ]; then
branch=""
fi
if [ "$url" != "" ]; then
echo "=====> Downloading Buildpack: $url"
if [[ "$url" =~ \.tgz$ ]]; then
mkdir -p "$dir"
curl -s "$url" | tar xvz -C "$dir" >/dev/null 2>&1
else
git clone $url $dir >/dev/null 2>&1
if [ -f "$dir/.gitmodules" ]; then
echo "=====> Detected git submodules. Initializing..."
(cd $dir && git submodule update --init --recursive)
fi
fi
cd $dir
if [ "$branch" != "" ]; then
git checkout $branch >/dev/null 2>&1
fi
# we'll get errors later if these are needed and don't exist
chmod -f +x $dir/bin/{detect,compile,release} || true
framework=$($dir/bin/detect $1)
if [ $? == 0 ]; then
echo "=====> Detected Framework: $framework"
$dir/bin/compile $1 $2 $3
if [ $? != 0 ]; then
exit 1
fi
# check if the buildpack left behind an environment for subsequent ones
if [ -e $dir/export ]; then
source $dir/export
fi
if [ -x $dir/bin/release ]; then
$dir/bin/release $1 > $1/last_pack_release.out
fi
fi
fi
done
if [ -e $1/last_pack_release.out ]; then
echo "Using release configuration from last framework ($framework)."
fi
You can’t perform that action at this time.