From 16253693422e4580cedf5caeb91424301863055e Mon Sep 17 00:00:00 2001 From: dz0ny Date: Tue, 19 Jul 2016 21:04:14 +0200 Subject: [PATCH] Initial commit --- LICENSE.md | 19 +++++++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++++ bin/compile | 11 +++++++++++ bin/detect | 6 ++++++ 4 files changed, 71 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 bin/compile create mode 100755 bin/detect diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..c7d7e93 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) 2016 NiteoWeb Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c016ce5 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +Heroku Buildpack: Shell +===================== + +Run custom commands during the build process. + + +Description +----------- + +This buildpack allows to execute arbitrary commands on the build dyno during the build process. + +Just create the file `.heroku/run.sh` in the root directory of your application and write in this file the commands that you want to execute. This file is then ran in *subshell* by the `compile` script of this buildpack. That is, the commands in `.heroku/run.sh` are executed on the build dyno as they would be part of the `compile` script. + +Available build-specific variables are `BUILD_DIR`, `CACHE_DIR`, and `ENV_DIR`. + +The initial working directory is the root directory of your application(BUILD_DIR). + +Usage +----- + +Simply do: + +~~~bash +# Create file '.heroku/run.sh' containing bash commands +echo 'echo "hello world"' >.heroku/run.sh + +heroku buildpacks:set https://github.com/niteoweb/heroku-buildpack-shell.git +~~~ + +License +------- +Based on https://github.com/weibeld/heroku-buildpack-run/ + +Licensed under the MIT License. See [LICENSE.md](LICENSE.md) file. + diff --git a/bin/compile b/bin/compile new file mode 100755 index 0000000..91e7165 --- /dev/null +++ b/bin/compile @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BUILD_DIR=$1 +CACHE_DIR=$2 +ENV_DIR=$3 + +cd "$BUILD_DIR" + +echo "Running .heroku/run.sh" | sed 's/^/-----> /' + +source .heroku/run.sh diff --git a/bin/detect b/bin/detect new file mode 100755 index 0000000..f495db8 --- /dev/null +++ b/bin/detect @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# If there is no .heroku/run.sh, then don't apply this buildpack +[[ ! -f "$1/.heroku/run.sh" ]] && exit 1 + +echo "Niteoweb Shell"