【问题标题】:How do I run heroku-toolbelt commands without the `--app` parameter如何在没有 `--app` 参数的情况下运行 heroku-toolbelt 命令
【发布时间】:2017-01-23 20:21:33
【问题描述】:

我曾经运行 heroku create 并使用 git push heroku master 进行部署,但后来我转向基于 Github 的工作流程,其中代码首先被推送到我的 Github 存储库,并通过网络挂钩进行部署。

我现在必须在每个命令之后运行 --app appname-a appname,这很烦人。

例如

heroku run rails db:migrate -a appname # instead of
heroku run rails db:migrate

heroku run rails console -a appname # instead of
heroku run rails console

heroku run logs -t -a appname # instead of
heroku run logs -t

如何强制 heroku-toolbelt 将此 repo 链接到 heroku 应用程序,以便我可以在没有 --app 参数的情况下运行 heroku

【问题讨论】:

    标签: heroku heroku-toolbelt


    【解决方案1】:

    添加一个名为heroku 的遥控器,其网址为https://git.heroku.com/appname.git

    运行这个:

    $ git remote add heroku https://git.heroku.com/appname.git
    

    【讨论】:

    • 为我工作,知道为什么会很有用,不过......?
    • 可以确认即使名称为 appname 的 git repo 不存在,(即应用程序的名称与 repo 不同),这仍然有效,只要您使用 appname.git 作为上面的遥控器. (为避免疑问,我也通过 github 进行部署,而不是问题所要求的 heroku git)。
    猜你喜欢
    • 2014-04-05
    • 1970-01-01
    • 2020-07-17
    • 2021-12-05
    • 1970-01-01
    • 1970-01-01
    • 2014-05-29
    • 2014-12-07
    • 2020-09-20
    相关资源
    最近更新 更多