@catladder/cli 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.
Files changed (26) hide show
  1. package/dist/bundles/catenv/index.js +2 -2
  2. package/dist/bundles/cli/index.js +1 -1
  3. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +5 -3
  4. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +16 -105
  5. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
  6. package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +4 -0
  7. package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js +85 -0
  8. package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js.map +1 -0
  9. package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.d.ts +3 -0
  10. package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js +136 -0
  11. package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js.map +1 -0
  12. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +5 -3
  13. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
  14. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +5 -3
  15. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
  16. package/dist/pipeline/src/deploy/cloudRun/index.js +6 -2
  17. package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
  18. package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.d.ts +6 -0
  19. package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.js +11 -0
  20. package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.js.map +1 -0
  21. package/dist/pipeline/src/deploy/cloudRun/utils/jobName.d.ts +5 -1
  22. package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js +7 -1
  23. package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js.map +1 -1
  24. package/dist/pipeline/src/deploy/types/googleCloudRun.d.ts +95 -1
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"jobName.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/utils/jobName.ts"],"names":[],"mappings":";;;AAEO,MAAM,kBAAkB,GAAG,CAChC,WAAmC,EACnC,OAAe,EACS,EAAE,CAC1B,WAAW,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAJnD,QAAA,kBAAkB,sBAIiC"}
1
+ {"version":3,"file":"jobName.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/utils/jobName.ts"],"names":[],"mappings":";;;AAGO,MAAM,kBAAkB,GAAG,CAChC,WAAmC,EACnC,OAA+B,EACP,EAAE,CAC1B,WAAW,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAJnD,QAAA,kBAAkB,sBAIiC;AAEzD,MAAM,cAAc,GAAG,CAC5B,OAAyB,EACzB,IAA4B,EAC5B,EAAE,CAAC,IAAA,0BAAkB,EAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAH/C,QAAA,cAAc,kBAGiC;AAErD,MAAM,wBAAwB,GAAG,CACtC,WAAmC,EACnC,aAAqB,EACG,EAAE,CAC1B,WAAW,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;AAJzD,QAAA,wBAAwB,4BAIiC;AAE/D,MAAM,oBAAoB,GAAG,CAAC,OAAyB,EAAE,IAAY,EAAE,EAAE,CAC9E,IAAA,gCAAwB,EAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AADlD,QAAA,oBAAoB,wBAC8B"}
@@ -137,6 +137,10 @@ export type DeployConfigCloudRunJobBase = {
137
137
  * command
138
138
  */
139
139
  command: string | string[];
140
+ /**
141
+ * optional, specify args. Those get overwritten by job executions if specified there
142
+ */
143
+ args?: string[];
140
144
  /**
141
145
  * custom image to use. Defaults to the image from the build
142
146
  */
@@ -166,24 +170,38 @@ type DayOfMonth = string;
166
170
  type DayOfWeek = string;
167
171
  type Month = string;
168
172
  export type DeployConfigCloudRunJobWithSchedule = DeployConfigCloudRunJobBase & {
173
+ /**
174
+ * @deprecated use `execute` instead
175
+ */
169
176
  when: "schedule";
177
+ /**
178
+ * @deprecated use `run` instead
179
+ */
170
180
  schedule: `${Minute} ${Hour} ${DayOfMonth} ${Month} ${DayOfWeek}`;
171
181
  /**
172
182
  * Max number of retries of the cloud scheduler.
173
183
  * Note: the task itself is never retried.
174
184
  *
175
185
  * defaults to 0 (no retries)
186
+ *
187
+ * @deprecated use `run` instead
176
188
  */
177
189
  maxRetryAttempts?: 0 | 1 | 2 | 3 | 4 | 5;
178
190
  };
179
191
  export type DeployConfigCloudRunJobNormal = DeployConfigCloudRunJobBase & {
180
- when: "manual" | "preDeploy" | "postDeploy" | "preStop" | "postStop";
181
192
  /**
182
193
  * wait for completion of the job on preDeploy and postDeploy
183
194
  *
184
195
  * has no effect on preStop and postStop (which always wait for completion)
196
+ *
197
+ *
198
+ * @deprecated use `run` instead
185
199
  */
186
200
  waitForCompletion?: boolean;
201
+ /**
202
+ * @deprecated use `run` instead
203
+ */
204
+ when?: "manual" | "preDeploy" | "postDeploy" | "preStop" | "postStop";
187
205
  };
188
206
  export type DeployConfigCloudRunWithVolumes = {
189
207
  /**
@@ -227,6 +245,10 @@ export type DeployConfigCloudRun = {
227
245
  * add cloudSql
228
246
  */
229
247
  cloudSql?: DeployConfigCloudRunCloudSql | false;
248
+ /**
249
+ * execute jobs on deploy or execute jobs and http requests on a schedule
250
+ */
251
+ execute?: Record<string, DeployConfigCloudRunExecute | null>;
230
252
  debug?: boolean;
231
253
  } & DeployConfigBase;
232
254
  export type DeployConfigCloudRunVolumes = Record<string, DeployConfigCloudRunVolume>;
@@ -236,4 +258,76 @@ export type DeployConfigCloudRunVolume = {
236
258
  mountPath: string;
237
259
  readonly?: boolean;
238
260
  };
261
+ export type DeployConfigCloudRunExecuteJobBase = {
262
+ /**
263
+ * set to "job" to run a cloud run job
264
+ */
265
+ type: "job";
266
+ /**
267
+ * the cloud run job to run
268
+ */
269
+ job: string;
270
+ /**
271
+ * additional args to pass to the job
272
+ */
273
+ args?: string[];
274
+ };
275
+ type WithSchedule = {
276
+ /**
277
+ * run the job on a schedule
278
+ */
279
+ when: "schedule";
280
+ /**
281
+ * the cron schedule. See https://crontab.guru/
282
+ */
283
+ schedule: `${Minute} ${Hour} ${DayOfMonth} ${Month} ${DayOfWeek}`;
284
+ /**
285
+ * Max number of retries of the cloud scheduler.
286
+ * Note: the task itself is never retried.
287
+ *
288
+ * defaults to 0 (no retries)
289
+ */
290
+ maxRetryAttempts?: 0 | 1 | 2 | 3 | 4 | 5;
291
+ };
292
+ export type DeployConfigCloudRunExecuteJobScheduled = DeployConfigCloudRunExecuteJobBase & WithSchedule;
293
+ export type DeployConfigCloudRunExecuteOnDeploy = DeployConfigCloudRunExecuteJobBase & ({
294
+ /**
295
+ * run the job before or after the deploy
296
+ */
297
+ when: "preDeploy" | "postDeploy";
298
+ /**
299
+ * whether to wait for completion of the job
300
+ */
301
+ waitForCompletion?: boolean;
302
+ } | {
303
+ /**
304
+ * run the job before or after the environment is stopped
305
+ */
306
+ when: "preStop" | "postStop";
307
+ });
308
+ export type DeployConfigCloudRunExecuteJob = DeployConfigCloudRunExecuteJobScheduled | DeployConfigCloudRunExecuteOnDeploy;
309
+ export type DeployConfigCloudRunExecuteHttp = {
310
+ /**
311
+ * set to "http" to run a http request
312
+ */
313
+ type: "http";
314
+ /**
315
+ * the url to call
316
+ */
317
+ url: string;
318
+ /**
319
+ * the http-method to use. Defaults to "POST" (as specified by google cloud scheduler)
320
+ */
321
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
322
+ /**
323
+ * the body to send
324
+ */
325
+ body?: string;
326
+ /**
327
+ * the headers to send
328
+ */
329
+ headers?: Record<string, string>;
330
+ } & WithSchedule;
331
+ export type DeployConfigCloudRunExecute = DeployConfigCloudRunExecuteJob | DeployConfigCloudRunExecuteHttp;
332
+ export type DeployConfigCloudRunExecuteWithSchedule = Extract<DeployConfigCloudRunExecute, WithSchedule>;
239
333
  export {};