Run custom commands during the build process.
This buildpack allows to execute arbitrary commands on the build dyno during the build process by sourcing one or more files with Bash commands.
Add the buildpack to your app:
heroku buildpacks:add https://github.com/weibeld/heroku-buildpack-run.git
Create the file
buildpack-run.sh in the root directory of your app, for example:
echo "Hello World"
Now push your app to Heroku as usual. The commands in
buildpack-run.sh will be executed during the build.
If you want to use another filename than
buildpack-run.sh, then you can specify this filename in the app config variable
BUILDPACK_RUN. For example, if your file is called
heroku config:set BUILDPACK_RUN=my_file.sh
You can specify multiple files to
BUILDPACK_RUN by separating them with colons. For example, if you want to source the files
my_file_2.sh in this order, then set your
BUILDPACK_RUN as follows:
heroku config:set BUILDPACK_RUN="my_file_1.sh:my_file_2.sh"
BUILDPACK_RUNmust be relative to the root directory of your app
exit 1in your files to abort the build
BUILD_DIR: path to the root directory of your app on the build dyno
ENV_DIR: the directory holding all your app's config variables as files
CACHE_DIR: directory whose content persists across builds of your app
Licensed under the MIT License. See LICENSE.md file.
Copy the snippet above into CLI.