Issue
How can I run a Heroku CLI command from the Heroku Scheduler?
Resolution
The CLI can be installed with the CLI buildpack and you'll need to set a valid API key on your application to run any application-specific commands.
Here are the steps you can follow:
-
You can generate a key by using
heroku authorizations:create
on a machine that is currently running an authenticated version of the Heroku CLI and set that key as a config variableHEROKU_API_KEY
for your application. -
Add the buildpack to your app:
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-cli
.
These steps should help you run Heroku CLI commands from one-off dynos which the Heroku Scheduler add-on as well runs on.