简体   繁体   English

有多个“远程” git存储库时,“ heroku run NNN”

[英]“heroku run NNN” when there're several “remote” git repos

I have almost identical web apps on Heroku. 我在Heroku上有几乎相同的Web应用程序。 It's a single folder, it's just that there're 2 remote repos at heroku: "prod" and "staging" 这是一个文件夹,在heroku上只有两个远程存储库:“ prod”和“ staging”

$ git remote -v

staging  https://git.heroku.com/my_app-staging.git (fetch)
staging  https://git.heroku.com/my_app-staging.git (push)
prod       https://git.heroku.com/my_app-prod.git (fetch)
prod       https://git.heroku.com/my_app-prod.git (push)

When running a command via heroku such "heroku run rails c", how can I specify which app - staging or prod - it should run on? 通过heroku(例如“ heroku run rails c”)运行命令时,如何指定应在哪个应用程序-staging或prod-上运行?

You can use 您可以使用

heroku run rails c --remote prod

or 要么

heroku run rails c --remote staging

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM