Skip to content

Commit

Permalink
Improvements v2 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs authored Dec 10, 2023
2 parents 3b1d926 + a5b189e commit d4a333a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
8 changes: 1 addition & 7 deletions packages/gcp-cloud-run/src/executors/deploy/deploy.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,8 @@ export async function deployExecutor(
]))
}

let gcloudCommand = 'gcloud'
if (validSecrets.length > 0) {
logger.info('Using secrets, use gcloud beta')
gcloudCommand = 'gcloud beta'
}

const deployCommand = buildCommand([
`${gcloudCommand} run deploy ${name}`,
`gcloud run deploy ${name}`,
!buildWithArtifactRegistry && `--image=${containerName}`,
buildWithArtifactRegistry && '--source=./',
`--project=${project}`,
Expand Down
12 changes: 3 additions & 9 deletions packages/gcp-functions/src/executors/deploy/deploy.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function deployExecutor(
concurrency = 1,
cloudSqlInstance = null,
timeout = null,
cpu,
cpu
} = options

let runtime = options.runtime || 'nodejs20'
Expand Down Expand Up @@ -103,15 +103,9 @@ export async function deployExecutor(
})
.filter(Boolean)

let gcloudCommand = 'gcloud'
if (validSecrets.length > 0) {
logger.info('Using secrets, use gcloud beta')
gcloudCommand = 'gcloud beta'
}

let { success } = execCommand(
buildCommand([
`${gcloudCommand} functions deploy`,
`gcloud functions deploy`,
functionName,
gen === 2 && '--gen2',
`--trigger-${trigger}${triggerValue ? `=${triggerValue}` : ''}`,
Expand Down Expand Up @@ -156,7 +150,7 @@ export async function deployExecutor(

const serviceUpdateCommand = execCommand(
buildCommand([
`${gcloudCommand} run services update`,
'gcloud run services update',
functionName,

concurrency > 0 && `--concurrency ${concurrency}`,
Expand Down

0 comments on commit d4a333a

Please sign in to comment.