使用 Travis-CI 将不同的分支部署到不同的 Heroku 应用程序
Deploy different branches to different Heroku applications with Travis-CI
在我的 github 存储库中,我有两个分支:master
和 release
。所以目前有这个 .travis.yml
配置:
deploy:
provider: heroku
api_key:
secure: [MY-ENCRYPTED-KEY]
app: myapp
on:
repo: helloworld/myapp
branch: release
run:
- restart
skip_cleanup: true
可以从 release
分支部署名为 myapp
的 heroku 应用程序。
根据 documentation,我可以像这样指定自定义应用程序名称(dev
和 production
键):
deploy:
provider: heroku
api_key:
secure: [MY-ENCRYPTED-KEY]
app:
dev: myapp-dev
production: myapp
on:
repo: helloworld/myapp
branch: release
run:
- restart
skip_cleanup: true
现在的问题是:
如何为每个应用指定分支?喜欢:
master
分支 ->
myapp-dev
(dev)
release
分支机构->
myapp
(生产)
文档对此并不清楚...
文档中没有任何地方说明,但事实证明 app
部分中的键名称实际上对应于分支名称:
deploy:
provider: heroku
api_key:
secure: [MY-ENCRYPTED-KEY]
app:
master: myapp-dev
release: myapp
on:
repo: helloworld/myapp
run:
- restart
skip_cleanup: true
在我的 github 存储库中,我有两个分支:master
和 release
。所以目前有这个 .travis.yml
配置:
deploy:
provider: heroku
api_key:
secure: [MY-ENCRYPTED-KEY]
app: myapp
on:
repo: helloworld/myapp
branch: release
run:
- restart
skip_cleanup: true
可以从 release
分支部署名为 myapp
的 heroku 应用程序。
根据 documentation,我可以像这样指定自定义应用程序名称(dev
和 production
键):
deploy:
provider: heroku
api_key:
secure: [MY-ENCRYPTED-KEY]
app:
dev: myapp-dev
production: myapp
on:
repo: helloworld/myapp
branch: release
run:
- restart
skip_cleanup: true
现在的问题是:
如何为每个应用指定分支?喜欢:
master
分支->
myapp-dev
(dev)release
分支机构->
myapp
(生产)
文档对此并不清楚...
文档中没有任何地方说明,但事实证明 app
部分中的键名称实际上对应于分支名称:
deploy:
provider: heroku
api_key:
secure: [MY-ENCRYPTED-KEY]
app:
master: myapp-dev
release: myapp
on:
repo: helloworld/myapp
run:
- restart
skip_cleanup: true