我有一个Heroku应用程序,它启用了审查应用程序。评审应用程序是基于我的应用程序根目录中的app.json文件配置的。我可以添加加载项,但我似乎无法启用运行时-dyno-元数据实验室特性。下面是我试过的很多方法之一.
{
"name": "Foo",
"scripts": {
"postdeploy": "bundle exec rake db:migrate db:seed"
},
"formation": {
"worker": {
"quantity": 1
},
"web": {
"quantity": 1
}
},
"addons": [
"heroku-postgresql",
"heroku-redis",
],
"labs": [
"runtime-dyno-metadata"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs.git"
},
{
"url": "https://github.com/heroku/heroku-buildpack-ruby.git"
}
]
}发布于 2016-06-01 14:28:43
不支持在app.json中添加实验室特性。
发布于 2021-01-27 20:55:30
您可以使用Heroku将实验室添加到评审应用程序中。有了红宝石,你可以做这样的事情:
require 'platform-api'
heroku = PlatformAPI.connect_oauth(ENV['HEROKU_API_KEY'])
# Add any other features you care about
LABS_FEATURES = %w[runtime-dyno-metadata].freeze
LABS_FEATURES.each do |feature|
heroku.app_feature.update(ENV.fetch('HEROKU_APP_NAME'), feature, enabled: true)
end请注意,至少有些实验室需要重新部署才能真正激活实验室功能,因此您必须考虑在何处调用它(例如,在release-phase中或在app.json中的postdeploy命令中调用的rake任务)。
https://stackoverflow.com/questions/37570681
复制相似问题