@catladder/cli 0.0.0-main-a854e86f → 0.0.0-main-8f65e195

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.
@@ -40925,7 +40925,7 @@ exports.readConfigSync = readConfigSync;
40925
40925
 
40926
40926
  exports.__esModule = true;
40927
40927
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
40928
- exports.PIPELINE_IMAGE_TAG = "main-a854e86f" || 0;
40928
+ exports.PIPELINE_IMAGE_TAG = "main-8f65e195" || 0;
40929
40929
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
40930
40930
 
40931
40931
  /***/ }),
@@ -42782,6 +42782,14 @@ var cleanup_1 = __nccwpck_require__(964);
42782
42782
  var setGoogleProjectNumberScript = function (deployConfig) {
42783
42783
  return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
42784
42784
  };
42785
+ var makeLabelString = function (obj) {
42786
+ return Object.entries(obj).map(function (_a) {
42787
+ var _b = __read(_a, 2),
42788
+ key = _b[0],
42789
+ value = _b[1];
42790
+ return "".concat(key, "=").concat(value);
42791
+ }).join(",");
42792
+ };
42785
42793
  var createGoogleCloudRunDeployJobs = function (context) {
42786
42794
  var _a, _b, _c;
42787
42795
  var deployConfig = context.componentConfig.deploy;
@@ -42793,12 +42801,6 @@ var createGoogleCloudRunDeployJobs = function (context) {
42793
42801
  throw new Error("deploy config is wrong");
42794
42802
  }
42795
42803
  var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, _1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
42796
- var labelsString = Object.entries((0, getLabels_1.getLabels)(context)).map(function (_a) {
42797
- var _b = __read(_a, 2),
42798
- key = _b[0],
42799
- value = _b[1];
42800
- return "".concat(key, "=").concat(value);
42801
- }).join(",");
42802
42804
  var commonArgs = {
42803
42805
  project: deployConfig.projectId,
42804
42806
  region: deployConfig.region
@@ -42806,8 +42808,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
42806
42808
  var commonDeployArgs = __assign(__assign({
42807
42809
  image: (0, artifactsRegistry_1.getArtifactsRegistryImage)(context)
42808
42810
  }, commonArgs), {
42809
- "set-cloudsql-instances": deployConfig.cloudSql ? deployConfig.cloudSql.instanceConnectionName : undefined,
42810
- labels: labelsString
42811
+ "set-cloudsql-instances": deployConfig.cloudSql ? deployConfig.cloudSql.instanceConnectionName : undefined
42811
42812
  });
42812
42813
  var serviceName = (0, getServiceName_1.getServiceName)(context);
42813
42814
  var getFullJobName = function (name) {
@@ -42842,10 +42843,14 @@ var createGoogleCloudRunDeployJobs = function (context) {
42842
42843
  var customConfig = service !== true ? service : undefined;
42843
42844
  var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
42844
42845
  var commandArray = command ? Array.isArray(command) ? command : command.split(" ") : undefined;
42846
+ var fullServiceName = "".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "");
42845
42847
  var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
42846
42848
  // command as empty string resets it to default (uses the image's entrypoint)
42847
42849
  command: commandArray ? '"' + commandArray.join(",") + '"' : '""'
42848
42850
  }, commonDeployArgs), {
42851
+ labels: makeLabelString(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
42852
+ "cloud-run-service-name": fullServiceName
42853
+ })),
42849
42854
  "env-vars-file": "____envvars.yaml",
42850
42855
  "min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
42851
42856
  "max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
@@ -42855,7 +42860,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
42855
42860
  ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
42856
42861
  "cpu-boost": true
42857
42862
  }));
42858
- return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(argsString);
42863
+ return "gcloud run deploy ".concat(fullServiceName, " ").concat(argsString);
42859
42864
  };
42860
42865
  var getJobCreateScriptsForJob = function (jobName, job) {
42861
42866
  // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
@@ -42865,6 +42870,9 @@ var createGoogleCloudRunDeployJobs = function (context) {
42865
42870
  var commonDeployArgsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
42866
42871
  command: '"' + commandArray.join(",") + '"'
42867
42872
  }, commonDeployArgs), {
42873
+ labels: makeLabelString(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
42874
+ "cloud-run-job-name": jobName
42875
+ })),
42868
42876
  image: job.image || commonDeployArgs.image,
42869
42877
  memory: job.memory || "512Mi",
42870
42878
  "task-timeout": job.timeout || "10m"
@@ -355464,7 +355464,7 @@ exports.readConfigSync = readConfigSync;
355464
355464
 
355465
355465
  exports.__esModule = true;
355466
355466
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
355467
- exports.PIPELINE_IMAGE_TAG = "main-a854e86f" || 0;
355467
+ exports.PIPELINE_IMAGE_TAG = "main-8f65e195" || 0;
355468
355468
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
355469
355469
 
355470
355470
  /***/ }),
@@ -357321,6 +357321,14 @@ var cleanup_1 = __nccwpck_require__(10964);
357321
357321
  var setGoogleProjectNumberScript = function (deployConfig) {
357322
357322
  return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
357323
357323
  };
357324
+ var makeLabelString = function (obj) {
357325
+ return Object.entries(obj).map(function (_a) {
357326
+ var _b = __read(_a, 2),
357327
+ key = _b[0],
357328
+ value = _b[1];
357329
+ return "".concat(key, "=").concat(value);
357330
+ }).join(",");
357331
+ };
357324
357332
  var createGoogleCloudRunDeployJobs = function (context) {
357325
357333
  var _a, _b, _c;
357326
357334
  var deployConfig = context.componentConfig.deploy;
@@ -357332,12 +357340,6 @@ var createGoogleCloudRunDeployJobs = function (context) {
357332
357340
  throw new Error("deploy config is wrong");
357333
357341
  }
357334
357342
  var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, _1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
357335
- var labelsString = Object.entries((0, getLabels_1.getLabels)(context)).map(function (_a) {
357336
- var _b = __read(_a, 2),
357337
- key = _b[0],
357338
- value = _b[1];
357339
- return "".concat(key, "=").concat(value);
357340
- }).join(",");
357341
357343
  var commonArgs = {
357342
357344
  project: deployConfig.projectId,
357343
357345
  region: deployConfig.region
@@ -357345,8 +357347,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
357345
357347
  var commonDeployArgs = __assign(__assign({
357346
357348
  image: (0, artifactsRegistry_1.getArtifactsRegistryImage)(context)
357347
357349
  }, commonArgs), {
357348
- "set-cloudsql-instances": deployConfig.cloudSql ? deployConfig.cloudSql.instanceConnectionName : undefined,
357349
- labels: labelsString
357350
+ "set-cloudsql-instances": deployConfig.cloudSql ? deployConfig.cloudSql.instanceConnectionName : undefined
357350
357351
  });
357351
357352
  var serviceName = (0, getServiceName_1.getServiceName)(context);
357352
357353
  var getFullJobName = function (name) {
@@ -357381,10 +357382,14 @@ var createGoogleCloudRunDeployJobs = function (context) {
357381
357382
  var customConfig = service !== true ? service : undefined;
357382
357383
  var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
357383
357384
  var commandArray = command ? Array.isArray(command) ? command : command.split(" ") : undefined;
357385
+ var fullServiceName = "".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "");
357384
357386
  var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
357385
357387
  // command as empty string resets it to default (uses the image's entrypoint)
357386
357388
  command: commandArray ? '"' + commandArray.join(",") + '"' : '""'
357387
357389
  }, commonDeployArgs), {
357390
+ labels: makeLabelString(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
357391
+ "cloud-run-service-name": fullServiceName
357392
+ })),
357388
357393
  "env-vars-file": "____envvars.yaml",
357389
357394
  "min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
357390
357395
  "max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
@@ -357394,7 +357399,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
357394
357399
  ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
357395
357400
  "cpu-boost": true
357396
357401
  }));
357397
- return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(argsString);
357402
+ return "gcloud run deploy ".concat(fullServiceName, " ").concat(argsString);
357398
357403
  };
357399
357404
  var getJobCreateScriptsForJob = function (jobName, job) {
357400
357405
  // due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
@@ -357404,6 +357409,9 @@ var createGoogleCloudRunDeployJobs = function (context) {
357404
357409
  var commonDeployArgsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
357405
357410
  command: '"' + commandArray.join(",") + '"'
357406
357411
  }, commonDeployArgs), {
357412
+ labels: makeLabelString(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
357413
+ "cloud-run-job-name": jobName
357414
+ })),
357407
357415
  image: job.image || commonDeployArgs.image,
357408
357416
  memory: job.memory || "512Mi",
357409
357417
  "task-timeout": job.timeout || "10m"
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "0.0.0-main-a854e86f",
55
+ "version": "0.0.0-main-8f65e195",
56
56
  "scripts": {
57
57
  "lint": "eslint \"src/**/*.ts\"",
58
58
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
@@ -73,7 +73,7 @@
73
73
  "node": ">=12.0.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@catladder/pipeline": "0.0.0-main-a854e86f",
76
+ "@catladder/pipeline": "0.0.0-main-8f65e195",
77
77
  "@kubernetes/client-node": "^0.16.2",
78
78
  "@tsconfig/node14": "^1.0.1",
79
79
  "@types/common-tags": "^1.8.0",