英文:
Heroku seems to be ignoring addons section in app.json
问题
我有一个包含app.json的项目,我试图添加额外的插件以与审查应用一起部署,然而,当我销毁并重新创建审查应用时,这些插件并未被创建。
以下是我的app.json:
{
  "name": "Redacted产品",
  "description": "Redacted平台的后端",
  "keywords": [],
  "website": "http://Redacted.com/",
  "repository": "https://github.com/Redacted/redacted",
  "success_url": "/api/schema/swagger-ui/",
  "env": {
    "REDACTED": {
      "value": "redacted"
    }
  },
  "formation": {
    "web": {
      "quantity": 1,
      "size": "basic"
    }
  },
  "addons": [
    "papertrail",
    "heroku-redis",
    {
      "plan": "heroku-postgresql",
      "options": {
        "version": "14"
      }
    }
  ],
  "buildpacks": [
    {
      "url": "heroku/python"
    },
    {
      "url": "https://github.com/buyersight/heroku-google-application-credentials-buildpack"
    }
  ],
  "environments": {
    "review": {
      "addons": [
        "autoidle:hobby"
      ]
    }
  }
}
使用这个app.json,postgres和autoidle被添加,并且环境变量起作用,然而,heroku-redis和papertrail没有被添加。
我尝试过:
- 从插件中删除postgres,奇怪的是,当我销毁并重新创建审查应用时,它仍然会被添加。
 - 将papertrail作为对象而不是字符串,例如 
{ "plan": "papertrail" } - 销毁并重新创建审查应用
 
有人有任何建议吗?
英文:
I have a project with app.json, and I am trying to add additional addons to be deployed with review apps, however, the addons are not being created when I destroy and recreate the review app.
Here is my app.json:
{
  "name": "Redacted product",
  "description": "The backend for the Redacted Platform",
  "keywords": [],
  "website": "http://Redacted.com/",
  "repository": "https://github.com/Redacted/redacted",
  "success_url": "/api/schema/swagger-ui/",
  "env": {
    "REDACTED": {
      "value": "redacted"
    },
  },
  "formation": {
    "web": {
      "quantity": 1,
      "size": "basic"
    }
  },
  "addons": [
    "papertrail",
    "heroku-redis",
    {
      "plan": "heroku-postgresql",
      "options": {
        "version": "14"
      }
    }
  ],
  "buildpacks": [
    {
      "url": "heroku/python"
    },
    {
      "url": "https://github.com/buyersight/heroku-google-application-credentials-buildpack"
    }
  ],
  "environments": {
    "review": {
      "addons": [
        "autoidle:hobby"
      ]
    }
  }
}
With this app.json, postgres and autoidle are added, and the environment variables work, however, heroku-redis and papertrail are not added.
I have tried:
- Removing postgres from addons, strangely it still gets added when I destroy and recreate the review app.
 - Having papertrail as an object instead of a string, eg 
{"plan": "papertrail"} - Destroying and recreating the review app
 
Does anyone have any suggestions?
答案1
得分: 1
答案是插件必须添加在"environments -> review -> addons"而不是顶层插件。
英文:
The answer is that the addons had to be added in environments -> review -> addons and not the top level addons.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论