Skip to content

Commit

Permalink
feat: add support for custom region in promote executor
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Mar 11, 2024
1 parent 9896e7b commit 3fc5c89
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/nx-heroku/src/executors/promote/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export interface PromoteExecutorSchema extends ExecutorBaseSchema {
org?: string;
serviceUser: string;
variables?: Record<string, string>;
region?: string;
}
20 changes: 20 additions & 0 deletions packages/nx-heroku/src/executors/promote/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@
"type": "string",
"example": "my-org"
},
"region": {
"description": "Heroku region, used to create the app. See https://devcenter.heroku.com/articles/regions for more information.",
"type": "string",
"example": "us",
"default": "eu",
"enum": [
"us",
"eu",
"dublin",
"frankfurt",
"london",
"montreal",
"mumbai",
"oregon",
"singapore",
"sydney",
"tokyo",
"virginia"
]
},
"serviceUser": {
"description": "Heroku team member used to automate deployment",
"format": "email",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export class HerokuPromoteService extends HerokuBaseService<PromoteExecutorSchem
private async checkAppExistsInPipeline(
pipelineName: string
): Promise<string> {
const { appNamePrefix, config: environment, org, debug } = this.options;
const {
appNamePrefix,
config: environment,
org,
debug,
region,
} = this.options;
const { projectName } = this.context;
const appName = getAppName({
appNamePrefix,
Expand All @@ -58,6 +64,7 @@ export class HerokuPromoteService extends HerokuBaseService<PromoteExecutorSchem
appName,
org,
remoteName: getRemoteName(appName),
region,
});
await addAppToPipeline({
appName,
Expand Down

0 comments on commit 3fc5c89

Please sign in to comment.