From da98e5a04b72c4a01c9f525feb17af8e763620bc Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 10:04:54 +0100 Subject: [PATCH 01/16] Update schema.json --- packages/pulumi/src/executors/up/schema.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/up/schema.json b/packages/pulumi/src/executors/up/schema.json index e79194e7..a9dc6e3e 100644 --- a/packages/pulumi/src/executors/up/schema.json +++ b/packages/pulumi/src/executors/up/schema.json @@ -5,5 +5,10 @@ "type": "object", "title": "Apply executor", "description": "Apply", - "properties": {} + "properties": { + "cwd": { + "type": "string", + "description": "The working directory to run Pulumi commands from, if specified." + } + } } From 5cb8123da54bed0359ee844177e92bf80b239cd1 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 10:06:12 +0100 Subject: [PATCH 02/16] Update schema.json --- packages/pulumi/src/executors/preview/schema.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/preview/schema.json b/packages/pulumi/src/executors/preview/schema.json index 7125dc7d..2bed2d55 100644 --- a/packages/pulumi/src/executors/preview/schema.json +++ b/packages/pulumi/src/executors/preview/schema.json @@ -5,5 +5,10 @@ "type": "object", "title": "Preview executor", "description": "Preview", - "properties": {} + "properties": { + "cwd": { + "type": "string", + "description": "The working directory to run Pulumi commands from, if specified." + } + } } From ce3b437d2425b9e4a321527c967db1facafe8a96 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 10:06:26 +0100 Subject: [PATCH 03/16] Update schema.json --- packages/pulumi/src/executors/refresh/schema.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/refresh/schema.json b/packages/pulumi/src/executors/refresh/schema.json index 7777ddce..c41cfeea 100644 --- a/packages/pulumi/src/executors/refresh/schema.json +++ b/packages/pulumi/src/executors/refresh/schema.json @@ -5,5 +5,10 @@ "type": "object", "title": "Refresh executor", "description": "Refresh", - "properties": {} + "properties": { + "cwd": { + "type": "string", + "description": "The working directory to run Pulumi commands from, if specified." + } + } } From ac1e45b0c2ce58555ffd2513c2aeb7620e596be1 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 10:07:22 +0100 Subject: [PATCH 04/16] Update up.impl.ts --- packages/pulumi/src/executors/up/up.impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/up/up.impl.ts b/packages/pulumi/src/executors/up/up.impl.ts index d87b97b6..a184b4d4 100644 --- a/packages/pulumi/src/executors/up/up.impl.ts +++ b/packages/pulumi/src/executors/up/up.impl.ts @@ -9,6 +9,7 @@ export interface UpOptions { yes?: boolean suppressOutputs?: boolean json?: boolean + cwd?: string } export default async function createExecutor( @@ -32,7 +33,7 @@ export default async function createExecutor( options.json && '--json' ]), { - cwd: sourceRoot, + cwd: options.cwd ?? sourceRoot, stdio: 'inherit' } ) From db2b73df586eba77b4ded99d5b858682ffe6f805 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 10:07:43 +0100 Subject: [PATCH 05/16] Update preview.impl.ts --- packages/pulumi/src/executors/preview/preview.impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/preview/preview.impl.ts b/packages/pulumi/src/executors/preview/preview.impl.ts index 81e41a49..2778ba73 100644 --- a/packages/pulumi/src/executors/preview/preview.impl.ts +++ b/packages/pulumi/src/executors/preview/preview.impl.ts @@ -5,6 +5,7 @@ import { which } from 'shelljs' export interface PreviewOptions { stack?: string + cwd?: string } export default async function creatExecutor( @@ -24,7 +25,7 @@ export default async function creatExecutor( options.stack && `--stack=${options.stack}` ]), { - cwd: sourceRoot, + cwd: options.cwd ?? sourceRoot, stdio: 'inherit' } ) From fdf41d77c8d5cfbd1c41b44bf8fdace803af6cb3 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 10:08:06 +0100 Subject: [PATCH 06/16] Update refresh.impl.ts --- packages/pulumi/src/executors/refresh/refresh.impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/refresh/refresh.impl.ts b/packages/pulumi/src/executors/refresh/refresh.impl.ts index d6db7a45..8b1eba9d 100644 --- a/packages/pulumi/src/executors/refresh/refresh.impl.ts +++ b/packages/pulumi/src/executors/refresh/refresh.impl.ts @@ -7,6 +7,7 @@ export interface RefreshOptions { stack?: string, skipPreview?: boolean, yes?: boolean, + cwd?: string, } export default async function createExecutor( @@ -28,7 +29,7 @@ export default async function createExecutor( options.yes && '--yes' ]), { - cwd: sourceRoot, + cwd: options.cwd ?? sourceRoot, stdio: 'inherit' } ) From 718af4cbc60ce59939012527ed79afb04436a3d9 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:31:49 +0100 Subject: [PATCH 07/16] Update schema.json --- packages/pulumi/src/executors/preview/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/preview/schema.json b/packages/pulumi/src/executors/preview/schema.json index 2bed2d55..1c0ed2f3 100644 --- a/packages/pulumi/src/executors/preview/schema.json +++ b/packages/pulumi/src/executors/preview/schema.json @@ -6,7 +6,7 @@ "title": "Preview executor", "description": "Preview", "properties": { - "cwd": { + "root": { "type": "string", "description": "The working directory to run Pulumi commands from, if specified." } From 0926bbc437f6336b5d7b72d92989464d96351c65 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:32:00 +0100 Subject: [PATCH 08/16] Update schema.json --- packages/pulumi/src/executors/refresh/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/refresh/schema.json b/packages/pulumi/src/executors/refresh/schema.json index c41cfeea..5935b0c2 100644 --- a/packages/pulumi/src/executors/refresh/schema.json +++ b/packages/pulumi/src/executors/refresh/schema.json @@ -6,7 +6,7 @@ "title": "Refresh executor", "description": "Refresh", "properties": { - "cwd": { + "root": { "type": "string", "description": "The working directory to run Pulumi commands from, if specified." } From a7ff4ef82c46b70ff0fb075ebe9e8f9722e4cbee Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:32:10 +0100 Subject: [PATCH 09/16] Update schema.json --- packages/pulumi/src/executors/up/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/up/schema.json b/packages/pulumi/src/executors/up/schema.json index a9dc6e3e..24acb526 100644 --- a/packages/pulumi/src/executors/up/schema.json +++ b/packages/pulumi/src/executors/up/schema.json @@ -6,7 +6,7 @@ "title": "Apply executor", "description": "Apply", "properties": { - "cwd": { + "root": { "type": "string", "description": "The working directory to run Pulumi commands from, if specified." } From c9ae7434c76762fc46e59b39e1d8dcd007e3d0de Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:33:31 +0100 Subject: [PATCH 10/16] Update preview.impl.ts --- packages/pulumi/src/executors/preview/preview.impl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pulumi/src/executors/preview/preview.impl.ts b/packages/pulumi/src/executors/preview/preview.impl.ts index 2778ba73..df3a157e 100644 --- a/packages/pulumi/src/executors/preview/preview.impl.ts +++ b/packages/pulumi/src/executors/preview/preview.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nx/devkit' +import { ExecutorContext, workspaceRoot } from '@nx/devkit' import { buildCommand } from '@nx-extend/core' import { execSync } from 'child_process' import { which } from 'shelljs' @@ -25,7 +25,7 @@ export default async function creatExecutor( options.stack && `--stack=${options.stack}` ]), { - cwd: options.cwd ?? sourceRoot, + cwd: join(workspaceRoot, options.root ?? sourceRoot), stdio: 'inherit' } ) From b2dfe99686683f9c87e5636649958d9268783b80 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:33:45 +0100 Subject: [PATCH 11/16] Update preview.impl.ts --- packages/pulumi/src/executors/preview/preview.impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pulumi/src/executors/preview/preview.impl.ts b/packages/pulumi/src/executors/preview/preview.impl.ts index df3a157e..fd37c470 100644 --- a/packages/pulumi/src/executors/preview/preview.impl.ts +++ b/packages/pulumi/src/executors/preview/preview.impl.ts @@ -5,7 +5,7 @@ import { which } from 'shelljs' export interface PreviewOptions { stack?: string - cwd?: string + root?: string } export default async function creatExecutor( From c7b5652da5d4b9e0b3e1821c4364f9f5fbe74e74 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:34:06 +0100 Subject: [PATCH 12/16] Update refresh.impl.ts --- packages/pulumi/src/executors/refresh/refresh.impl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pulumi/src/executors/refresh/refresh.impl.ts b/packages/pulumi/src/executors/refresh/refresh.impl.ts index 8b1eba9d..d0f12c6e 100644 --- a/packages/pulumi/src/executors/refresh/refresh.impl.ts +++ b/packages/pulumi/src/executors/refresh/refresh.impl.ts @@ -1,5 +1,5 @@ import { buildCommand } from '@nx-extend/core' -import { ExecutorContext } from '@nx/devkit' +import { ExecutorContext, workspaceRoot } from '@nx/devkit' import { execSync } from 'child_process' import { which } from 'shelljs' @@ -7,7 +7,7 @@ export interface RefreshOptions { stack?: string, skipPreview?: boolean, yes?: boolean, - cwd?: string, + root?: string, } export default async function createExecutor( @@ -29,7 +29,7 @@ export default async function createExecutor( options.yes && '--yes' ]), { - cwd: options.cwd ?? sourceRoot, + cwd: join(workspaceRoot, options.root ?? sourceRoot), stdio: 'inherit' } ) From 967206efdc22edd20f3b457ca0427e8329eace18 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 11:34:20 +0100 Subject: [PATCH 13/16] Update up.impl.ts --- packages/pulumi/src/executors/up/up.impl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pulumi/src/executors/up/up.impl.ts b/packages/pulumi/src/executors/up/up.impl.ts index a184b4d4..080ea002 100644 --- a/packages/pulumi/src/executors/up/up.impl.ts +++ b/packages/pulumi/src/executors/up/up.impl.ts @@ -1,5 +1,5 @@ import { buildCommand, USE_VERBOSE_LOGGING_MINIMAL } from '@nx-extend/core' -import { ExecutorContext } from '@nx/devkit' +import { ExecutorContext, workspaceRoot } from '@nx/devkit' import { execSync } from 'child_process' import { which } from 'shelljs' @@ -9,7 +9,7 @@ export interface UpOptions { yes?: boolean suppressOutputs?: boolean json?: boolean - cwd?: string + root?: string } export default async function createExecutor( @@ -33,7 +33,7 @@ export default async function createExecutor( options.json && '--json' ]), { - cwd: options.cwd ?? sourceRoot, + cwd: join(workspaceRoot, options.root ?? sourceRoot), stdio: 'inherit' } ) From e6811e22b5b5ece0f129b7162c36e8180a2d1310 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 13:08:29 +0100 Subject: [PATCH 14/16] Update preview.impl.ts --- packages/pulumi/src/executors/preview/preview.impl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/pulumi/src/executors/preview/preview.impl.ts b/packages/pulumi/src/executors/preview/preview.impl.ts index fd37c470..76d78c39 100644 --- a/packages/pulumi/src/executors/preview/preview.impl.ts +++ b/packages/pulumi/src/executors/preview/preview.impl.ts @@ -2,6 +2,7 @@ import { ExecutorContext, workspaceRoot } from '@nx/devkit' import { buildCommand } from '@nx-extend/core' import { execSync } from 'child_process' import { which } from 'shelljs' +import { join } from 'path' export interface PreviewOptions { stack?: string From 7f056adb58ba33fdd1ccc8fbe079d894d7d4fd48 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 13:08:39 +0100 Subject: [PATCH 15/16] Update refresh.impl.ts --- packages/pulumi/src/executors/refresh/refresh.impl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/pulumi/src/executors/refresh/refresh.impl.ts b/packages/pulumi/src/executors/refresh/refresh.impl.ts index d0f12c6e..b5a90653 100644 --- a/packages/pulumi/src/executors/refresh/refresh.impl.ts +++ b/packages/pulumi/src/executors/refresh/refresh.impl.ts @@ -2,6 +2,7 @@ import { buildCommand } from '@nx-extend/core' import { ExecutorContext, workspaceRoot } from '@nx/devkit' import { execSync } from 'child_process' import { which } from 'shelljs' +import { join } from 'path' export interface RefreshOptions { stack?: string, From 5f1d1007c1f2824a7e652ca9b0a76e7078f12fd3 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Thu, 7 Dec 2023 13:09:06 +0100 Subject: [PATCH 16/16] Update up.impl.ts --- packages/pulumi/src/executors/up/up.impl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/pulumi/src/executors/up/up.impl.ts b/packages/pulumi/src/executors/up/up.impl.ts index 080ea002..cf4e82c9 100644 --- a/packages/pulumi/src/executors/up/up.impl.ts +++ b/packages/pulumi/src/executors/up/up.impl.ts @@ -2,6 +2,7 @@ import { buildCommand, USE_VERBOSE_LOGGING_MINIMAL } from '@nx-extend/core' import { ExecutorContext, workspaceRoot } from '@nx/devkit' import { execSync } from 'child_process' import { which } from 'shelljs' +import { join } from 'path' export interface UpOptions { stack?: string,