@catladder/pipeline 0.0.0-refactor-untangle-gitlab-api-requests-from-vorpal-57cf3cf2 → 0.0.0-reference-database-url-1befbbee
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/artifacts/createBuildJobArtifact.js +1 -1
- package/dist/build/base/index.d.ts +2 -3
- package/dist/build/cache/getAllCacheConfigsFromConfig.js +2 -2
- package/dist/build/custom/buildJob.d.ts +2 -2
- package/dist/build/custom/index.d.ts +2 -2
- package/dist/build/custom/testJob.d.ts +2 -2
- package/dist/build/docker.d.ts +4 -4
- package/dist/build/docker.js +1 -1
- package/dist/build/index.d.ts +2 -2
- package/dist/build/index.js +2 -3
- package/dist/build/node/buildJob.d.ts +5 -3
- package/dist/build/node/index.d.ts +4 -4
- package/dist/build/node/meteor.d.ts +2 -2
- package/dist/build/node/yarn.d.ts +1 -1
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/rails/build.d.ts +2 -2
- package/dist/build/rails/build.js +1 -1
- package/dist/build/rails/index.d.ts +2 -2
- package/dist/build/rails/test.js +13 -2
- package/dist/build/sbom.d.ts +2 -2
- package/dist/build/sbom.js +4 -1
- package/dist/build/types.d.ts +8 -0
- package/dist/constants.js +1 -1
- package/dist/context/createComponentContext.js +11 -4
- package/dist/context/getLabels.js +1 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +2 -2
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +34 -12
- package/dist/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +2 -3
- package/dist/deploy/cloudRun/createJobs/execute/onDeploy.js +4 -9
- package/dist/deploy/cloudRun/createJobs/healthCheck.d.ts +5 -0
- package/dist/deploy/cloudRun/createJobs/healthCheck.js +82 -0
- package/dist/deploy/cloudRun/index.js +7 -5
- package/dist/deploy/cloudRun/utils/database.d.ts +21 -2
- package/dist/deploy/cloudRun/utils/database.js +27 -6
- package/dist/deploy/cloudRun/utils/getJobOrServiceArgs.d.ts +2 -0
- package/dist/deploy/cloudRun/utils/getJobOrServiceArgs.js +12 -0
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeValues.js +1 -1
- package/dist/deploy/sbom.js +1 -1
- package/dist/deploy/types/googleCloudRun.d.ts +100 -0
- package/dist/deploy/types/googleCloudRun.js +25 -0
- package/dist/pipeline/createJobsForComponent.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/context.d.ts +6 -1
- package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +1394 -0
- package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +1394 -0
- package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +1394 -0
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-llama.test.ts.snap +624 -0
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +24 -12
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +1394 -0
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +4515 -0
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +40 -16
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +20 -8
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +20 -8
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +20 -8
- package/examples/__snapshots__/custom-build-job.test.ts.snap +20 -8
- package/examples/__snapshots__/custom-deploy.test.ts.snap +20 -8
- package/examples/__snapshots__/custom-envs.test.ts.snap +24 -6
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +4 -4
- package/examples/__snapshots__/custom-verify-job.test.ts.snap +20 -8
- package/examples/__snapshots__/git-submodule.test.ts.snap +20 -8
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +20 -8
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +20 -8
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +40 -16
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +20 -8
- package/examples/__snapshots__/local-dot-env.test.ts.snap +20 -8
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +20 -8
- package/examples/__snapshots__/multiline-var.test.ts.snap +60 -24
- package/examples/__snapshots__/native-app.test.ts.snap +36 -12
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +20 -8
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +20 -8
- package/examples/__snapshots__/override-secrets.test.ts.snap +20 -8
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +30 -17
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +38 -29
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +60 -24
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +32 -8
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +40 -16
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +40 -16
- package/examples/cloud-run-health-check-defaults.test.ts +11 -0
- package/examples/cloud-run-health-check-defaults.ts +28 -0
- package/examples/cloud-run-health-check-only-startup.test.ts +11 -0
- package/examples/cloud-run-health-check-only-startup.ts +38 -0
- package/examples/cloud-run-health-check.test.ts +11 -0
- package/examples/cloud-run-health-check.ts +45 -0
- package/examples/cloud-run-http2.ts +2 -2
- package/examples/cloud-run-llama.test.ts +11 -0
- package/examples/cloud-run-llama.ts +40 -0
- package/examples/cloud-run-memory-limit.ts +2 -2
- package/examples/cloud-run-meteor-with-worker.ts +7 -3
- package/examples/cloud-run-nextjs.ts +2 -2
- package/examples/cloud-run-no-cpu-throttling.ts +2 -2
- package/examples/cloud-run-no-service.ts +2 -2
- package/examples/cloud-run-non-public.ts +2 -2
- package/examples/cloud-run-post-stop-job.ts +2 -2
- package/examples/cloud-run-service-custom-vpc-connector.ts +2 -2
- package/examples/cloud-run-service-custom-vpc.ts +2 -2
- package/examples/cloud-run-service-gen2.ts +2 -2
- package/examples/cloud-run-service-increase-timout.ts +2 -2
- package/examples/cloud-run-service-with-volumes.ts +2 -2
- package/examples/cloud-run-storybook.ts +2 -2
- package/examples/cloud-run-with-gpu.test.ts +11 -0
- package/examples/cloud-run-with-gpu.ts +30 -0
- package/examples/cloud-run-with-ngnix.ts +2 -2
- package/examples/cloud-run-with-sql-legacy-jobs.ts +2 -2
- package/examples/cloud-run-with-sql-multiple-dbs.test.ts +11 -0
- package/examples/cloud-run-with-sql-multiple-dbs.ts +87 -0
- package/examples/cloud-run-with-sql-reuse-db.ts +2 -2
- package/examples/cloud-run-with-sql.ts +2 -2
- package/examples/cloud-run-with-worker.ts +2 -2
- package/examples/custom-build-job-with-tests.ts +2 -2
- package/examples/custom-build-job.ts +2 -2
- package/examples/custom-deploy.ts +2 -2
- package/examples/custom-envs.ts +2 -2
- package/examples/custom-sbom-java.ts +2 -2
- package/examples/custom-verify-job.ts +2 -2
- package/examples/git-submodule.ts +2 -2
- package/examples/kubernetes-application-customization.ts +2 -2
- package/examples/kubernetes-with-cloud-sql.ts +2 -2
- package/examples/kubernetes-with-jobs.ts +2 -2
- package/examples/kubernetes-with-mongodb.ts +2 -2
- package/examples/local-dot-env.ts +2 -2
- package/examples/meteor-kubernetes.ts +2 -2
- package/examples/multiline-var.ts +2 -2
- package/examples/native-app.ts +2 -2
- package/examples/node-build-with-custom-image.ts +2 -2
- package/examples/node-build-with-docker-additions.ts +2 -2
- package/examples/override-secrets.ts +2 -2
- package/examples/rails-k8s-with-worker.ts +2 -2
- package/examples/referencing-other-vars.ts +2 -2
- package/examples/wait-for-other-deploy.ts +1 -1
- package/examples/workspace-api-www-turbo-cache.ts +2 -2
- package/examples/workspace-api-www.ts +2 -2
- package/package.json +1 -1
- package/src/build/artifacts/createBuildJobArtifact.ts +3 -1
- package/src/build/base/index.ts +5 -2
- package/src/build/cache/getAllCacheConfigsFromConfig.ts +7 -6
- package/src/build/custom/buildJob.ts +2 -2
- package/src/build/custom/index.ts +4 -2
- package/src/build/custom/testJob.ts +2 -2
- package/src/build/docker.ts +9 -5
- package/src/build/index.ts +7 -5
- package/src/build/node/buildJob.ts +5 -2
- package/src/build/node/index.ts +9 -4
- package/src/build/node/meteor.ts +5 -2
- package/src/build/node/yarn.ts +4 -2
- package/src/build/rails/build.ts +3 -8
- package/src/build/rails/index.ts +4 -2
- package/src/build/rails/test.ts +19 -0
- package/src/build/sbom.ts +8 -3
- package/src/build/types.ts +8 -0
- package/src/context/createComponentContext.ts +22 -9
- package/src/context/getLabels.ts +4 -1
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +2 -2
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +30 -3
- package/src/deploy/cloudRun/createJobs/execute/onDeploy.ts +3 -13
- package/src/deploy/cloudRun/createJobs/healthCheck.ts +64 -0
- package/src/deploy/cloudRun/index.ts +14 -5
- package/src/deploy/cloudRun/utils/database.ts +93 -8
- package/src/deploy/cloudRun/utils/getJobOrServiceArgs.ts +18 -0
- package/src/deploy/kubernetes/kubeValues.ts +13 -4
- package/src/deploy/sbom.ts +4 -3
- package/src/deploy/types/googleCloudRun.ts +135 -0
- package/src/pipeline/createJobsForComponent.ts +10 -2
- package/src/types/config.ts +1 -1
- package/src/types/context.ts +10 -1
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { type StringOrBashExpression } from "../../../bash";
|
|
1
2
|
import type { ComponentContext } from "../../../types";
|
|
2
3
|
import type { DeployConfigCloudRun, DeployConfigCloudRunCloudSql } from "../../types";
|
|
3
4
|
export declare const getDatabaseDeleteScript: (context: ComponentContext, deployConfig: DeployConfigCloudRun) => string[];
|
|
4
5
|
export declare const getDatabaseCreateScript: (context: ComponentContext, deployConfig: DeployConfigCloudRun) => string[];
|
|
5
|
-
export
|
|
6
|
-
|
|
6
|
+
export type DBVariables = {
|
|
7
|
+
CLOUD_SQL_INSTANCE_CONNECTION_NAME: StringOrBashExpression;
|
|
8
|
+
DB_NAME: StringOrBashExpression;
|
|
9
|
+
DB_USER: StringOrBashExpression;
|
|
10
|
+
DB_PASSWORD: StringOrBashExpression;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* controls how variables in the connection string are handled
|
|
14
|
+
*
|
|
15
|
+
* - legacy: variables like $DB_USER will be kept as environment variables to be replaced at runtime (default). It is not using BashExpressions as this was not the case in the past.
|
|
16
|
+
* - embedded: variables will be replaced with their actual values in the connection string
|
|
17
|
+
*
|
|
18
|
+
* We will remove the legacy mode in the future, as it is confusing. But its unclear whether its a breaking change in some edge cases
|
|
19
|
+
*/
|
|
20
|
+
export type DBVariablesMode = "legacy" | "embedded";
|
|
21
|
+
export declare const DEFAULT_DB_VARIABLES_MODE: DBVariablesMode;
|
|
22
|
+
export declare const getDatabaseJdbcUrl: (variables: DBVariables, mode: DBVariablesMode) => StringOrBashExpression;
|
|
23
|
+
export declare const getRailsDatabaseConnectionString: (variables: DBVariables, mode: DBVariablesMode) => StringOrBashExpression;
|
|
24
|
+
export declare const getPrismaDatabaseConnectionString: (variables: DBVariables, mode: DBVariablesMode) => StringOrBashExpression;
|
|
25
|
+
export declare const getDatabaseConnectionString: (config: DeployConfigCloudRunCloudSql, variables: DBVariables) => StringOrBashExpression;
|
|
@@ -25,7 +25,8 @@ var __read = this && this.__read || function (o, n) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", {
|
|
26
26
|
value: true
|
|
27
27
|
});
|
|
28
|
-
exports.getDatabaseConnectionString = exports.
|
|
28
|
+
exports.getDatabaseConnectionString = exports.getPrismaDatabaseConnectionString = exports.getRailsDatabaseConnectionString = exports.getDatabaseJdbcUrl = exports.DEFAULT_DB_VARIABLES_MODE = exports.getDatabaseCreateScript = exports.getDatabaseDeleteScript = void 0;
|
|
29
|
+
var bash_1 = require("../../../bash");
|
|
29
30
|
var gitlab_1 = require("../../../utils/gitlab");
|
|
30
31
|
var getDatabaseDeleteScript = function (context, deployConfig) {
|
|
31
32
|
if (!deployConfig.cloudSql || !deployConfig.cloudSql.deleteDatabaseOnStop) {
|
|
@@ -62,16 +63,36 @@ var getDatabaseCreateScript = function (context, deployConfig) {
|
|
|
62
63
|
return (0, gitlab_1.allowFailureInScripts)(["echo \"ensuring Database...\"", "gcloud sql databases create ".concat(DB_NAME, " --instance=").concat(instanceId, " --project ").concat(projectId)]);
|
|
63
64
|
};
|
|
64
65
|
exports.getDatabaseCreateScript = getDatabaseCreateScript;
|
|
65
|
-
exports.
|
|
66
|
-
var
|
|
66
|
+
exports.DEFAULT_DB_VARIABLES_MODE = "legacy";
|
|
67
|
+
var getVariableOrValue = function (key, variables, mode) {
|
|
68
|
+
return mode === "legacy" ? "$".concat(key) : variables[key];
|
|
69
|
+
};
|
|
70
|
+
var getDatabaseJdbcUrl = function (variables, mode) {
|
|
71
|
+
var parts = ["jdbc:postgresql:///", getVariableOrValue("DB_NAME", variables, mode), "?cloudSqlInstance=", getVariableOrValue("CLOUD_SQL_INSTANCE_CONNECTION_NAME", variables, mode), "&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=", getVariableOrValue("DB_USER", variables, mode), "&password=", getVariableOrValue("DB_PASSWORD", variables, mode)];
|
|
72
|
+
return (0, bash_1.joinBashExpressions)(parts);
|
|
73
|
+
};
|
|
74
|
+
exports.getDatabaseJdbcUrl = getDatabaseJdbcUrl;
|
|
75
|
+
var getRailsDatabaseConnectionString = function (variables, mode) {
|
|
76
|
+
var parts = ["postgresql://", getVariableOrValue("DB_USER", variables, mode), ":", getVariableOrValue("DB_PASSWORD", variables, mode), "@", encodeURIComponent("/cloudsql/".concat(variables.CLOUD_SQL_INSTANCE_CONNECTION_NAME)), "/", getVariableOrValue("DB_NAME", variables, mode), "?"];
|
|
77
|
+
return (0, bash_1.joinBashExpressions)(parts);
|
|
78
|
+
};
|
|
79
|
+
exports.getRailsDatabaseConnectionString = getRailsDatabaseConnectionString;
|
|
80
|
+
var getPrismaDatabaseConnectionString = function (variables, mode) {
|
|
81
|
+
var parts = ["postgresql://", getVariableOrValue("DB_USER", variables, mode), ":", getVariableOrValue("DB_PASSWORD", variables, mode), "@localhost/", getVariableOrValue("DB_NAME", variables, mode), "?host=/cloudsql/", getVariableOrValue("CLOUD_SQL_INSTANCE_CONNECTION_NAME", variables, mode)];
|
|
82
|
+
return (0, bash_1.joinBashExpressions)(parts);
|
|
83
|
+
};
|
|
84
|
+
exports.getPrismaDatabaseConnectionString = getPrismaDatabaseConnectionString;
|
|
85
|
+
var getDatabaseConnectionString = function (config, variables) {
|
|
86
|
+
var _a;
|
|
87
|
+
var mode = (_a = config.dbConnectionStringVariablesMode) !== null && _a !== void 0 ? _a : exports.DEFAULT_DB_VARIABLES_MODE;
|
|
67
88
|
switch (config.dbConnectionStringFormat) {
|
|
68
89
|
case "jdbc":
|
|
69
|
-
return exports.
|
|
90
|
+
return (0, exports.getDatabaseJdbcUrl)(variables, mode);
|
|
70
91
|
case "rails":
|
|
71
|
-
return
|
|
92
|
+
return (0, exports.getRailsDatabaseConnectionString)(variables, mode);
|
|
72
93
|
default:
|
|
73
94
|
// prisma
|
|
74
|
-
return
|
|
95
|
+
return (0, exports.getPrismaDatabaseConnectionString)(variables, mode);
|
|
75
96
|
}
|
|
76
97
|
};
|
|
77
98
|
exports.getDatabaseConnectionString = getDatabaseConnectionString;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { DeployConfigCloudRunExecuteOnDeploy, DeployConfigCloudRunJob, DeployConfigCloudRunService } from "../../types";
|
|
2
|
+
export declare const getCloudRunServiceOrJobArgsArg: (args: DeployConfigCloudRunExecuteOnDeploy["args"] | DeployConfigCloudRunJob["args"] | DeployConfigCloudRunService["args"]) => string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCloudRunServiceOrJobArgsArg = void 0;
|
|
7
|
+
var getCloudRunServiceOrJobArgsArg = function (args) {
|
|
8
|
+
return args !== undefined ? args.length > 0 ? args === null || args === void 0 ? void 0 : args.map(function (arg) {
|
|
9
|
+
return "\"".concat(arg, "\"");
|
|
10
|
+
}).join(",") : "" : undefined;
|
|
11
|
+
};
|
|
12
|
+
exports.getCloudRunServiceOrJobArgsArg = getCloudRunServiceOrJobArgsArg;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentContext } from "../../types/context";
|
|
2
|
-
export declare const createKubeValues: (context: ComponentContext) => never[] | ({
|
|
1
|
+
import type { BuildContextComponent, ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const createKubeValues: (context: ComponentContext<BuildContextComponent>) => never[] | ({
|
|
3
3
|
env: {
|
|
4
4
|
secret: Record<string, import("../..").VariableValue>;
|
|
5
5
|
public: Record<string, import("../..").VariableValue>;
|
|
@@ -62,7 +62,7 @@ var createAppConfig = function (context, application) {
|
|
|
62
62
|
rest = __rest(_a, ["healthRoute", "command"]);
|
|
63
63
|
return (0, utils_1.mergeWithMergingArrays)({
|
|
64
64
|
host: context.environment.envVars.HOSTNAME,
|
|
65
|
-
command: command !== null && command !== void 0 ? command : context.build.config.startCommand,
|
|
65
|
+
command: command !== null && command !== void 0 ? command : context.build.type !== "disabled" ? context.build.config.startCommand : undefined,
|
|
66
66
|
livenessProbe: {
|
|
67
67
|
httpGet: {
|
|
68
68
|
path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
|
package/dist/deploy/sbom.js
CHANGED
|
@@ -8,7 +8,7 @@ var BashExpression_1 = require("../bash/BashExpression");
|
|
|
8
8
|
var sbom_1 = require("../build/sbom");
|
|
9
9
|
var context_1 = require("../types/context");
|
|
10
10
|
var sbomDeactivated = function (context) {
|
|
11
|
-
return (0, context_1.componentContextIsStandaloneBuild)(context) && context.build.config.type === "custom" && context.build.config.sbom === false;
|
|
11
|
+
return context.build.type === "disabled" || (0, context_1.componentContextIsStandaloneBuild)(context) && context.build.config.type === "custom" && context.build.config.sbom === false;
|
|
12
12
|
};
|
|
13
13
|
exports.sbomDeactivated = sbomDeactivated;
|
|
14
14
|
var getDependencyTrackUploadScript = function (context) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DBVariablesMode } from "../cloudRun/utils/database";
|
|
1
2
|
import type { DeployConfigBase } from "./base";
|
|
2
3
|
export type Gcloudregion = "asia-east1" | "asia-northeast1" | "asia-northeast2" | "europe-north1" | "europe-southwest1" | "europe-west1" | "europe-west4" | "europe-west8" | "europe-west9" | "me-west1" | "us-central1" | "us-east1" | "us-east4" | "us-east5" | "us-south1" | "us-west1" | "asia-east2" | "asia-northeast3" | "asia-southeast1" | "asia-southeast2" | "asia-south1" | "asia-south2" | "australia-southeast1" | "australia-southeast2" | "europe-central2" | "europe-west2" | "europe-west3" | "europe-west6" | "northamerica-northeast1" | "northamerica-northeast2" | "southamerica-east1" | "southamerica-west1" | "us-west2" | "us-west3" | "us-west4";
|
|
3
4
|
export type DeployConfigCloudRunCloudSql = {
|
|
@@ -36,6 +37,15 @@ export type DeployConfigCloudRunCloudSql = {
|
|
|
36
37
|
* defaults to prisma
|
|
37
38
|
*/
|
|
38
39
|
dbConnectionStringFormat?: "prisma" | "rails" | "jdbc";
|
|
40
|
+
/**
|
|
41
|
+
* controls how variables in the connection string are handled
|
|
42
|
+
*
|
|
43
|
+
* - environment: variables like $DB_USER will be kept as environment variables to be replaced at runtime (default)
|
|
44
|
+
* - embedded: variables will be replaced with their actual values in the connection string
|
|
45
|
+
*
|
|
46
|
+
* @default "environment"
|
|
47
|
+
*/
|
|
48
|
+
dbConnectionStringVariablesMode?: DBVariablesMode;
|
|
39
49
|
/**
|
|
40
50
|
* add additional query params to the database connection string
|
|
41
51
|
*/
|
|
@@ -116,7 +126,97 @@ export type DeployConfigCloudRunService = {
|
|
|
116
126
|
*
|
|
117
127
|
*/
|
|
118
128
|
http2?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Number of GPUs to use. Defaults to 0
|
|
131
|
+
*
|
|
132
|
+
* This is a preview feature and not all regions support it.
|
|
133
|
+
*/
|
|
134
|
+
gpu?: number;
|
|
135
|
+
/**
|
|
136
|
+
* gpu type to use. Refer to https://cloud.google.com/run/docs/configuring/services/gpu#gcloud for defaults
|
|
137
|
+
*/
|
|
138
|
+
gpuType?: string;
|
|
139
|
+
/**
|
|
140
|
+
* the image to use. Defaults to the image from the build.
|
|
141
|
+
*
|
|
142
|
+
* If you specify an image, you usually want to disable the build by setting build: false
|
|
143
|
+
*/
|
|
144
|
+
image?: string;
|
|
145
|
+
/**
|
|
146
|
+
* args to pass to the command
|
|
147
|
+
*/
|
|
148
|
+
args?: string[];
|
|
149
|
+
/**
|
|
150
|
+
* Configuration of the health check.
|
|
151
|
+
*
|
|
152
|
+
* When set to `true`, startup and liveness probes will be
|
|
153
|
+
* configured to `defaultStartupProbe` and `defaultLivenessProbe`.
|
|
154
|
+
*
|
|
155
|
+
* When not set, default Cloud Run's health check
|
|
156
|
+
* configuration is used (startup TCP probe and no liveness probe).
|
|
157
|
+
*/
|
|
158
|
+
healthCheck?: true | {
|
|
159
|
+
/**
|
|
160
|
+
* Startup probe configuration.
|
|
161
|
+
*/
|
|
162
|
+
startupProbe: DeployConfigCloudRunProbe;
|
|
163
|
+
/**
|
|
164
|
+
* Liveness probe configuration.
|
|
165
|
+
* `false` disables the liveness probe.
|
|
166
|
+
*/
|
|
167
|
+
livenessProbe: false | DeployConfigCloudRunProbe;
|
|
168
|
+
};
|
|
119
169
|
} & DeployConfigCloudRunWithVolumes & DeployConfigCloudRunNetworkConfig;
|
|
170
|
+
export declare const defaultStartupProbe: DeployConfigCloudRunProbe;
|
|
171
|
+
export declare const defaultLivenessProbe: DeployConfigCloudRunProbe;
|
|
172
|
+
export type DeployConfigCloudRunProbe = DeployConfigCloudRunHttp1Probe | DeployConfigCloudRunTcpProbe;
|
|
173
|
+
export type DeployConfigCloudRunProbeShared = {
|
|
174
|
+
/**
|
|
175
|
+
* The period in seconds at which to perform the probe.
|
|
176
|
+
* For example 2 to perform the probe every 2 seconds.
|
|
177
|
+
* Specify a value **from 1 second to 240** seconds.
|
|
178
|
+
*/
|
|
179
|
+
periodSeconds: number;
|
|
180
|
+
/**
|
|
181
|
+
* The number of seconds to wait after the container has started before performing the first probe.
|
|
182
|
+
* Specify a value **from 0 seconds to 240** seconds.
|
|
183
|
+
*/
|
|
184
|
+
initialDelaySeconds: number;
|
|
185
|
+
/**
|
|
186
|
+
* The number of seconds to wait until the probe times out.
|
|
187
|
+
* This value cannot exceed the value specified for `period`.
|
|
188
|
+
* Specify a value **from 1 to 240**.
|
|
189
|
+
*/
|
|
190
|
+
timeoutSeconds: number;
|
|
191
|
+
/**
|
|
192
|
+
* The number of times to retry the probe before shutting down the container.
|
|
193
|
+
*/
|
|
194
|
+
failureThreshold: number;
|
|
195
|
+
};
|
|
196
|
+
export type DeployConfigCloudRunTcpProbe = DeployConfigCloudRunProbeShared & {
|
|
197
|
+
/**
|
|
198
|
+
* Cloud Run makes a TCP connection to open the TCP Socket on the specified port.
|
|
199
|
+
* If Cloud Run is unable to establish a connection, it indicates a failure.
|
|
200
|
+
*/
|
|
201
|
+
type: "tcp";
|
|
202
|
+
};
|
|
203
|
+
export type DeployConfigCloudRunHttp1Probe = DeployConfigCloudRunProbeShared & {
|
|
204
|
+
/**
|
|
205
|
+
* **This will NOT work with http2 enabled services**
|
|
206
|
+
*
|
|
207
|
+
* Cloud Run makes an HTTP GET request to the service health check endpoint (for example, /ready).
|
|
208
|
+
* Any response between 200 and 400 is a success, everything else indicates failure.
|
|
209
|
+
*
|
|
210
|
+
* If a startup probe does not succeed within the specified time (failureThreshold * period), which cannot exceed 240 seconds, the container is shut down.
|
|
211
|
+
*
|
|
212
|
+
* If the HTTP startup probe succeeds within the specified time, and you have enabled liveness probe, the HTTP liveness probe is started.
|
|
213
|
+
*/
|
|
214
|
+
type: "http1";
|
|
215
|
+
/**
|
|
216
|
+
* the route path to check for health status of the service starting with a `/`.
|
|
217
|
+
*/
|
|
218
|
+
path: string;
|
|
219
|
+
};
|
|
120
220
|
export type DeployConfigCloudRunNetworkConfig = {
|
|
121
221
|
network?: string;
|
|
122
222
|
/**
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __assign = this && this.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
3
13
|
Object.defineProperty(exports, "__esModule", {
|
|
4
14
|
value: true
|
|
15
|
+
});
|
|
16
|
+
exports.defaultLivenessProbe = exports.defaultStartupProbe = void 0;
|
|
17
|
+
exports.defaultStartupProbe = {
|
|
18
|
+
type: "http1",
|
|
19
|
+
path: "/__health",
|
|
20
|
+
initialDelaySeconds: 5,
|
|
21
|
+
timeoutSeconds: 1,
|
|
22
|
+
periodSeconds: 30,
|
|
23
|
+
failureThreshold: 3
|
|
24
|
+
};
|
|
25
|
+
exports.defaultLivenessProbe = __assign(__assign({}, exports.defaultStartupProbe), {
|
|
26
|
+
initialDelaySeconds: 0,
|
|
27
|
+
timeoutSeconds: 10,
|
|
28
|
+
periodSeconds: 30,
|
|
29
|
+
failureThreshold: 3
|
|
5
30
|
});
|
|
@@ -73,7 +73,7 @@ var getCustomJobs = function (context) {
|
|
|
73
73
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
74
74
|
};
|
|
75
75
|
var createJobsForComponentContext = function (context) {
|
|
76
|
-
var buildJobs = build_1.BUILD_TYPES[context.build.buildType].jobs(context);
|
|
76
|
+
var buildJobs = context.build.type !== "disabled" ? build_1.BUILD_TYPES[context.build.buildType].jobs(context) : [];
|
|
77
77
|
var deployJobs = context.componentConfig.deploy !== false ? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context) : [];
|
|
78
78
|
var customJobs = getCustomJobs(context);
|
|
79
79
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|