部署2个不同的heroku应用程序与相同的代码和git仓库 [英] Deploying 2 different heroku apps with same code and git repository

查看:85
本文介绍了部署2个不同的heroku应用程序与相同的代码和git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用相同的代码创建2个不同的Heroku应用程序,使用相同的git存储库。 App1是由我的朋友在Heroku创建的,我不是一个协作者,而app2是我试图部署的同一git仓库的分支。这是可能吗?

I'm trying to create 2 different Heroku apps using the same code with the same git repository. App1 is created in Heroku by my friend and i'm not a collaborator and app2 is the branch of the same git repository that i'm trying to deploy. Is this possible?

当我尝试将第二个应用程序部署到Heroku时,我收到错误:

I'm getting an error when i'm trying to deploy the 2nd app to Heroku:

$ git push heroku branch1:master    
!  my_email_id@gmail.com not authorized to access app1
fatal: The remote end hung up unexpectedly


推荐答案

您将需要为Heroku的每个应用程序设置不同的git远程终点,以便您可以从本地一个本地的购买者推送应用程序。我不使用'heroku'的名字作为我的遥控器(不是真的很重要)我使用生产和分段映射到不同的Heroku应用程序。所以我可以做:

You will need to setup different git remote end points for each application at Heroku so you can push to either application from the one local repo. I don't use the 'heroku' name as my remote though (not that it really matters) I use production and staging mapped to different Heroku applications. So I can do:

git push production master

git push staging staging:master

通过项目根目录中的 git remote -v 检查您的远程端点。它将显示映射到您的应用程序的默认英雄。

Check your remote endpoints via git remote -v in the projects root. It will show the default heroku mapped to your application.

通过仪表板获取Heroku上的应用程序的URL,然后执行

Get the URLs for your apps on Heroku via the dashboard and do

git remote add production <gitrepo for production app here>

git remote add staging <gitrepo for staging app here>

但是,从您发布的错误中,您似乎不是一个合作者app1应用程序。

However, from the the error you've posted it looks like you're not a collaborator on the app1 application.

这篇关于部署2个不同的heroku应用程序与相同的代码和git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆