为评论应用设置ROOT_URL [英] Setting ROOT_URL for Review Apps

查看:103
本文介绍了为评论应用设置ROOT_URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Heroku管道,并设置了评论应用程序,这样它就为每个PR创建一个应用程序。

使用Meteor(我认为使用Rails)设置ROOT_URL - 例如ROOT_URL = https://foo-prod.herokuapp.com 。我可以为应用程序的prod版本做一次,但每次查看应用程序都会生成新的名称。



我试图将它放在我的app.json中,但它似乎没有效果:

 scripts:{
postdeploy:export ROOT_URL = https://$HEROKU_APP_NAME.herokuapp.com

想法?

解决方案

一个非常相似的问题被问到这里,并有我的答案。



基本上,您可以使用Heroku Platform API将API标记集用作应用程序的ENV变量。


I created a Heroku pipeline and set up Review Apps, such that it creates one app per PR.

With Meteor (and I think with Rails) one needs to set ROOT_URL -- e.g. ROOT_URL=https://foo-prod.herokuapp.com. I can do this once for the prod version of the app, but review apps generate new names every time.

I tried to put this in my app.json, but it doesn't seem to have an effect:

  "scripts": {
    "postdeploy": "export ROOT_URL=https://$HEROKU_APP_NAME.herokuapp.com"
  }

Thoughts?

解决方案

A very similar question was asked here and has my answer on it.

Basically you can use the Heroku PlatformAPI using the API token set as an ENV var from the app.

这篇关于为评论应用设置ROOT_URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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