-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add buildpack.toml and publish script (#548)
Add buildpack.toml and publish script
- Loading branch information
Showing
2 changed files
with
35 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,11 @@ | ||
[buildpack] | ||
name = "Node.js" | ||
|
||
[publish.Ignore] | ||
files = [ | ||
"etc/", | ||
"test/", | ||
".github/", | ||
".travis.yml", | ||
"makefile" | ||
] |
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,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." |