Skip to content

Commit

Permalink
Merge pull request #17 from gmambro/master
Browse files Browse the repository at this point in the history
support for setting PERL_CPANM_OPT via heroku config
  • Loading branch information
miyagawa committed Aug 3, 2015
2 parents 2da7480 + fe982cf commit 06593ac
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bin/compile
@@ -1,16 +1,28 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage:
#
# $ bin/compile <build-dir> <cache-dir> <env-path>

# Fail fast and fail hard.
set -eo pipefail

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

BUILD_DIR=$1
CACHE_DIR=$2
ENV_DIR=$3

PATH="$BUILD_DIR/local/bin:$PATH"

export PERL5LIB="$BUILD_DIR/local/lib/perl5"
export PERL_CPANM_OPT="--quiet --notest -l $BUILD_DIR/local"

PERL_CPANM_OPT="--quiet --notest -l $BUILD_DIR/local"
if [ -f $ENV_DIR/PERL_CPANM_OPT ]; then
PERL_CPANM_OPT="$PERL_CPANM_OPT $(cat $ENV_DIR/PERL_CPANM_OPT)"
fi
export PERL_CPANM_OPT

rm -rf $BUILD_DIR/local
if [ -d $CACHE_DIR/local ]; then
Expand All @@ -25,6 +37,7 @@ if ! [ -e $BUILD_DIR/local/bin/cpanm ]; then
fi

echo "-----> Installing dependencies"
echo "cpanm options: $PERL_CPANM_OPT" | indent
cpanm --installdeps . 2>&1 | indent

echo "-----> Installing Starman"
Expand Down

0 comments on commit 06593ac

Please sign in to comment.