Heroku管道阶段是否对应于Rails环境阶段?

时间:2019-04-19 02:41:55

标签: ruby-on-rails heroku pipeline

我刚刚创建了我的第一个Heroku管道,并将Rails应用程序部署到了Execution log for request xxx Fri Apr 19 02:28:58 UTC 2019 : Starting execution for request: xxx Fri Apr 19 02:28:58 UTC 2019 : HTTP Method: POST, Resource Path: /log Fri Apr 19 02:28:58 UTC 2019 : Method request path: {} Fri Apr 19 02:28:58 UTC 2019 : Method request query string: {} Fri Apr 19 02:28:58 UTC 2019 : Method request headers: {} Fri Apr 19 02:28:58 UTC 2019 : Method request body before transformations: { "streamName": "12345", "ts": 1555641510000, "message": "help!" } Fri Apr 19 02:28:58 UTC 2019 : Endpoint request URI: https://logs.xxx.amazonaws.com/?Action=PutLogEvents Fri Apr 19 02:28:58 UTC 2019 : Endpoint request headers: {Authorization=xxx, X-Amz-Date=20190419T022858Z, x-amzn-apigateway-api-id=xxx, Accept=application/json, User-Agent=AmazonAPIGateway_xxx, X-Amz-Security-Token=xxx [TRUNCATED] Fri Apr 19 02:28:58 UTC 2019 : Endpoint request body after transformations: { "logGroupName": "FromAPI", "logStreamName": "12345", "logEvents": [ { "timestamp": 1555641510000, "message": "help!" } ] } Fri Apr 19 02:28:58 UTC 2019 : Sending request to https://logs.xxx.amazonaws.com/?Action=PutLogEvents Fri Apr 19 02:28:58 UTC 2019 : Received response. Status: 200, Integration latency: 38 ms Fri Apr 19 02:28:58 UTC 2019 : Endpoint response headers: {x-amzn-RequestId=xxx, Content-Type=application/json, Content-Length=105, Date=Fri, 19 Apr 2019 02:28:58 GMT} Fri Apr 19 02:28:58 UTC 2019 : Endpoint response body before transformations: {"Output":{"__type":"com.amazon.coral.service#UnknownOperationException","message":null},"Version":"1.0"} Fri Apr 19 02:28:58 UTC 2019 : Method response body after transformations: {"Output":{"__type":"com.amazon.coral.service#UnknownOperationException","message":null},"Version":"1.0"} Fri Apr 19 02:28:58 UTC 2019 : Method response headers: {X-Amzn-Trace-Id=Root=xxx, Content-Type=application/json} Fri Apr 19 02:28:58 UTC 2019 : Successfully completed execution Fri Apr 19 02:28:58 UTC 2019 : Method completed with status: 200 阶段。

我的问题是,这些管道阶段(例如developmentdevelopment)是否与Rails中的环境相对应?例如,部署到production阶段的我的应用程序是否从development获得其设置?还是部署在Heroku中的所有应用都从config/development.rb读取,而不管管道处于什么阶段?

我知道这似乎是一个基本问题,但我无法在文档中或此处找到信息。预先感谢。

2 个答案:

答案 0 :(得分:0)

对于任何查看此内容并供将来参考的人-正如@arieljuod猜中的,它是production

控制台输出:

Running rails c on ⬢ intg-app... up, run.3149 (Free)
Loading production environment (Rails 5.2.3)

答案 1 :(得分:0)

如果转到设置->显示配置变量,则应该有一个名为RAILS_ENV的环境变量,您可以将其设置为所需的环境。默认情况下,它是生产版本。