@catladder/pipeline 2.9.2 → 2.10.0
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/constants.js +1 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +5 -3
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +17 -101
- package/dist/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +4 -0
- package/dist/deploy/cloudRun/createJobs/execute/onDeploy.js +120 -0
- package/dist/deploy/cloudRun/createJobs/execute/schedules.d.ts +3 -0
- package/dist/deploy/cloudRun/createJobs/execute/schedules.js +173 -0
- package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +4 -2
- package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +4 -2
- package/dist/deploy/cloudRun/index.js +6 -2
- package/dist/deploy/cloudRun/utils/cloudRunExecutionUrl.d.ts +10 -0
- package/dist/deploy/cloudRun/utils/cloudRunExecutionUrl.js +16 -0
- package/dist/deploy/cloudRun/utils/jobName.d.ts +5 -1
- package/dist/deploy/cloudRun/utils/jobName.js +14 -2
- package/dist/deploy/types/googleCloudRun.d.ts +95 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +1697 -0
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +133 -70
- package/examples/cloud-run-no-service.ts +6 -0
- package/examples/cloud-run-post-stop-job.ts +7 -0
- package/examples/cloud-run-service-custom-vpc-connector.ts +0 -1
- package/examples/cloud-run-service-custom-vpc.ts +0 -1
- package/examples/cloud-run-service-with-volumes.ts +9 -1
- package/examples/cloud-run-with-sql-legacy-jobs.test.ts +11 -0
- package/examples/cloud-run-with-sql-legacy-jobs.ts +49 -0
- package/examples/cloud-run-with-sql.ts +38 -4
- package/package.json +1 -1
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +16 -155
- package/src/deploy/cloudRun/createJobs/execute/onDeploy.ts +112 -0
- package/src/deploy/cloudRun/createJobs/execute/schedules.ts +186 -0
- package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +6 -8
- package/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts +6 -8
- package/src/deploy/cloudRun/index.ts +6 -6
- package/src/deploy/cloudRun/utils/cloudRunExecutionUrl.ts +20 -0
- package/src/deploy/cloudRun/utils/jobName.ts +16 -1
- package/src/deploy/types/googleCloudRun.ts +123 -1
package/dist/constants.js
CHANGED
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
7
|
-
exports.PIPELINE_IMAGE_TAG = "v2-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "v2-10-0-9293d1d9" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ComponentContext } from "../../../types/context";
|
|
2
2
|
import type { DeployConfigCloudRunJob } from "../../types/googleCloudRun";
|
|
3
|
-
export declare const getDeleteSchedulesScripts: (context: ComponentContext) => string[];
|
|
4
3
|
export declare const getDeleteJobsScripts: (context: ComponentContext) => string[];
|
|
5
|
-
export declare const getJobRunScripts: (context: ComponentContext, when: DeployConfigCloudRunJob["when"]) => string[];
|
|
6
4
|
export declare const getJobCreateScripts: (context: ComponentContext) => string[];
|
|
7
|
-
export declare const
|
|
5
|
+
export declare const getCloudRunJobsWithNames: (context: ComponentContext) => {
|
|
6
|
+
fullJobName: import("../../..").StringOrBashExpression;
|
|
7
|
+
job: DeployConfigCloudRunJob;
|
|
8
|
+
jobName: string;
|
|
9
|
+
}[];
|
|
@@ -52,65 +52,32 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
52
52
|
Object.defineProperty(exports, "__esModule", {
|
|
53
53
|
value: true
|
|
54
54
|
});
|
|
55
|
-
exports.
|
|
55
|
+
exports.getCloudRunJobsWithNames = exports.getJobCreateScripts = exports.getDeleteJobsScripts = void 0;
|
|
56
|
+
var getLabels_1 = require("../../../context/getLabels");
|
|
57
|
+
var utils_1 = require("../../../utils");
|
|
56
58
|
var createArgsString_1 = require("../utils/createArgsString");
|
|
57
59
|
var jobName_1 = require("../utils/jobName");
|
|
58
60
|
var common_1 = require("./common");
|
|
59
|
-
var getLabels_1 = require("../../../context/getLabels");
|
|
60
|
-
var volumes_1 = require("./volumes");
|
|
61
61
|
var constants_1 = require("./constants");
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
65
|
-
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
66
|
-
return "".concat((0, common_1.gcloudRunCmd)(), " jobs execute ").concat(jobName.toString(), " ").concat(commonArgsString).concat(wait ? " --wait" : "");
|
|
67
|
-
};
|
|
68
|
-
var getDeleteSchedulesScripts = function (context) {
|
|
69
|
-
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
70
|
-
var schedules = getSchedules(context);
|
|
71
|
-
var argsString = (0, createArgsString_1.createArgsString)({
|
|
72
|
-
project: deployConfig.projectId,
|
|
73
|
-
location: deployConfig.region
|
|
74
|
-
});
|
|
75
|
-
return schedules.map(function (_a) {
|
|
76
|
-
var name = _a.name;
|
|
77
|
-
return ["".concat((0, common_1.gcloudSchedulerCmd)(), " jobs delete ").concat(name, " ").concat(argsString)];
|
|
78
|
-
}).flat();
|
|
79
|
-
};
|
|
80
|
-
exports.getDeleteSchedulesScripts = getDeleteSchedulesScripts;
|
|
62
|
+
var volumes_1 = require("./volumes");
|
|
63
|
+
var onDeploy_1 = require("./execute/onDeploy");
|
|
81
64
|
var getDeleteJobsScripts = function (context) {
|
|
82
65
|
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
83
66
|
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
84
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
67
|
+
var jobsWithNames = (0, exports.getCloudRunJobsWithNames)(context);
|
|
85
68
|
return jobsWithNames.flatMap(function (_a) {
|
|
86
|
-
var
|
|
69
|
+
var fullJobName = _a.fullJobName;
|
|
87
70
|
return [
|
|
88
71
|
// first delete all job executions. Otherwise delete might fail if one of those is still running
|
|
89
|
-
"".concat((0, common_1.gcloudRunCmd)(), " jobs executions list ").concat(commonArgsString, " --job ").concat(
|
|
72
|
+
"".concat((0, common_1.gcloudRunCmd)(), " jobs executions list ").concat(commonArgsString, " --job ").concat(fullJobName, " --format=\"value(name)\" | xargs -I {} ").concat((0, common_1.gcloudRunCmd)(), " jobs executions delete {} --quiet ").concat(commonArgsString), "".concat((0, common_1.gcloudRunCmd)(), " jobs delete ").concat(fullJobName, " ").concat(commonArgsString)];
|
|
90
73
|
});
|
|
91
74
|
};
|
|
92
75
|
exports.getDeleteJobsScripts = getDeleteJobsScripts;
|
|
93
|
-
var getJobRunScripts = function (context, when) {
|
|
94
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
95
|
-
return jobsWithNames.filter(function (_a) {
|
|
96
|
-
var job = _a.job;
|
|
97
|
-
return job.when === when;
|
|
98
|
-
}).map(function (_a) {
|
|
99
|
-
var _b;
|
|
100
|
-
var jobName = _a.jobName,
|
|
101
|
-
job = _a.job;
|
|
102
|
-
// always wait for completion for preStop and postStop jobs
|
|
103
|
-
// since stop will delete the jobs afterwards, so they will fail
|
|
104
|
-
var waitForCompletion = ["preStop", "postStop"].includes(when) ? true : "waitForCompletion" in job ? (_b = job.waitForCompletion) !== null && _b !== void 0 ? _b : false : false;
|
|
105
|
-
return getJobRunScriptForJob(context, jobName, waitForCompletion);
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
exports.getJobRunScripts = getJobRunScripts;
|
|
109
76
|
var getJobCreateScripts = function (context) {
|
|
110
|
-
return getCloudRunJobsWithNames(context).map(function (_a, jobIndex) {
|
|
77
|
+
return (0, exports.getCloudRunJobsWithNames)(context).map(function (_a, jobIndex) {
|
|
111
78
|
var _b, _c, _d, _e;
|
|
112
79
|
var job = _a.job,
|
|
113
|
-
|
|
80
|
+
fullJobName = _a.fullJobName;
|
|
114
81
|
var commandArray = Array.isArray(job.command) ? job.command : job.command.split(" ");
|
|
115
82
|
var _f = (0, common_1.getCommonDeployArgs)(context),
|
|
116
83
|
commonImage = _f.image,
|
|
@@ -119,6 +86,7 @@ var getJobCreateScripts = function (context) {
|
|
|
119
86
|
deployArgs = __rest(_f, ["image", "project", "region"]);
|
|
120
87
|
var commonDeployArgsString = createArgsString_1.createArgsString.apply(void 0, __spreadArray([__assign(__assign({
|
|
121
88
|
command: "\"".concat(commandArray.join(","), "\""),
|
|
89
|
+
args: (0, onDeploy_1.getCloudRunJobArgsArg)(job.args),
|
|
122
90
|
labels: "\"".concat((0, common_1.makeLabelString)((0, getLabels_1.getLabels)(context)), ",cloud-run-job-name=$current_job_name\""),
|
|
123
91
|
image: "\"".concat((_b = job.image) !== null && _b !== void 0 ? _b : commonImage, "\""),
|
|
124
92
|
project: project,
|
|
@@ -136,79 +104,27 @@ var getJobCreateScripts = function (context) {
|
|
|
136
104
|
network: job === null || job === void 0 ? void 0 : job.network,
|
|
137
105
|
subnet: job === null || job === void 0 ? void 0 : job.subnet
|
|
138
106
|
})], __read((0, volumes_1.createVolumeConfig)(job.volumes, "job")), false));
|
|
139
|
-
return [jobIndex === 0 ? "exist_job_names=\"$(\n ".concat((0, common_1.gcloudRunCmd)(), " jobs list --filter='metadata.name ~ ").concat(context.env, ".*").concat(context.name, "' --format='value(name)' --limit=999 --project='").concat(project, "' --region='").concat(region, "'\n)\"") : null, "current_job_name=\"".concat(
|
|
107
|
+
return [jobIndex === 0 ? "exist_job_names=\"$(\n ".concat((0, common_1.gcloudRunCmd)(), " jobs list --filter='metadata.name ~ ").concat(context.env, ".*").concat(context.name, "' --format='value(name)' --limit=999 --project='").concat(project, "' --region='").concat(region, "'\n)\"") : null, "current_job_name=\"".concat(fullJobName, "\""), 'if grep "$current_job_name" <<<"$exist_job_names" >/dev/null; then', " ".concat((0, common_1.gcloudRunCmd)(), " jobs update \"$current_job_name\" ").concat(commonDeployArgsString), "else", " ".concat((0, common_1.gcloudRunCmd)(), " jobs create \"$current_job_name\" ").concat(commonDeployArgsString), "fi"].filter(utils_1.notNil).join("\n");
|
|
140
108
|
});
|
|
141
109
|
};
|
|
142
110
|
exports.getJobCreateScripts = getJobCreateScripts;
|
|
143
|
-
var getCreateScheduleScripts = function (context) {
|
|
144
|
-
var schedules = getSchedules(context);
|
|
145
|
-
var _a = (0, common_1.getCloudRunDeployConfig)(context),
|
|
146
|
-
location = _a.region,
|
|
147
|
-
project = _a.projectId;
|
|
148
|
-
return schedules.map(function (scheduler, jobIndex) {
|
|
149
|
-
var _a;
|
|
150
|
-
var uri = getSchedulerUrl(scheduler, context);
|
|
151
|
-
var argsString = (0, createArgsString_1.createArgsString)({
|
|
152
|
-
project: project,
|
|
153
|
-
location: location,
|
|
154
|
-
uri: "\"$current_job_uri\"",
|
|
155
|
-
"http-method": "POST",
|
|
156
|
-
"oauth-service-account-email": "\"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com\"",
|
|
157
|
-
schedule: "\"".concat(scheduler.schedule, "\""),
|
|
158
|
-
"max-retry-attempts": (_a = scheduler.maxRetryAttempts) !== null && _a !== void 0 ? _a : 0
|
|
159
|
-
});
|
|
160
|
-
return [jobIndex === 0 ? "exist_scheduler_names=\"$(\n ".concat((0, common_1.gcloudSchedulerCmd)(), " jobs list --filter='httpTarget.uri ~ ").concat(context.env, ".*").concat(context.name, "' --format='value(name)' --limit=999 --location='").concat(location, "' --project='").concat(project, "'\n)\"") : null, "current_job_uri=\"".concat(uri, "\""), "current_scheduler_name=\"".concat(scheduler.name, "\""), "if grep \"$current_scheduler_name\" <<<\"$exist_scheduler_names\" >/dev/null; then", " ".concat((0, common_1.gcloudSchedulerCmd)(), " jobs update http \"$current_scheduler_name\" ").concat(argsString), "else", " ".concat((0, common_1.gcloudSchedulerCmd)(), " jobs create http \"$current_scheduler_name\" ").concat(argsString), "fi"].filter(utils_1.notNil).join("\n");
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
exports.getCreateScheduleScripts = getCreateScheduleScripts;
|
|
164
|
-
var getSchedulerUrl = function (scheduler, context) {
|
|
165
|
-
if (scheduler.type === "cloudRunJob") {
|
|
166
|
-
var _a = (0, common_1.getCloudRunDeployConfig)(context),
|
|
167
|
-
location_1 = _a.region,
|
|
168
|
-
project = _a.projectId;
|
|
169
|
-
var uriBase = "https://".concat(location_1, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(project, "/jobs");
|
|
170
|
-
return "".concat(uriBase, "/").concat(scheduler.jobName, ":run");
|
|
171
|
-
}
|
|
172
|
-
throw new Error("Unknown scheduler type: ".concat(scheduler.type));
|
|
173
|
-
};
|
|
174
|
-
var getSchedules = function (context) {
|
|
175
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
176
|
-
return jobsWithNames.filter(function (entry) {
|
|
177
|
-
return entry.job.when === "schedule";
|
|
178
|
-
}).map(function (_a) {
|
|
179
|
-
var _b = _a.job,
|
|
180
|
-
maxRetryAttempts = _b.maxRetryAttempts,
|
|
181
|
-
schedule = _b.schedule,
|
|
182
|
-
jobName = _a.jobName;
|
|
183
|
-
var schedulerName = jobName.concat("-scheduler");
|
|
184
|
-
return {
|
|
185
|
-
name: schedulerName,
|
|
186
|
-
maxRetryAttempts: maxRetryAttempts,
|
|
187
|
-
schedule: schedule,
|
|
188
|
-
type: "cloudRunJob",
|
|
189
|
-
jobName: jobName
|
|
190
|
-
};
|
|
191
|
-
});
|
|
192
|
-
};
|
|
193
111
|
var getCloudRunJobsWithNames = function (context) {
|
|
194
112
|
var _a;
|
|
195
113
|
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
196
|
-
var getFullJobName = function (name) {
|
|
197
|
-
return (0, jobName_1.getCloudRunJobName)(context.environment.fullName, name);
|
|
198
|
-
};
|
|
199
114
|
var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {})
|
|
200
115
|
// filter out disabled jobs
|
|
201
116
|
.filter(function (entry) {
|
|
202
117
|
return Boolean(entry[1]);
|
|
203
118
|
}).map(function (_a) {
|
|
204
119
|
var _b = __read(_a, 2),
|
|
205
|
-
|
|
120
|
+
jobName = _b[0],
|
|
206
121
|
job = _b[1];
|
|
207
122
|
return {
|
|
208
|
-
|
|
123
|
+
fullJobName: (0, jobName_1.getFullJobName)(context, jobName),
|
|
209
124
|
job: job,
|
|
210
|
-
|
|
125
|
+
jobName: jobName
|
|
211
126
|
};
|
|
212
127
|
});
|
|
213
128
|
return jobsWithNames;
|
|
214
|
-
};
|
|
129
|
+
};
|
|
130
|
+
exports.getCloudRunJobsWithNames = getCloudRunJobsWithNames;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentContext } from "../../../../types/context";
|
|
2
|
+
import type { DeployConfigCloudRunExecuteOnDeploy, DeployConfigCloudRunJob } from "../../../types/googleCloudRun";
|
|
3
|
+
export declare const getOnDeployExecuteScript: (context: ComponentContext, when: DeployConfigCloudRunExecuteOnDeploy["when"]) => string[];
|
|
4
|
+
export declare const getCloudRunJobArgsArg: (args: DeployConfigCloudRunExecuteOnDeploy["args"] | DeployConfigCloudRunJob["args"]) => string | undefined;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
};
|
|
13
|
+
var __read = this && this.__read || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o),
|
|
17
|
+
r,
|
|
18
|
+
ar = [],
|
|
19
|
+
e;
|
|
20
|
+
try {
|
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
e = {
|
|
24
|
+
error: error
|
|
25
|
+
};
|
|
26
|
+
} finally {
|
|
27
|
+
try {
|
|
28
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
29
|
+
} finally {
|
|
30
|
+
if (e) throw e.error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
36
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
37
|
+
if (ar || !(i in from)) {
|
|
38
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
39
|
+
ar[i] = from[i];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
47
|
+
exports.getCloudRunJobArgsArg = exports.getOnDeployExecuteScript = void 0;
|
|
48
|
+
var createArgsString_1 = require("../../utils/createArgsString");
|
|
49
|
+
var jobName_1 = require("../../utils/jobName");
|
|
50
|
+
var cloudRunJobs_1 = require("../cloudRunJobs");
|
|
51
|
+
var common_1 = require("../common");
|
|
52
|
+
var getOnDeployExecuteScript = function (context, when) {
|
|
53
|
+
var executes = getExecutes(context);
|
|
54
|
+
return executes.filter(function (_a) {
|
|
55
|
+
var config = _a.config;
|
|
56
|
+
return config.when === when;
|
|
57
|
+
}).map(function (execute) {
|
|
58
|
+
return getJobRunScriptForExecute(context, execute);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
exports.getOnDeployExecuteScript = getOnDeployExecuteScript;
|
|
62
|
+
var getExecutes = function (context) {
|
|
63
|
+
var _a;
|
|
64
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
65
|
+
return __spreadArray(__spreadArray([], __read(getLegacyExecutes(context)), false), __read(Object.entries((_a = deployConfig.execute) !== null && _a !== void 0 ? _a : {}).flatMap(function (_a) {
|
|
66
|
+
var _b = __read(_a, 2),
|
|
67
|
+
key = _b[0],
|
|
68
|
+
value = _b[1];
|
|
69
|
+
if (!value || value.when !== "schedule" && value.type !== "job") {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
return [{
|
|
73
|
+
jobName: key,
|
|
74
|
+
config: value
|
|
75
|
+
}];
|
|
76
|
+
})), false);
|
|
77
|
+
};
|
|
78
|
+
var getLegacyExecutes = function (context) {
|
|
79
|
+
var jobsWithNames = (0, cloudRunJobs_1.getCloudRunJobsWithNames)(context);
|
|
80
|
+
return jobsWithNames.flatMap(function (_a) {
|
|
81
|
+
var jobName = _a.jobName,
|
|
82
|
+
job = _a.job;
|
|
83
|
+
if (!job.when || !["preDeploy", "postDeploy", "preStop", "postStop"].includes(job.when)) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
return [{
|
|
87
|
+
jobName: jobName,
|
|
88
|
+
config: __assign({
|
|
89
|
+
job: jobName,
|
|
90
|
+
type: "job",
|
|
91
|
+
when: job.when
|
|
92
|
+
}, job.when === "preDeploy" || job.when === "postDeploy" ? {
|
|
93
|
+
waitForCompletion: job.waitForCompletion
|
|
94
|
+
} : {})
|
|
95
|
+
}];
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
var getJobRunScriptForExecute = function (context, _a) {
|
|
99
|
+
var _b;
|
|
100
|
+
var jobName = _a.jobName,
|
|
101
|
+
config = _a.config;
|
|
102
|
+
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
103
|
+
// always wait for completion for preStop and postStop jobs
|
|
104
|
+
// since stop will delete the jobs afterwards, so they will fail
|
|
105
|
+
var waitForCompletion = ["preStop", "postStop"].includes(config.when) ? true // always
|
|
106
|
+
: "waitForCompletion" in config ? (_b = config.waitForCompletion) !== null && _b !== void 0 ? _b : false // depends on config
|
|
107
|
+
: false;
|
|
108
|
+
var argString = (0, createArgsString_1.createArgsString)(__assign(__assign({}, commonArgs), {
|
|
109
|
+
wait: waitForCompletion === true ? true : undefined,
|
|
110
|
+
args: (0, exports.getCloudRunJobArgsArg)(config.args)
|
|
111
|
+
}));
|
|
112
|
+
var fullJobName = (0, jobName_1.getFullJobName)(context, jobName);
|
|
113
|
+
return "".concat((0, common_1.gcloudRunCmd)(), " jobs execute ").concat(fullJobName.toString(), " ").concat(argString);
|
|
114
|
+
};
|
|
115
|
+
var getCloudRunJobArgsArg = function (args) {
|
|
116
|
+
return args !== undefined ? args.length > 0 ? args === null || args === void 0 ? void 0 : args.map(function (arg) {
|
|
117
|
+
return "\"".concat(arg, "\"");
|
|
118
|
+
}).join(",") : "" : undefined;
|
|
119
|
+
};
|
|
120
|
+
exports.getCloudRunJobArgsArg = getCloudRunJobArgsArg;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
};
|
|
13
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
var __read = this && this.__read || function (o, n) {
|
|
22
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
+
if (!m) return o;
|
|
24
|
+
var i = m.call(o),
|
|
25
|
+
r,
|
|
26
|
+
ar = [],
|
|
27
|
+
e;
|
|
28
|
+
try {
|
|
29
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
e = {
|
|
32
|
+
error: error
|
|
33
|
+
};
|
|
34
|
+
} finally {
|
|
35
|
+
try {
|
|
36
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
37
|
+
} finally {
|
|
38
|
+
if (e) throw e.error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return ar;
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", {
|
|
44
|
+
value: true
|
|
45
|
+
});
|
|
46
|
+
exports.getCreateScheduleScript = exports.getDeleteSchedulesScript = void 0;
|
|
47
|
+
var bash_1 = require("../../../../bash");
|
|
48
|
+
var utils_1 = require("../../../../utils");
|
|
49
|
+
var cloudRunExecutionUrl_1 = require("../../utils/cloudRunExecutionUrl");
|
|
50
|
+
var createArgsString_1 = require("../../utils/createArgsString");
|
|
51
|
+
var jobName_1 = require("../../utils/jobName");
|
|
52
|
+
var cloudRunJobs_1 = require("../cloudRunJobs");
|
|
53
|
+
var common_1 = require("../common");
|
|
54
|
+
var getDeleteSchedulesScript = function (context) {
|
|
55
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
56
|
+
var schedules = getSchedules(context);
|
|
57
|
+
var argsString = (0, createArgsString_1.createArgsString)({
|
|
58
|
+
project: deployConfig.projectId,
|
|
59
|
+
location: deployConfig.region
|
|
60
|
+
});
|
|
61
|
+
return schedules.map(function (_a) {
|
|
62
|
+
var fullName = _a.fullName;
|
|
63
|
+
return ["".concat((0, common_1.gcloudSchedulerCmd)(), " jobs delete ").concat(fullName, " ").concat(argsString)];
|
|
64
|
+
}).flat();
|
|
65
|
+
};
|
|
66
|
+
exports.getDeleteSchedulesScript = getDeleteSchedulesScript;
|
|
67
|
+
var getCreateScheduleScript = function (context) {
|
|
68
|
+
var schedules = getSchedules(context);
|
|
69
|
+
var _a = (0, common_1.getCloudRunDeployConfig)(context),
|
|
70
|
+
location = _a.region,
|
|
71
|
+
project = _a.projectId;
|
|
72
|
+
return schedules.map(function (_a, jobIndex) {
|
|
73
|
+
var _b;
|
|
74
|
+
var fullName = _a.fullName,
|
|
75
|
+
config = _a.config;
|
|
76
|
+
var _c = getSchedulerArgs(config, context),
|
|
77
|
+
uri = _c.uri,
|
|
78
|
+
args = __rest(_c, ["uri"]);
|
|
79
|
+
var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
80
|
+
project: project,
|
|
81
|
+
location: location,
|
|
82
|
+
uri: "\"$current_job_uri\""
|
|
83
|
+
}, args), {
|
|
84
|
+
schedule: "\"".concat(config.schedule, "\""),
|
|
85
|
+
"max-retry-attempts": (_b = config.maxRetryAttempts) !== null && _b !== void 0 ? _b : 0
|
|
86
|
+
}));
|
|
87
|
+
return [jobIndex === 0 ? "exist_scheduler_names=\"$(\n ".concat((0, common_1.gcloudSchedulerCmd)(), " jobs list --filter='httpTarget.uri ~ ").concat(context.env, ".*").concat(context.name, "' --format='value(name)' --limit=999 --location='").concat(location, "' --project='").concat(project, "'\n)\"") : null, "current_job_uri=\"".concat(uri, "\""), "current_scheduler_name=\"".concat(fullName, "\""), "if grep \"$current_scheduler_name\" <<<\"$exist_scheduler_names\" >/dev/null; then", " ".concat((0, common_1.gcloudSchedulerCmd)(), " jobs update http \"$current_scheduler_name\" ").concat(argsString), "else", " ".concat((0, common_1.gcloudSchedulerCmd)(), " jobs create http \"$current_scheduler_name\" ").concat(argsString), "fi"].filter(utils_1.notNil).join("\n");
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
exports.getCreateScheduleScript = getCreateScheduleScript;
|
|
91
|
+
var getSchedulerArgs = function (scheduler, context) {
|
|
92
|
+
var _a;
|
|
93
|
+
if (scheduler.type === "job") {
|
|
94
|
+
var _b = (0, common_1.getCloudRunDeployConfig)(context),
|
|
95
|
+
projectId = _b.projectId,
|
|
96
|
+
region = _b.region;
|
|
97
|
+
var body = scheduler.args !== undefined ? {
|
|
98
|
+
overrides: {
|
|
99
|
+
containerOverrides: [((_a = scheduler.args) === null || _a === void 0 ? void 0 : _a.length) > 0 ? {
|
|
100
|
+
args: scheduler.args
|
|
101
|
+
} : {
|
|
102
|
+
args: [],
|
|
103
|
+
clearArgs: true // not sure why this is neeeded, but it is
|
|
104
|
+
}]
|
|
105
|
+
}
|
|
106
|
+
} : null;
|
|
107
|
+
return {
|
|
108
|
+
uri: (0, cloudRunExecutionUrl_1.getCloudRunJobExecuteUrl)(scheduler.job, {
|
|
109
|
+
appFullName: context.environment.fullName,
|
|
110
|
+
projectId: projectId,
|
|
111
|
+
region: region
|
|
112
|
+
}),
|
|
113
|
+
"message-body": body ? '"' + (0, bash_1.bashEscape)(JSON.stringify(body)) + '"' : undefined,
|
|
114
|
+
"http-method": "POST",
|
|
115
|
+
"oauth-service-account-email": "\"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com\""
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (scheduler.type === "http") {
|
|
119
|
+
return {
|
|
120
|
+
uri: scheduler.url,
|
|
121
|
+
"message-body": scheduler.body,
|
|
122
|
+
"http-method": scheduler.method,
|
|
123
|
+
"oidc-service-account-email": "\"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com\""
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
throw new Error("Unknown scheduler type: ".concat(scheduler.type));
|
|
127
|
+
};
|
|
128
|
+
var getSchedules = function (context) {
|
|
129
|
+
var legacyScheduleJobs = getLegacyJobSchedules(context);
|
|
130
|
+
var schedules = getScheduledExecutes(context);
|
|
131
|
+
return Object.entries(__assign(__assign({}, legacyScheduleJobs), schedules)).map(function (_a) {
|
|
132
|
+
var _b = __read(_a, 2),
|
|
133
|
+
name = _b[0],
|
|
134
|
+
config = _b[1];
|
|
135
|
+
return {
|
|
136
|
+
name: name,
|
|
137
|
+
fullName: (0, jobName_1.getFullSchedulerName)(context, name),
|
|
138
|
+
config: config
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
var getLegacyJobSchedules = function (context) {
|
|
143
|
+
var jobsWithNames = (0, cloudRunJobs_1.getCloudRunJobsWithNames)(context);
|
|
144
|
+
return Object.fromEntries(jobsWithNames.filter(function (entry) {
|
|
145
|
+
return entry.job.when === "schedule";
|
|
146
|
+
}).map(function (_a) {
|
|
147
|
+
var _b = _a.job,
|
|
148
|
+
maxRetryAttempts = _b.maxRetryAttempts,
|
|
149
|
+
schedule = _b.schedule,
|
|
150
|
+
jobName = _a.jobName;
|
|
151
|
+
var schedulerName = jobName.concat("-scheduler");
|
|
152
|
+
return [schedulerName, {
|
|
153
|
+
type: "job",
|
|
154
|
+
job: jobName,
|
|
155
|
+
maxRetryAttempts: maxRetryAttempts,
|
|
156
|
+
schedule: schedule,
|
|
157
|
+
when: "schedule"
|
|
158
|
+
}];
|
|
159
|
+
}));
|
|
160
|
+
};
|
|
161
|
+
var getScheduledExecutes = function (context) {
|
|
162
|
+
var _a;
|
|
163
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
164
|
+
return Object.fromEntries(Object.entries((_a = deployConfig.execute) !== null && _a !== void 0 ? _a : {}).flatMap(function (_a) {
|
|
165
|
+
var _b = __read(_a, 2),
|
|
166
|
+
key = _b[0],
|
|
167
|
+
value = _b[1];
|
|
168
|
+
if (!value || value.when !== "schedule") {
|
|
169
|
+
return [];
|
|
170
|
+
}
|
|
171
|
+
return [[key, value]];
|
|
172
|
+
}));
|
|
173
|
+
};
|
|
@@ -44,19 +44,21 @@ var cleanup_1 = require("../cleanup");
|
|
|
44
44
|
var database_1 = require("../utils/database");
|
|
45
45
|
var gcloudServiceAccountLoginCommands_1 = require("../utils/gcloudServiceAccountLoginCommands");
|
|
46
46
|
var cloudRunJobs_1 = require("./cloudRunJobs");
|
|
47
|
+
var onDeploy_1 = require("./execute/onDeploy");
|
|
47
48
|
var cloudRunServices_1 = require("./cloudRunServices");
|
|
48
49
|
var common_1 = require("./common");
|
|
49
50
|
var constants_1 = require("./constants");
|
|
51
|
+
var schedules_1 = require("./execute/schedules");
|
|
50
52
|
function getCloudRunDeployScripts(context) {
|
|
51
53
|
var _a;
|
|
52
54
|
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
53
55
|
var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
|
|
54
56
|
return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, common_1.setGoogleProjectNumberScript)(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("writeenvvars", "Write env vars to file")((0, bashYaml_1.writeBashYamlToFileScript)(allEnvVars, constants_1.ENV_VARS_FILENAME))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
|
|
55
|
-
: []), false), __read((0,
|
|
57
|
+
: []), false), __read((0, schedules_1.getCreateScheduleScript)(context)), false), __read((0, cloudRunJobs_1.getJobCreateScripts)(context)), false), __read((0, onDeploy_1.getOnDeployExecuteScript)(context, "preDeploy")), false), __read(deployConfig.service !== false ? [(0, cloudRunServices_1.getServiceDeployScript)(context, deployConfig.service)] : []), false), __read(Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
|
|
56
58
|
var _b = __read(_a, 2),
|
|
57
59
|
name = _b[0],
|
|
58
60
|
service = _b[1];
|
|
59
61
|
return (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name);
|
|
60
|
-
})), false), __read((0,
|
|
62
|
+
})), false), __read((0, onDeploy_1.getOnDeployExecuteScript)(context, "postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy"))), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
|
|
61
63
|
}
|
|
62
64
|
exports.getCloudRunDeployScripts = getCloudRunDeployScripts;
|
|
@@ -40,15 +40,17 @@ var cleanup_1 = require("../cleanup");
|
|
|
40
40
|
var database_1 = require("../utils/database");
|
|
41
41
|
var gcloudServiceAccountLoginCommands_1 = require("../utils/gcloudServiceAccountLoginCommands");
|
|
42
42
|
var cloudRunJobs_1 = require("./cloudRunJobs");
|
|
43
|
+
var onDeploy_1 = require("./execute/onDeploy");
|
|
44
|
+
var schedules_1 = require("./execute/schedules");
|
|
43
45
|
var cloudRunServices_1 = require("./cloudRunServices");
|
|
44
46
|
var common_1 = require("./common");
|
|
45
47
|
function getCloudRunStopScripts(context) {
|
|
46
48
|
var _a;
|
|
47
49
|
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
48
|
-
return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0,
|
|
50
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, onDeploy_1.getOnDeployExecuteScript)(context, "preStop")), false), __read(deployConfig.service !== false ? (0, cloudRunServices_1.getServiceDeleteScript)(context) : []), false), __read(Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {}).flatMap(function (_a) {
|
|
49
51
|
var _b = __read(_a, 1),
|
|
50
52
|
name = _b[0];
|
|
51
53
|
return (0, cloudRunServices_1.getServiceDeleteScript)(context, name);
|
|
52
|
-
})), false), __read((0,
|
|
54
|
+
})), false), __read((0, onDeploy_1.getOnDeployExecuteScript)(context, "postStop")), false), __read((0, schedules_1.getDeleteSchedulesScript)(context)), false), __read((0, cloudRunJobs_1.getDeleteJobsScripts)(context)), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false), __read((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "onStop")), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false);
|
|
53
55
|
}
|
|
54
56
|
exports.getCloudRunStopScripts = getCloudRunStopScripts;
|
|
@@ -50,8 +50,8 @@ var context_1 = require("../../context");
|
|
|
50
50
|
var gitlab_1 = require("../../utils/gitlab");
|
|
51
51
|
var utils_1 = require("../cloudSql/utils");
|
|
52
52
|
var createJobs_1 = require("./createJobs");
|
|
53
|
+
var cloudRunExecutionUrl_1 = require("./utils/cloudRunExecutionUrl");
|
|
53
54
|
var database_1 = require("./utils/database");
|
|
54
|
-
var jobName_1 = require("./utils/jobName");
|
|
55
55
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
56
56
|
// FIXME: rename to internalHostSuffix, but this means that project-setup needs to be rerun, so its kindof a breaking change
|
|
57
57
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
@@ -116,7 +116,11 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
116
116
|
var _b = __read(_a, 2),
|
|
117
117
|
name = _b[0],
|
|
118
118
|
job = _b[1];
|
|
119
|
-
return ["CLOUD_RUN_JOB_TRIGGER_URL_" + (0, gitlab_1.sanitizeForBashVariable)(name),
|
|
119
|
+
return ["CLOUD_RUN_JOB_TRIGGER_URL_" + (0, gitlab_1.sanitizeForBashVariable)(name), (0, cloudRunExecutionUrl_1.getCloudRunJobExecuteUrl)(name, {
|
|
120
|
+
appFullName: fullName,
|
|
121
|
+
projectId: deployConfigRaw.projectId,
|
|
122
|
+
region: deployConfigRaw.region
|
|
123
|
+
})];
|
|
120
124
|
})) : {};
|
|
121
125
|
return __assign(__assign(__assign({
|
|
122
126
|
HOSTNAME_INTERNAL: HOSTNAME_INTERNAL
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StringOrBashExpression } from "../../../bash";
|
|
2
|
+
export declare function getCloudRunJobExecuteUrl(jobName: string, {
|
|
3
|
+
region,
|
|
4
|
+
projectId,
|
|
5
|
+
appFullName
|
|
6
|
+
}: {
|
|
7
|
+
appFullName: StringOrBashExpression;
|
|
8
|
+
region: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
}): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCloudRunJobExecuteUrl = void 0;
|
|
7
|
+
var jobName_1 = require("./jobName");
|
|
8
|
+
function getCloudRunJobExecuteUrl(jobName, _a) {
|
|
9
|
+
var region = _a.region,
|
|
10
|
+
projectId = _a.projectId,
|
|
11
|
+
appFullName = _a.appFullName;
|
|
12
|
+
var uriBase = "https://".concat(region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(projectId, "/jobs");
|
|
13
|
+
var fullJobName = (0, jobName_1.getCloudRunJobName)(appFullName, jobName);
|
|
14
|
+
return "".concat(uriBase, "/").concat(fullJobName, ":run");
|
|
15
|
+
}
|
|
16
|
+
exports.getCloudRunJobExecuteUrl = getCloudRunJobExecuteUrl;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../../../bash/BashExpression";
|
|
2
|
-
|
|
2
|
+
import type { ComponentContext } from "../../../types";
|
|
3
|
+
export declare const getCloudRunJobName: (fullAppName: StringOrBashExpression, jobName: StringOrBashExpression) => StringOrBashExpression;
|
|
4
|
+
export declare const getFullJobName: (context: ComponentContext, name: StringOrBashExpression) => StringOrBashExpression;
|
|
5
|
+
export declare const getCloudRunSchedulerName: (fullAppName: StringOrBashExpression, schedulerName: string) => StringOrBashExpression;
|
|
6
|
+
export declare const getFullSchedulerName: (context: ComponentContext, name: string) => StringOrBashExpression;
|
|
@@ -3,8 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getCloudRunJobName = void 0;
|
|
6
|
+
exports.getFullSchedulerName = exports.getCloudRunSchedulerName = exports.getFullJobName = exports.getCloudRunJobName = void 0;
|
|
7
7
|
var getCloudRunJobName = function (fullAppName, jobName) {
|
|
8
8
|
return fullAppName.toLowerCase().concat("-" + jobName.toLowerCase());
|
|
9
9
|
};
|
|
10
|
-
exports.getCloudRunJobName = getCloudRunJobName;
|
|
10
|
+
exports.getCloudRunJobName = getCloudRunJobName;
|
|
11
|
+
var getFullJobName = function (context, name) {
|
|
12
|
+
return (0, exports.getCloudRunJobName)(context.environment.fullName, name);
|
|
13
|
+
};
|
|
14
|
+
exports.getFullJobName = getFullJobName;
|
|
15
|
+
var getCloudRunSchedulerName = function (fullAppName, schedulerName) {
|
|
16
|
+
return fullAppName.toLowerCase().concat("-" + schedulerName.toLowerCase());
|
|
17
|
+
};
|
|
18
|
+
exports.getCloudRunSchedulerName = getCloudRunSchedulerName;
|
|
19
|
+
var getFullSchedulerName = function (context, name) {
|
|
20
|
+
return (0, exports.getCloudRunSchedulerName)(context.environment.fullName, name);
|
|
21
|
+
};
|
|
22
|
+
exports.getFullSchedulerName = getFullSchedulerName;
|