mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
feat: Add Heroku Review Apps support for preview deployments (#11304)
- Add pr-predeploy script and review environment config in app.json - Use smaller addon tiers for review apps to reduce costs - Auto-derive URL from HEROKU_APP_NAME when URL is not set - Make URL optional for review apps Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,23 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postdeploy": "yarn sequelize db:migrate"
|
"postdeploy": "yarn sequelize db:migrate",
|
||||||
|
"pr-predeploy": "yarn sequelize db:migrate"
|
||||||
|
},
|
||||||
|
"environments": {
|
||||||
|
"review": {
|
||||||
|
"scripts": {
|
||||||
|
"postdeploy": "yarn sequelize db:migrate"
|
||||||
|
},
|
||||||
|
"addons": [
|
||||||
|
{
|
||||||
|
"plan": "heroku-redis:mini"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"plan": "heroku-postgresql:essential-0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"NODE_ENV": {
|
"NODE_ENV": {
|
||||||
@@ -43,8 +59,12 @@
|
|||||||
"required": true
|
"required": true
|
||||||
},
|
},
|
||||||
"URL": {
|
"URL": {
|
||||||
"description": "https://{your app name}.herokuapp.com, or the domain you are binding to",
|
"description": "https://{your app name}.herokuapp.com, or the domain you are binding to. For review apps, this is auto-generated.",
|
||||||
"required": true
|
"required": false
|
||||||
|
},
|
||||||
|
"HEROKU_APP_NAME": {
|
||||||
|
"description": "Automatically set by Heroku for review apps",
|
||||||
|
"required": false
|
||||||
},
|
},
|
||||||
"GOOGLE_CLIENT_ID": {
|
"GOOGLE_CLIENT_ID": {
|
||||||
"description": "See https://developers.google.com/identity/protocols/OAuth2 to create a new Google OAuth client. You must configure at least one of Slack or Google to control login.",
|
"description": "See https://developers.google.com/identity/protocols/OAuth2 to create a new Google OAuth client. You must configure at least one of Slack or Google to control login.",
|
||||||
|
|||||||
+7
-1
@@ -200,6 +200,7 @@ export class Environment {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The fully qualified, external facing domain name of the server.
|
* The fully qualified, external facing domain name of the server.
|
||||||
|
* If not set, will be derived from HEROKU_APP_NAME for Heroku deployments.
|
||||||
*/
|
*/
|
||||||
@Public
|
@Public
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@@ -208,7 +209,12 @@ export class Environment {
|
|||||||
require_protocol: true,
|
require_protocol: true,
|
||||||
require_tld: false,
|
require_tld: false,
|
||||||
})
|
})
|
||||||
public URL = (environment.URL ?? "").replace(/\/$/, "");
|
public URL = (
|
||||||
|
environment.URL ??
|
||||||
|
(environment.HEROKU_APP_NAME
|
||||||
|
? `https://${environment.HEROKU_APP_NAME}.herokuapp.com`
|
||||||
|
: "")
|
||||||
|
).replace(/\/$/, "");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If using a Cloudfront/Cloudflare distribution or similar it can be set below.
|
* If using a Cloudfront/Cloudflare distribution or similar it can be set below.
|
||||||
|
|||||||
Reference in New Issue
Block a user