Giter Site home page Giter Site logo

heroku-buildpack-run's Introduction

Heroku Buildpack: Run

Run custom commands during the build process.

Description

This buildpack allows to execute arbitrary commands on the build dyno during the build process by sourcing one or more files with Bash commands.

Usage

Basic

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.

Optional: use a different filename

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 my_file.sh:

heroku config:set BUILDPACK_RUN=my_file.sh

Optional: use multiple files

You can specify multiple files to BUILDPACK_RUN by separating them with colons. For example, if you want to source the files my_file_1.sh and 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"

Additional Information

  • The working directory of the shell in which your commands will be executed is the root directory of your app
  • The paths of the files specified to BUILDPACK_RUN must be relative to the root directory of your app
  • You can use the command exit 1 in your files to abort the build
  • The following build-specific shell variables are available to your command files:
    • 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

License

Licensed under the MIT License. See LICENSE.md file.

heroku-buildpack-run's People

Contributors

weibeld avatar nelsonjchen avatar

Watchers

Ajay Varia avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.