Heroku似乎忽略了app.json中的addons部分。

huangapple go评论79阅读模式
英文:

Heroku seems to be ignoring addons section in app.json

问题

我有一个包含app.json的项目,我试图添加额外的插件以与审查应用一起部署,然而,当我销毁并重新创建审查应用时,这些插件并未被创建。

以下是我的app.json:

  1. {
  2. "name": "Redacted产品",
  3. "description": "Redacted平台的后端",
  4. "keywords": [],
  5. "website": "http://Redacted.com/",
  6. "repository": "https://github.com/Redacted/redacted",
  7. "success_url": "/api/schema/swagger-ui/",
  8. "env": {
  9. "REDACTED": {
  10. "value": "redacted"
  11. }
  12. },
  13. "formation": {
  14. "web": {
  15. "quantity": 1,
  16. "size": "basic"
  17. }
  18. },
  19. "addons": [
  20. "papertrail",
  21. "heroku-redis",
  22. {
  23. "plan": "heroku-postgresql",
  24. "options": {
  25. "version": "14"
  26. }
  27. }
  28. ],
  29. "buildpacks": [
  30. {
  31. "url": "heroku/python"
  32. },
  33. {
  34. "url": "https://github.com/buyersight/heroku-google-application-credentials-buildpack"
  35. }
  36. ],
  37. "environments": {
  38. "review": {
  39. "addons": [
  40. "autoidle:hobby"
  41. ]
  42. }
  43. }
  44. }

使用这个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:

  1. {
  2. "name": "Redacted product",
  3. "description": "The backend for the Redacted Platform",
  4. "keywords": [],
  5. "website": "http://Redacted.com/",
  6. "repository": "https://github.com/Redacted/redacted",
  7. "success_url": "/api/schema/swagger-ui/",
  8. "env": {
  9. "REDACTED": {
  10. "value": "redacted"
  11. },
  12. },
  13. "formation": {
  14. "web": {
  15. "quantity": 1,
  16. "size": "basic"
  17. }
  18. },
  19. "addons": [
  20. "papertrail",
  21. "heroku-redis",
  22. {
  23. "plan": "heroku-postgresql",
  24. "options": {
  25. "version": "14"
  26. }
  27. }
  28. ],
  29. "buildpacks": [
  30. {
  31. "url": "heroku/python"
  32. },
  33. {
  34. "url": "https://github.com/buyersight/heroku-google-application-credentials-buildpack"
  35. }
  36. ],
  37. "environments": {
  38. "review": {
  39. "addons": [
  40. "autoidle:hobby"
  41. ]
  42. }
  43. }
  44. }

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.

huangapple
  • 本文由 发表于 2023年6月12日 19:27:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456215.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定