Access to heroku toolbelt commands in a scheduled heroku dyno?

后端 未结 4 969
礼貌的吻别
礼貌的吻别 2021-01-02 11:04

I want to call heroku postgres backup/restore commands within a scheduled heroku task, but the heroku toolbelt isn\'t available from bash prompt, so I can\'t call heroku com

4条回答
  •  执笔经年
    2021-01-02 11:12

    As Heather Piwowar said, you can indeed download and untar the heroku tollbelt yourself, but no need to move files around after this. Here is a shorter version:

    curl -s https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz | tar xz
    PATH="/app/heroku-client/bin:$PATH"
    

    You can now use the heroku command as you wish.

    For authentification, you may want to set the HEROKU_API_KEY env var (using heroku config:set HEROKU_API_KEY=1234567890 -a your-app-name).

    Also, note that the first use of the heroku command will run longer than expected because it will try to install the latest version, dependencies and core plugins.

提交回复
热议问题