Permalink
Browse files

Add back gruntjs support and some export env

  • Loading branch information...
1 parent efde9f5 commit b30c9813298d7353171e06784464bc7c36895dc4 @abtris abtris committed Jan 7, 2014
Showing with 28 additions and 0 deletions.
  1. +7 −0 bin/common.sh
  2. +21 −0 bin/compile
View
@@ -14,6 +14,13 @@ protip() {
echo
}
+mktmpdir() {
+ dir=$(mktemp -t node-$1-XXXX)
+ rm -rf $dir
+ mkdir -p $dir
+ echo $dir
+}
+
# sed -l basically makes sed replace and buffer through stdin to stdout
# so you get updates while the command runs and dont wait for the end
# e.g. npm install | indent
View
@@ -4,6 +4,10 @@ set -e # fail fast
set -o pipefail # don't ignore exit codes when piping output
# set -x # enable debugging
+# preserve git directory, which is in /app/repo.git
+# GIT_DIR is '.', otherwise it would be good to join'em
+export APPLICATION_GIT_DIR=`pwd`
+
# Configure directories
build_dir=$1
cache_dir=$2
@@ -97,6 +101,12 @@ fi
# Update the PATH
status "Building runtime environment"
+
+if [ -f /app/tmp/push_metadata.yml ]; then
+ export APPLICATION_PUSH_METADATA_FILE="/app/tmp/push_metadata.yml"
+fi;
+export APPLICATION_TMP_REPODIR=$(mktmpdir actual_repository)
+
mkdir -p $build_dir/.profile.d
echo "export PATH=\"\$HOME/vendor/node/bin:\$HOME/bin:\$HOME/node_modules/.bin:\$PATH\";" > $build_dir/.profile.d/nodejs.sh
@@ -112,3 +122,14 @@ echo "export PATH=\"\$HOME/vendor/node/bin:\$HOME/bin:\$HOME/node_modules/.bin:\
https://nomnom.heroku.com/?request_id=$REQUEST_ID \
> /dev/null
) &
+
+if [ -f $build_dir/grunt.js ] || [ -f $build_dir/gruntfile.js ] || [ -f $build_dir/Gruntfile.coffee ]; then
+ echo "-----> Found Gruntfile, running grunt heroku task"
+ if [ -f $build_dir/node_modules/grunt-cli/bin/grunt ]; then
+ $build_dir/node_modules/grunt-cli/bin/grunt heroku
+ else
+ $build_dir/node_modules/grunt/bin/grunt heroku
+ fi
+else
+ echo "-----> No gruntfile (grunt.js) found"
+fi

0 comments on commit b30c981

Please sign in to comment.