Deploying to Heroku

If your app runs on Heroku using the Elixir Buildpack (rather than Docker) you'll need to use compilation hook to authorize hex before fetching dependencies.

First, set your license key on Heroku:

heroku config:set OBAN_AUTH_KEY="YOUR OBAN AUTH KEY"

Next, add a small shell script to your application in ./bin/predeps:


mix hex.repo add oban \
    --fetch-public-key SHA256:4/OSKi0NRF91QVVXlGAhb/BIMLnK8NHcx/EWs+aIWPc \
    --auth-key ${OBAN_AUTH_KEY}

Make sure the prepdeps script is executable:

$ chmod +x ./bin/prepdeps

Finally, set the predeps script within elixir_buildpack.config: