diff --git a/packages/gcp-cloud-run/src/executors/deploy/deploy.impl.ts b/packages/gcp-cloud-run/src/executors/deploy/deploy.impl.ts index 85da6341..f4781cd7 100644 --- a/packages/gcp-cloud-run/src/executors/deploy/deploy.impl.ts +++ b/packages/gcp-cloud-run/src/executors/deploy/deploy.impl.ts @@ -43,7 +43,8 @@ export function deployExecutor( timeout = null, cpu, - cpuBoost + cpuBoost, + ingress } = options const distDirectory = join(context.root, outputDirectory) @@ -112,6 +113,14 @@ export function deployExecutor( }) .filter(Boolean) + const ingressOpts = ["all", "internal", "internal-and-cloud-load-balancing"]; + const validIngress = (typeof ingress === "string") && ingressOpts.includes(ingress); + if (!validIngress) { + logger.warn( + `"${ingress}" is not a valid ingress option! Only the following few options are supported: ${ingressOpts}` + ) + } + if (generateRepoInfoFile) { logger.info('Generating repo info file') @@ -155,7 +164,9 @@ export function deployExecutor( typeof cpuBoost === 'boolean' && !cpuBoost && '--no-cpu-boost', // There can be a question if a repo should be created - buildWithArtifactRegistry && autoCreateArtifactsRepo && '--quiet' + buildWithArtifactRegistry && autoCreateArtifactsRepo && '--quiet', + + validIngress && `--ingress=${ingress}` ]) return Promise.resolve( diff --git a/packages/gcp-cloud-run/src/executors/schema.d.ts b/packages/gcp-cloud-run/src/executors/schema.d.ts index 76449d8b..c2075cd0 100644 --- a/packages/gcp-cloud-run/src/executors/schema.d.ts +++ b/packages/gcp-cloud-run/src/executors/schema.d.ts @@ -27,4 +27,5 @@ export interface ExecutorSchema { timeout?: number cpu?: number cpuBoost?: boolean + ingress?: string }