From 3fc5c89267e544319e46e3c52ff9012c09e1bc1f Mon Sep 17 00:00:00 2001 From: Edouard Date: Mon, 11 Mar 2024 13:13:00 +0100 Subject: [PATCH] feat: add support for custom region in `promote` executor --- .../src/executors/promote/schema.d.ts | 1 + .../src/executors/promote/schema.json | 20 +++++++++++++++++++ .../services/heroku-promote.service.ts | 9 ++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/nx-heroku/src/executors/promote/schema.d.ts b/packages/nx-heroku/src/executors/promote/schema.d.ts index c28eccc..9f3a7a1 100644 --- a/packages/nx-heroku/src/executors/promote/schema.d.ts +++ b/packages/nx-heroku/src/executors/promote/schema.d.ts @@ -4,4 +4,5 @@ export interface PromoteExecutorSchema extends ExecutorBaseSchema { org?: string; serviceUser: string; variables?: Record; + region?: string; } diff --git a/packages/nx-heroku/src/executors/promote/schema.json b/packages/nx-heroku/src/executors/promote/schema.json index 7d256e3..45bc8a0 100644 --- a/packages/nx-heroku/src/executors/promote/schema.json +++ b/packages/nx-heroku/src/executors/promote/schema.json @@ -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", diff --git a/packages/nx-heroku/src/executors/promote/services/heroku-promote.service.ts b/packages/nx-heroku/src/executors/promote/services/heroku-promote.service.ts index a9e45a4..da4669e 100644 --- a/packages/nx-heroku/src/executors/promote/services/heroku-promote.service.ts +++ b/packages/nx-heroku/src/executors/promote/services/heroku-promote.service.ts @@ -44,7 +44,13 @@ export class HerokuPromoteService extends HerokuBaseService { - 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, @@ -58,6 +64,7 @@ export class HerokuPromoteService extends HerokuBaseService