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

Deploy apps from subdirectories to Heroku

License

Notifications You must be signed in to change notification settings

Mergifyio/heroku-buildpack-subdir

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

ARCHIVED

Heroku Buildpack Subdir

License: MIT

Allows you to compose multiple buildpacks with apps in multiple directories. For information regarding adding multiple buildpacks, check out the official docs here.

This buildpack must be at index 1 and all buildpacks following should be at index 2 through N.

Usage

$ heroku buildpacks:set https://github.com/negativetwelve/heroku-buildpack-subdir

Example .buildpacks file:

$ cat .buildpacks
https://github.com/heroku/heroku-buildpack-nginx
api=https://github.com/heroku/heroku-buildpack-ruby
web=https://github.com/heroku/heroku-buildpack-nodejs
web=https://github.com/heroku/heroku-buildpack-pgbouncer
https://github.com/heroku/heroku-buildpack-go

This would run:

  • The first buildpack would be in the root directory use use the nginx buildpack.
  • The second buildpack would cd into an api directory and use a ruby buildpack.
  • The third would cd into a web directory and use a nodejs buildpack.
  • The fourth would cd into a web directory and use a pgbouncer buildpack.
  • The firth would be in the root directory and use a go buildpack.

Buildpacks are executed in the order they are declared.

Experimental features

.profile.d scripts are left behind by buildpacks and are invoked by Heroku when the dyno is starting. This allows buildpacks to update the PATH environment for example. Since buildpacks can be ran in subdirectories, the .profile.d scripts left behind by these buildpacks are not invoked by Heroku.

Support for this recently landed in this buildpack but is still experimental. You can enable it by setting the SUBDIR_ENABLE_PROFILE_SOURCING setting on your Heroku app:

$ heroku config:set SUBDIR_ENABLE_PROFILE_SOURCING=1

You can read more about the role of .profile.d scripts in the Heroku documentation:

https://devcenter.heroku.com/articles/buildpack-api#profile-d-scripts

Note: if you're using the Python or Node.js buildpack, you most likely want to enable this setting.

About

Deploy apps from subdirectories to Heroku

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%