Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Jul 19, 2016
0 parents commit 1625369
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
19 changes: 19 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

11 changes: 11 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions bin/detect
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 1625369

Please sign in to comment.