Deploying 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_LICENSE_KEY="YOUR OBAN LICENSE KEY"
heroku config:set OBAN_KEY_FINGERPRINT="THE PUBLIC KEY FINGERPRINT"

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

#!/bin/bash

mix hex.repo add oban https://getoban.pro/repo \
    --fetch-public-key ${OBAN_KEY_FINGERPRINT} \
    --auth-key ${OBAN_LICENSE_KEY}

Make sure the prepdeps script is executable:

$ chmod +x ./bin/prepdeps

Finally, set the predeps script within elixir_buildpack.config:

hook_pre_fetch_dependencies="./bin/predeps"