diff --git a/buildpack.toml b/buildpack.toml new file mode 100644 index 000000000..41fcb3a95 --- /dev/null +++ b/buildpack.toml @@ -0,0 +1,11 @@ +[buildpack] +name = "Node.js" + + [publish.Ignore] + files = [ + "etc/", + "test/", + ".github/", + ".travis.yml", + "makefile" + ] \ No newline at end of file diff --git a/etc/publish.sh b/etc/publish.sh new file mode 100755 index 000000000..61d05c3ec --- /dev/null +++ b/etc/publish.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +BP_NAME=${1:-"heroku/nodejs"} + +curVersion=$(heroku buildpacks:versions "$BP_NAME" | awk 'FNR == 3 { print $1 }') +newVersion="v$((curVersion + 1))" + +read -p "Deploy as version: $newVersion [y/n]? " choice +case "$choice" in + y|Y ) echo "";; + n|N ) exit 0;; + * ) exit 1;; +esac + +originMaster=$(git rev-parse origin/master) +echo "Tagging commit $originMaster with $newVersion... " +git tag "$newVersion" "${originMaster:?}" +git push origin refs/tags/$newVersion + +heroku buildpacks:publish "$BP_NAME" "$newVersion" + +echo "Done." \ No newline at end of file