From 8e28d4002edad8bc8aa6ff9d66104baaa3d6d3fc Mon Sep 17 00:00:00 2001 From: Adam Malone Date: Thu, 20 Feb 2025 21:45:58 -0800 Subject: [PATCH] [no-op] Hotfix to the deploy script and github actions logic --- .github/workflows/ddn-test.yaml | 2 ++ scripts/deploy/deploy.mjs | 34 ++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ddn-test.yaml b/.github/workflows/ddn-test.yaml index 0ba69a8..80c20ab 100644 --- a/.github/workflows/ddn-test.yaml +++ b/.github/workflows/ddn-test.yaml @@ -76,6 +76,7 @@ jobs: --profile telco \ --override-description "${calculatedSha} [PR-${{ github.event.pull_request.number }}] ${{ github.event.pull_request.title }} | Build for commit ${{ github.event.pull_request.head.sha }}" \ --rebuild-connectors \ + --gcp-region gcp-us-west2 \ --override \ --log-level FATAL \ --quiet \ @@ -86,6 +87,7 @@ jobs: --context axiom-dev \ --profile telco \ --override-description "${calculatedSha} [PR-${{ github.event.pull_request.number }}] ${{ github.event.pull_request.title }} | Build for commit ${{ github.event.pull_request.head.sha }}" \ + --gcp-region gcp-us-west2 \ --override \ --log-level FATAL \ --quiet \ diff --git a/scripts/deploy/deploy.mjs b/scripts/deploy/deploy.mjs index 410f99e..3f67857 100755 --- a/scripts/deploy/deploy.mjs +++ b/scripts/deploy/deploy.mjs @@ -28,8 +28,8 @@ class DeploymentManager { .option('-g, --gcp-region ', 'GCP region', null) .option('-c, --context ', 'Deploy context', null) .option('-p, --profile ', 'Config profile', null) - .option('-r, --rebuild-connectors', 'Rebuild connectors', null) - .option('-f, --full-metadata-build', 'Full metadata rebuild', null) + .option('-r, --rebuild-connectors', 'Rebuild connectors', false) + .option('-f, --full-metadata-build', 'Full metadata rebuild', false) .option('-x, --override-description ', 'Override description') .option('-q, --quiet', 'Quiet mode') .option('-a, --apply-build', 'Auto-apply build', false) @@ -42,6 +42,8 @@ class DeploymentManager { noauth: join(__dirname, 'noauth.hml') }; this.options = this.program.opts(); + // This line is counter-intuitive but required. + this.options.noInteraction = !this.options.interaction; } log(level, msg) { @@ -146,17 +148,23 @@ class DeploymentManager { choices: CONFIG.regions }])).gcpRegion, - fullMetadataBuild: this.options.fullMetadataBuild ?? (this.options.noInteraction ? false : - (await inquirer.prompt([{ - type: 'confirm', name: 'fullMetadataBuild', - message: 'Perform full metadata rebuild?', default: false - }])).fullMetadataBuild), - - rebuildConnectors: this.options.rebuildConnectors ?? (this.options.noInteraction ? false : - (await inquirer.prompt([{ - type: 'confirm', name: 'rebuildConnectors', - message: 'Rebuild all connectors?', default: false - }])).rebuildConnectors) + fullMetadataBuild: this.options.fullMetadataBuild || + (!this.options.noInteraction && + (await inquirer.prompt([{ + type: 'confirm', + name: 'fullMetadataBuild', + message: 'Perform full metadata rebuild?', + default: false + }])).fullMetadataBuild) || false, + + rebuildConnectors: this.options.rebuildConnectors || + (!this.options.noInteraction && + (await inquirer.prompt([{ + type: 'confirm', + name: 'rebuildConnectors', + message: 'Rebuild all connectors?', + default: false + }])).rebuildConnectors) || false }; this.log(