@catladder/cli 0.0.0-main-85a0b1ad → 0.0.0-main-b11f62bc
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/bundles/catenv/index.js +38 -45
- package/dist/bundles/cli/index.js +155 -82
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.d.ts +3 -0
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js +58 -0
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js.map +1 -0
- package/dist/cli/src/apps/cli/commands/project/index.js +2 -0
- package/dist/cli/src/apps/cli/commands/project/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js +43 -37
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -1
- package/dist/pipeline/src/pipeline/createAllJobs.d.ts +6 -6
- package/dist/pipeline/src/pipeline/createAllJobs.js +7 -19
- package/dist/pipeline/src/pipeline/createAllJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/createMainPipeline.js +2 -2
- package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.d.ts +4 -4
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +26 -24
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.d.ts +2 -0
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js +3 -0
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/pipeline/src/types/context.d.ts +1 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/cli/commands/project/commandRenewToken.ts +12 -0
- package/src/apps/cli/commands/project/index.ts +2 -0
- package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +48 -35
|
@@ -7427,17 +7427,6 @@ exports["default"] = ownPkg;
|
|
|
7427
7427
|
|
|
7428
7428
|
"use strict";
|
|
7429
7429
|
|
|
7430
|
-
var __assign = (this && this.__assign) || function () {
|
|
7431
|
-
__assign = Object.assign || function(t) {
|
|
7432
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7433
|
-
s = arguments[i];
|
|
7434
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7435
|
-
t[p] = s[p];
|
|
7436
|
-
}
|
|
7437
|
-
return t;
|
|
7438
|
-
};
|
|
7439
|
-
return __assign.apply(this, arguments);
|
|
7440
|
-
};
|
|
7441
7430
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7442
7431
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7443
7432
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -7523,14 +7512,13 @@ var createAllJobs = function (_a) { return __awaiter(void 0, [_a], void 0, funct
|
|
|
7523
7512
|
})];
|
|
7524
7513
|
case 1:
|
|
7525
7514
|
allComponentContext = _c.sent();
|
|
7526
|
-
return [2 /*return*/, allComponentContext.
|
|
7527
|
-
var
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
}, {})];
|
|
7515
|
+
return [2 /*return*/, allComponentContext.map(function (_a) {
|
|
7516
|
+
var context = _a.context;
|
|
7517
|
+
return ({
|
|
7518
|
+
context: context,
|
|
7519
|
+
jobs: (0, createJobsForComponent_1.createJobsForComponentContext)(context),
|
|
7520
|
+
});
|
|
7521
|
+
})];
|
|
7534
7522
|
}
|
|
7535
7523
|
});
|
|
7536
7524
|
}); };
|
|
@@ -7819,8 +7807,8 @@ var createMainPipeline = function (pipelineType, config) { return __awaiter(void
|
|
|
7819
7807
|
// this is purely for better readability in git diffs when you add new components
|
|
7820
7808
|
.sort(function (a, b) {
|
|
7821
7809
|
var componentNames = Object.keys(config.components);
|
|
7822
|
-
var aIndex = componentNames.findIndex(function (c) { return c === a.componentName; });
|
|
7823
|
-
var bIndex = componentNames.findIndex(function (c) { return c === b.componentName; });
|
|
7810
|
+
var aIndex = componentNames.findIndex(function (c) { return c === a.context.componentName; });
|
|
7811
|
+
var bIndex = componentNames.findIndex(function (c) { return c === b.context.componentName; });
|
|
7824
7812
|
return aIndex - bIndex;
|
|
7825
7813
|
})
|
|
7826
7814
|
.reduce(function (acc, _a) {
|
|
@@ -8150,7 +8138,8 @@ var getFullJobName = function (name, componentName, env) {
|
|
|
8150
8138
|
};
|
|
8151
8139
|
var getFullReferencedJobName = function (referencedJobName, componentName, env, allJobs) {
|
|
8152
8140
|
var _a, _b;
|
|
8153
|
-
var referencedJob = (_b = (_a = allJobs
|
|
8141
|
+
var referencedJob = (_b = (_a = allJobs
|
|
8142
|
+
.find(function (j) { return j.context.componentName === componentName && j.context.env === env; })) === null || _a === void 0 ? void 0 : _a.jobs) === null || _b === void 0 ? void 0 : _b.find(function (j) { return j.name === referencedJobName; });
|
|
8154
8143
|
if (!referencedJob) {
|
|
8155
8144
|
throw new Error("unknown job referenced: '".concat(referencedJobName, "' from '").concat(env, ":").concat(componentName, "'"));
|
|
8156
8145
|
}
|
|
@@ -8160,14 +8149,19 @@ var getFullReferencedJobName = function (referencedJobName, componentName, env,
|
|
|
8160
8149
|
var getJobName = function (need) {
|
|
8161
8150
|
return (0, lodash_1.isObject)(need) ? need.job : need;
|
|
8162
8151
|
};
|
|
8163
|
-
var makeGitlabJob = function (
|
|
8152
|
+
var makeGitlabJob = function (context, _a, allJobs, baseRules) {
|
|
8164
8153
|
var _b, _c;
|
|
8165
|
-
var environment = _a.environment, envMode = _a.envMode, needsStages = _a.needsStages, needsOtherComponent = _a.needsOtherComponent, name = _a.name, needs = _a.needs, jobTags = _a.jobTags, script = _a.script,
|
|
8166
|
-
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
8154
|
+
var environment = _a.environment, envMode = _a.envMode, needsStages = _a.needsStages, needsOtherComponent = _a.needsOtherComponent, name = _a.name, needs = _a.needs, jobTags = _a.jobTags, script = _a.script, variables = _a.variables, runnerVariables = _a.runnerVariables, when = _a.when, job = __rest(_a, ["environment", "envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags", "script", "variables", "runnerVariables", "when"]);
|
|
8155
|
+
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(context.env) : job.stage;
|
|
8167
8156
|
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
8168
|
-
var _a, _b, _c
|
|
8169
|
-
var referencedComponentName = componentName;
|
|
8170
|
-
var allJobNamesFromThatStage = (
|
|
8157
|
+
var _a, _b, _c;
|
|
8158
|
+
var referencedComponentName = context.componentName;
|
|
8159
|
+
var allJobNamesFromThatStage = (_c = (_b = (_a = allJobs
|
|
8160
|
+
.filter(function (j) {
|
|
8161
|
+
return j.context.componentName === referencedComponentName &&
|
|
8162
|
+
j.context.env === context.env;
|
|
8163
|
+
})
|
|
8164
|
+
.flatMap(function (j) { return j.jobs; })) === null || _a === void 0 ? void 0 : _a.filter(function (j) { return j.stage === n.stage; })) === null || _b === void 0 ? void 0 : _b.map(function (j) { return j.name; })) !== null && _c !== void 0 ? _c : [];
|
|
8171
8165
|
return allJobNamesFromThatStage.map(function (job) {
|
|
8172
8166
|
var _a;
|
|
8173
8167
|
return ({
|
|
@@ -8182,13 +8176,13 @@ var makeGitlabJob = function (componentName, env, _a, allJobs, baseRules) {
|
|
|
8182
8176
|
var _a;
|
|
8183
8177
|
return (0, lodash_1.isObject)(n)
|
|
8184
8178
|
? {
|
|
8185
|
-
job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
|
|
8179
|
+
job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : context.componentName, context.env, allJobs),
|
|
8186
8180
|
artifacts: n.artifacts,
|
|
8187
8181
|
}
|
|
8188
|
-
: getFullReferencedJobName(n, componentName, env, allJobs);
|
|
8182
|
+
: getFullReferencedJobName(n, context.componentName, context.env, allJobs);
|
|
8189
8183
|
}).sort(function (a, b) { return getJobName(a).localeCompare(getJobName(b)); });
|
|
8190
8184
|
var deduplicatedGitlabNeeds = __spreadArray([], __read(new Map(gitlabNeeds.map(function (n) { return [(0, lodash_1.isObject)(n) ? n.job : n, n]; })).values()), false);
|
|
8191
|
-
var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
|
|
8185
|
+
var fullJobName = getFullJobName(name, context.componentName, envMode !== "none" ? context.env : undefined);
|
|
8192
8186
|
// backwards compatibility, some may still use KUBERNETES_CPU_REQUEST, KUBERNETES_MEMORY_REQUEST, etc. in variables.
|
|
8193
8187
|
// those should now be set in the runnerVariables as they don't work in the variables key of the catladder job, becuase those get injected
|
|
8194
8188
|
var PIPELINE_RUNNER_VARIABLES = [
|
|
@@ -8218,7 +8212,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs, baseRules) {
|
|
|
8218
8212
|
: [])), false);
|
|
8219
8213
|
var modified = addGitlabEnvironment(context, environment, __assign(__assign({}, job), { rules: rules.length > 0 ? rules : undefined, variables: __assign(__assign({}, legacyRunnerVariables), runnerVariables), script: __spreadArray(__spreadArray([], __read(varsInjectScripts), false), __read(((_c = script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil)) !== null && _c !== void 0 ? _c : [])), false), tags: jobTags, stage: stage,
|
|
8220
8214
|
// sort in a predictable manner for snapshot tests
|
|
8221
|
-
needs: deduplicatedGitlabNeeds, retry: defaults_1.BASE_RETRY, interruptible: true }), componentName, env, allJobs);
|
|
8215
|
+
needs: deduplicatedGitlabNeeds, retry: defaults_1.BASE_RETRY, interruptible: true }), context.componentName, context.env, allJobs);
|
|
8222
8216
|
return [fullJobName, (0, removeUndefined_1.removeUndefined)(modified)];
|
|
8223
8217
|
};
|
|
8224
8218
|
exports.makeGitlabJob = makeGitlabJob;
|
|
@@ -8251,19 +8245,15 @@ allJobs) {
|
|
|
8251
8245
|
};
|
|
8252
8246
|
var createGitlabJobs = function (allJobs, baseRules) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8253
8247
|
return __generator(this, function (_a) {
|
|
8254
|
-
return [2 /*return*/,
|
|
8255
|
-
var
|
|
8256
|
-
return
|
|
8257
|
-
var
|
|
8258
|
-
return
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
componentName: componentName,
|
|
8264
|
-
env: env,
|
|
8265
|
-
};
|
|
8266
|
-
});
|
|
8248
|
+
return [2 /*return*/, allJobs.flatMap(function (_a) {
|
|
8249
|
+
var context = _a.context, jobs = _a.jobs;
|
|
8250
|
+
return jobs.map(function (job) {
|
|
8251
|
+
var _a = __read((0, exports.makeGitlabJob)(context, job, allJobs, baseRules), 2), fullJobName = _a[0], gitlabJob = _a[1];
|
|
8252
|
+
return {
|
|
8253
|
+
name: fullJobName,
|
|
8254
|
+
gitlabJob: gitlabJob,
|
|
8255
|
+
context: context,
|
|
8256
|
+
};
|
|
8267
8257
|
});
|
|
8268
8258
|
})];
|
|
8269
8259
|
});
|
|
@@ -8360,6 +8350,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8360
8350
|
exports.getGitlabReleaseJobs = void 0;
|
|
8361
8351
|
var rules_1 = __nccwpck_require__(7551);
|
|
8362
8352
|
var runner_1 = __nccwpck_require__(4058);
|
|
8353
|
+
var EXPIRED_TOKEN_HELP = "echo '👉 The project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";
|
|
8363
8354
|
var getGitlabReleaseJobs = function () {
|
|
8364
8355
|
var _a;
|
|
8365
8356
|
return _a = {},
|
|
@@ -8367,12 +8358,14 @@ var getGitlabReleaseJobs = function () {
|
|
|
8367
8358
|
stage: "release",
|
|
8368
8359
|
image: (0, runner_1.getRunnerImage)("semantic-release"),
|
|
8369
8360
|
script: ["semanticRelease"],
|
|
8361
|
+
after_script: [EXPIRED_TOKEN_HELP],
|
|
8370
8362
|
rules: rules_1.RULES_RELEASE,
|
|
8371
8363
|
},
|
|
8372
8364
|
_a["⚠️ force create release"] = {
|
|
8373
8365
|
stage: "release",
|
|
8374
8366
|
image: (0, runner_1.getRunnerImage)("semantic-release"),
|
|
8375
8367
|
script: ["semanticRelease"],
|
|
8368
|
+
after_script: [EXPIRED_TOKEN_HELP],
|
|
8376
8369
|
needs: [],
|
|
8377
8370
|
rules: rules_1.RULES_MANUAL_RELEASE,
|
|
8378
8371
|
},
|
|
@@ -4440,6 +4440,71 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
4440
4440
|
|
|
4441
4441
|
/***/ }),
|
|
4442
4442
|
|
|
4443
|
+
/***/ 67426:
|
|
4444
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4445
|
+
|
|
4446
|
+
"use strict";
|
|
4447
|
+
|
|
4448
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4449
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4450
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4451
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4452
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
4453
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
4454
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4455
|
+
});
|
|
4456
|
+
};
|
|
4457
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
4458
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4459
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4460
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
4461
|
+
function step(op) {
|
|
4462
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
4463
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
4464
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
4465
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
4466
|
+
switch (op[0]) {
|
|
4467
|
+
case 0: case 1: t = op; break;
|
|
4468
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
4469
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
4470
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
4471
|
+
default:
|
|
4472
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
4473
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
4474
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
4475
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
4476
|
+
if (t[2]) _.ops.pop();
|
|
4477
|
+
_.trys.pop(); continue;
|
|
4478
|
+
}
|
|
4479
|
+
op = body.call(thisArg, _);
|
|
4480
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
4481
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
4482
|
+
}
|
|
4483
|
+
};
|
|
4484
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4485
|
+
var setupAccessTokens_1 = __nccwpck_require__(84195);
|
|
4486
|
+
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4487
|
+
return __generator(this, function (_a) {
|
|
4488
|
+
return [2 /*return*/, vorpal
|
|
4489
|
+
.command("project-renew-token", "Configures the project access token for semantic release.")
|
|
4490
|
+
.action(function () {
|
|
4491
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4492
|
+
return __generator(this, function (_a) {
|
|
4493
|
+
switch (_a.label) {
|
|
4494
|
+
case 0: return [4 /*yield*/, (0, setupAccessTokens_1.setupAccessTokens)(this)];
|
|
4495
|
+
case 1:
|
|
4496
|
+
_a.sent();
|
|
4497
|
+
return [2 /*return*/];
|
|
4498
|
+
}
|
|
4499
|
+
});
|
|
4500
|
+
});
|
|
4501
|
+
})];
|
|
4502
|
+
});
|
|
4503
|
+
}); });
|
|
4504
|
+
//# sourceMappingURL=commandRenewToken.js.map
|
|
4505
|
+
|
|
4506
|
+
/***/ }),
|
|
4507
|
+
|
|
4443
4508
|
/***/ 40695:
|
|
4444
4509
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4445
4510
|
|
|
@@ -4913,6 +4978,7 @@ var commandGetMyTotalWorktime_1 = __importDefault(__nccwpck_require__(54132));
|
|
|
4913
4978
|
var commandGetShell_1 = __importDefault(__nccwpck_require__(57623));
|
|
4914
4979
|
var commandGitlabCi_1 = __importDefault(__nccwpck_require__(21942));
|
|
4915
4980
|
var commandSetup_1 = __importDefault(__nccwpck_require__(94092));
|
|
4981
|
+
var commandRenewToken_1 = __importDefault(__nccwpck_require__(67426));
|
|
4916
4982
|
var commandListPods_1 = __importDefault(__nccwpck_require__(14180));
|
|
4917
4983
|
var commandMigrateHelm3_1 = __importDefault(__nccwpck_require__(59694));
|
|
4918
4984
|
var commandNamespace_1 = __importDefault(__nccwpck_require__(17805));
|
|
@@ -4932,6 +4998,7 @@ var commandSecurityEvaluate_1 = __importDefault(__nccwpck_require__(82620));
|
|
|
4932
4998
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4933
4999
|
return __generator(this, function (_a) {
|
|
4934
5000
|
(0, commandSetup_1.default)(vorpal);
|
|
5001
|
+
(0, commandRenewToken_1.default)(vorpal);
|
|
4935
5002
|
(0, commandEnvVars_1.default)(vorpal);
|
|
4936
5003
|
(0, commandNamespace_1.default)(vorpal);
|
|
4937
5004
|
(0, commandListPods_1.default)(vorpal);
|
|
@@ -5149,62 +5216,68 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5149
5216
|
};
|
|
5150
5217
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5151
5218
|
exports.setupAccessTokens = void 0;
|
|
5152
|
-
var
|
|
5219
|
+
var dayjs_1 = __importDefault(__nccwpck_require__(66942));
|
|
5153
5220
|
var gitlab_1 = __nccwpck_require__(12927);
|
|
5221
|
+
var TOKEN_NAME = "semantic-release";
|
|
5154
5222
|
var setupAccessTokens = function (instance) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5155
|
-
var
|
|
5223
|
+
var projectId, projectTokens, token, expires_at, newToken, _a, e_1;
|
|
5156
5224
|
return __generator(this, function (_b) {
|
|
5157
5225
|
switch (_b.label) {
|
|
5158
5226
|
case 0: return [4 /*yield*/, (0, gitlab_1.getProjectInfo)(instance)];
|
|
5159
5227
|
case 1:
|
|
5160
|
-
|
|
5161
|
-
|
|
5228
|
+
projectId = (_b.sent()).id;
|
|
5229
|
+
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId, "/access_tokens"))];
|
|
5162
5230
|
case 2:
|
|
5163
|
-
_b.
|
|
5164
|
-
|
|
5231
|
+
projectTokens = _b.sent();
|
|
5232
|
+
token = projectTokens.find(function (t) { return t.name === TOKEN_NAME && t.active === true; });
|
|
5233
|
+
expires_at = (0, dayjs_1.default)()
|
|
5234
|
+
.add(1, "year")
|
|
5235
|
+
.subtract(1, "day")
|
|
5236
|
+
.format("YYYY-MM-DD");
|
|
5237
|
+
if (!token) return [3 /*break*/, 4];
|
|
5238
|
+
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId, "/access_tokens/").concat(token.id, "/rotate"), { expires_at: expires_at }, "POST")];
|
|
5165
5239
|
case 3:
|
|
5240
|
+
_a = _b.sent();
|
|
5241
|
+
return [3 /*break*/, 6];
|
|
5242
|
+
case 4: return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId, "/access_tokens"), {
|
|
5243
|
+
name: TOKEN_NAME,
|
|
5244
|
+
scopes: ["api", "read_repository"],
|
|
5245
|
+
access_level: 40, // Maintainer
|
|
5246
|
+
expires_at: expires_at,
|
|
5247
|
+
}, "POST")];
|
|
5248
|
+
case 5:
|
|
5249
|
+
_a = _b.sent();
|
|
5250
|
+
_b.label = 6;
|
|
5251
|
+
case 6:
|
|
5252
|
+
newToken = _a;
|
|
5253
|
+
_b.label = 7;
|
|
5254
|
+
case 7:
|
|
5255
|
+
_b.trys.push([7, 10, , 12]);
|
|
5256
|
+
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId, "/variables/GL_TOKEN"))];
|
|
5257
|
+
case 8:
|
|
5166
5258
|
_b.sent();
|
|
5167
|
-
return [
|
|
5168
|
-
case
|
|
5259
|
+
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId, "/variables/GL_TOKEN"), { value: newToken.token }, "PUT")];
|
|
5260
|
+
case 9:
|
|
5261
|
+
_b.sent();
|
|
5262
|
+
return [3 /*break*/, 12];
|
|
5263
|
+
case 10:
|
|
5169
5264
|
e_1 = _b.sent();
|
|
5170
5265
|
if (e_1.message !== "not found") {
|
|
5171
5266
|
throw e_1;
|
|
5172
5267
|
}
|
|
5173
5268
|
// not found
|
|
5174
|
-
instance.log("I need add a GL_TOKEN to the project, so that semantic release will work\n");
|
|
5175
|
-
instance.log("👉 Please please create a project access token in gitlab and copy its value into clipboard\n\n - name: something like 'semantic-release'\n - expires: leave empty\n - role: maintainer - scopes: api, read_repository");
|
|
5176
|
-
instance.log("\n");
|
|
5177
|
-
return [4 /*yield*/, instance.prompt({
|
|
5178
|
-
default: true,
|
|
5179
|
-
message: "Understood and open gitlab now? 🤔",
|
|
5180
|
-
name: "understood",
|
|
5181
|
-
type: "confirm",
|
|
5182
|
-
})];
|
|
5183
|
-
case 5:
|
|
5184
|
-
understood = (_b.sent()).understood;
|
|
5185
|
-
if (!understood) {
|
|
5186
|
-
instance.log("continuing anyway...");
|
|
5187
|
-
}
|
|
5188
|
-
(0, open_1.default)("".concat(projectWebUrl, "/-/settings/access_tokens"));
|
|
5189
|
-
instance.log("\n");
|
|
5190
|
-
instance.log("Enter your copied token now: ");
|
|
5191
|
-
instance.log("\n");
|
|
5192
|
-
return [4 /*yield*/, instance.prompt({
|
|
5193
|
-
type: "password",
|
|
5194
|
-
name: "GL_TOKEN",
|
|
5195
|
-
message: "Access Token: ",
|
|
5196
|
-
})];
|
|
5197
|
-
case 6:
|
|
5198
|
-
GL_TOKEN = (_b.sent()).GL_TOKEN;
|
|
5199
5269
|
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId, "/variables"), {
|
|
5200
5270
|
key: "GL_TOKEN",
|
|
5201
|
-
value:
|
|
5271
|
+
value: newToken.token,
|
|
5202
5272
|
masked: true,
|
|
5203
5273
|
}, "POST")];
|
|
5204
|
-
case
|
|
5274
|
+
case 11:
|
|
5275
|
+
// not found
|
|
5205
5276
|
_b.sent();
|
|
5206
|
-
return [3 /*break*/,
|
|
5207
|
-
case
|
|
5277
|
+
return [3 /*break*/, 12];
|
|
5278
|
+
case 12:
|
|
5279
|
+
instance.log("Token configured for semantic release. Renew me again in a year!");
|
|
5280
|
+
return [2 /*return*/];
|
|
5208
5281
|
}
|
|
5209
5282
|
});
|
|
5210
5283
|
}); };
|
|
@@ -14873,17 +14946,6 @@ exports["default"] = ownPkg;
|
|
|
14873
14946
|
|
|
14874
14947
|
"use strict";
|
|
14875
14948
|
|
|
14876
|
-
var __assign = (this && this.__assign) || function () {
|
|
14877
|
-
__assign = Object.assign || function(t) {
|
|
14878
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14879
|
-
s = arguments[i];
|
|
14880
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14881
|
-
t[p] = s[p];
|
|
14882
|
-
}
|
|
14883
|
-
return t;
|
|
14884
|
-
};
|
|
14885
|
-
return __assign.apply(this, arguments);
|
|
14886
|
-
};
|
|
14887
14949
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14888
14950
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14889
14951
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14969,14 +15031,13 @@ var createAllJobs = function (_a) { return __awaiter(void 0, [_a], void 0, funct
|
|
|
14969
15031
|
})];
|
|
14970
15032
|
case 1:
|
|
14971
15033
|
allComponentContext = _c.sent();
|
|
14972
|
-
return [2 /*return*/, allComponentContext.
|
|
14973
|
-
var
|
|
14974
|
-
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
}, {})];
|
|
15034
|
+
return [2 /*return*/, allComponentContext.map(function (_a) {
|
|
15035
|
+
var context = _a.context;
|
|
15036
|
+
return ({
|
|
15037
|
+
context: context,
|
|
15038
|
+
jobs: (0, createJobsForComponent_1.createJobsForComponentContext)(context),
|
|
15039
|
+
});
|
|
15040
|
+
})];
|
|
14980
15041
|
}
|
|
14981
15042
|
});
|
|
14982
15043
|
}); };
|
|
@@ -15265,8 +15326,8 @@ var createMainPipeline = function (pipelineType, config) { return __awaiter(void
|
|
|
15265
15326
|
// this is purely for better readability in git diffs when you add new components
|
|
15266
15327
|
.sort(function (a, b) {
|
|
15267
15328
|
var componentNames = Object.keys(config.components);
|
|
15268
|
-
var aIndex = componentNames.findIndex(function (c) { return c === a.componentName; });
|
|
15269
|
-
var bIndex = componentNames.findIndex(function (c) { return c === b.componentName; });
|
|
15329
|
+
var aIndex = componentNames.findIndex(function (c) { return c === a.context.componentName; });
|
|
15330
|
+
var bIndex = componentNames.findIndex(function (c) { return c === b.context.componentName; });
|
|
15270
15331
|
return aIndex - bIndex;
|
|
15271
15332
|
})
|
|
15272
15333
|
.reduce(function (acc, _a) {
|
|
@@ -15596,7 +15657,8 @@ var getFullJobName = function (name, componentName, env) {
|
|
|
15596
15657
|
};
|
|
15597
15658
|
var getFullReferencedJobName = function (referencedJobName, componentName, env, allJobs) {
|
|
15598
15659
|
var _a, _b;
|
|
15599
|
-
var referencedJob = (_b = (_a = allJobs
|
|
15660
|
+
var referencedJob = (_b = (_a = allJobs
|
|
15661
|
+
.find(function (j) { return j.context.componentName === componentName && j.context.env === env; })) === null || _a === void 0 ? void 0 : _a.jobs) === null || _b === void 0 ? void 0 : _b.find(function (j) { return j.name === referencedJobName; });
|
|
15600
15662
|
if (!referencedJob) {
|
|
15601
15663
|
throw new Error("unknown job referenced: '".concat(referencedJobName, "' from '").concat(env, ":").concat(componentName, "'"));
|
|
15602
15664
|
}
|
|
@@ -15606,14 +15668,19 @@ var getFullReferencedJobName = function (referencedJobName, componentName, env,
|
|
|
15606
15668
|
var getJobName = function (need) {
|
|
15607
15669
|
return (0, lodash_1.isObject)(need) ? need.job : need;
|
|
15608
15670
|
};
|
|
15609
|
-
var makeGitlabJob = function (
|
|
15671
|
+
var makeGitlabJob = function (context, _a, allJobs, baseRules) {
|
|
15610
15672
|
var _b, _c;
|
|
15611
|
-
var environment = _a.environment, envMode = _a.envMode, needsStages = _a.needsStages, needsOtherComponent = _a.needsOtherComponent, name = _a.name, needs = _a.needs, jobTags = _a.jobTags, script = _a.script,
|
|
15612
|
-
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
15673
|
+
var environment = _a.environment, envMode = _a.envMode, needsStages = _a.needsStages, needsOtherComponent = _a.needsOtherComponent, name = _a.name, needs = _a.needs, jobTags = _a.jobTags, script = _a.script, variables = _a.variables, runnerVariables = _a.runnerVariables, when = _a.when, job = __rest(_a, ["environment", "envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags", "script", "variables", "runnerVariables", "when"]);
|
|
15674
|
+
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(context.env) : job.stage;
|
|
15613
15675
|
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
15614
|
-
var _a, _b, _c
|
|
15615
|
-
var referencedComponentName = componentName;
|
|
15616
|
-
var allJobNamesFromThatStage = (
|
|
15676
|
+
var _a, _b, _c;
|
|
15677
|
+
var referencedComponentName = context.componentName;
|
|
15678
|
+
var allJobNamesFromThatStage = (_c = (_b = (_a = allJobs
|
|
15679
|
+
.filter(function (j) {
|
|
15680
|
+
return j.context.componentName === referencedComponentName &&
|
|
15681
|
+
j.context.env === context.env;
|
|
15682
|
+
})
|
|
15683
|
+
.flatMap(function (j) { return j.jobs; })) === null || _a === void 0 ? void 0 : _a.filter(function (j) { return j.stage === n.stage; })) === null || _b === void 0 ? void 0 : _b.map(function (j) { return j.name; })) !== null && _c !== void 0 ? _c : [];
|
|
15617
15684
|
return allJobNamesFromThatStage.map(function (job) {
|
|
15618
15685
|
var _a;
|
|
15619
15686
|
return ({
|
|
@@ -15628,13 +15695,13 @@ var makeGitlabJob = function (componentName, env, _a, allJobs, baseRules) {
|
|
|
15628
15695
|
var _a;
|
|
15629
15696
|
return (0, lodash_1.isObject)(n)
|
|
15630
15697
|
? {
|
|
15631
|
-
job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
|
|
15698
|
+
job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : context.componentName, context.env, allJobs),
|
|
15632
15699
|
artifacts: n.artifacts,
|
|
15633
15700
|
}
|
|
15634
|
-
: getFullReferencedJobName(n, componentName, env, allJobs);
|
|
15701
|
+
: getFullReferencedJobName(n, context.componentName, context.env, allJobs);
|
|
15635
15702
|
}).sort(function (a, b) { return getJobName(a).localeCompare(getJobName(b)); });
|
|
15636
15703
|
var deduplicatedGitlabNeeds = __spreadArray([], __read(new Map(gitlabNeeds.map(function (n) { return [(0, lodash_1.isObject)(n) ? n.job : n, n]; })).values()), false);
|
|
15637
|
-
var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
|
|
15704
|
+
var fullJobName = getFullJobName(name, context.componentName, envMode !== "none" ? context.env : undefined);
|
|
15638
15705
|
// backwards compatibility, some may still use KUBERNETES_CPU_REQUEST, KUBERNETES_MEMORY_REQUEST, etc. in variables.
|
|
15639
15706
|
// those should now be set in the runnerVariables as they don't work in the variables key of the catladder job, becuase those get injected
|
|
15640
15707
|
var PIPELINE_RUNNER_VARIABLES = [
|
|
@@ -15664,7 +15731,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs, baseRules) {
|
|
|
15664
15731
|
: [])), false);
|
|
15665
15732
|
var modified = addGitlabEnvironment(context, environment, __assign(__assign({}, job), { rules: rules.length > 0 ? rules : undefined, variables: __assign(__assign({}, legacyRunnerVariables), runnerVariables), script: __spreadArray(__spreadArray([], __read(varsInjectScripts), false), __read(((_c = script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil)) !== null && _c !== void 0 ? _c : [])), false), tags: jobTags, stage: stage,
|
|
15666
15733
|
// sort in a predictable manner for snapshot tests
|
|
15667
|
-
needs: deduplicatedGitlabNeeds, retry: defaults_1.BASE_RETRY, interruptible: true }), componentName, env, allJobs);
|
|
15734
|
+
needs: deduplicatedGitlabNeeds, retry: defaults_1.BASE_RETRY, interruptible: true }), context.componentName, context.env, allJobs);
|
|
15668
15735
|
return [fullJobName, (0, removeUndefined_1.removeUndefined)(modified)];
|
|
15669
15736
|
};
|
|
15670
15737
|
exports.makeGitlabJob = makeGitlabJob;
|
|
@@ -15697,19 +15764,15 @@ allJobs) {
|
|
|
15697
15764
|
};
|
|
15698
15765
|
var createGitlabJobs = function (allJobs, baseRules) { return __awaiter(void 0, void 0, void 0, function () {
|
|
15699
15766
|
return __generator(this, function (_a) {
|
|
15700
|
-
return [2 /*return*/,
|
|
15701
|
-
var
|
|
15702
|
-
return
|
|
15703
|
-
var
|
|
15704
|
-
return
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
componentName: componentName,
|
|
15710
|
-
env: env,
|
|
15711
|
-
};
|
|
15712
|
-
});
|
|
15767
|
+
return [2 /*return*/, allJobs.flatMap(function (_a) {
|
|
15768
|
+
var context = _a.context, jobs = _a.jobs;
|
|
15769
|
+
return jobs.map(function (job) {
|
|
15770
|
+
var _a = __read((0, exports.makeGitlabJob)(context, job, allJobs, baseRules), 2), fullJobName = _a[0], gitlabJob = _a[1];
|
|
15771
|
+
return {
|
|
15772
|
+
name: fullJobName,
|
|
15773
|
+
gitlabJob: gitlabJob,
|
|
15774
|
+
context: context,
|
|
15775
|
+
};
|
|
15713
15776
|
});
|
|
15714
15777
|
})];
|
|
15715
15778
|
});
|
|
@@ -15806,6 +15869,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
15806
15869
|
exports.getGitlabReleaseJobs = void 0;
|
|
15807
15870
|
var rules_1 = __nccwpck_require__(47551);
|
|
15808
15871
|
var runner_1 = __nccwpck_require__(4058);
|
|
15872
|
+
var EXPIRED_TOKEN_HELP = "echo '👉 The project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";
|
|
15809
15873
|
var getGitlabReleaseJobs = function () {
|
|
15810
15874
|
var _a;
|
|
15811
15875
|
return _a = {},
|
|
@@ -15813,12 +15877,14 @@ var getGitlabReleaseJobs = function () {
|
|
|
15813
15877
|
stage: "release",
|
|
15814
15878
|
image: (0, runner_1.getRunnerImage)("semantic-release"),
|
|
15815
15879
|
script: ["semanticRelease"],
|
|
15880
|
+
after_script: [EXPIRED_TOKEN_HELP],
|
|
15816
15881
|
rules: rules_1.RULES_RELEASE,
|
|
15817
15882
|
},
|
|
15818
15883
|
_a["⚠️ force create release"] = {
|
|
15819
15884
|
stage: "release",
|
|
15820
15885
|
image: (0, runner_1.getRunnerImage)("semantic-release"),
|
|
15821
15886
|
script: ["semanticRelease"],
|
|
15887
|
+
after_script: [EXPIRED_TOKEN_HELP],
|
|
15822
15888
|
needs: [],
|
|
15823
15889
|
rules: rules_1.RULES_MANUAL_RELEASE,
|
|
15824
15890
|
},
|
|
@@ -153301,6 +153367,13 @@ var _undefined = void 0;
|
|
|
153301
153367
|
module.exports = function (value) { return value !== _undefined && value !== null; };
|
|
153302
153368
|
|
|
153303
153369
|
|
|
153370
|
+
/***/ }),
|
|
153371
|
+
|
|
153372
|
+
/***/ 66942:
|
|
153373
|
+
/***/ (function(module) {
|
|
153374
|
+
|
|
153375
|
+
!function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else{var i=t.name;v[i]=t,r=i}return!n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
|
|
153376
|
+
|
|
153304
153377
|
/***/ }),
|
|
153305
153378
|
|
|
153306
153379
|
/***/ 22060:
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var setupAccessTokens_1 = require("./setup/setupAccessTokens");
|
|
40
|
+
exports.default = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
+
return __generator(this, function (_a) {
|
|
42
|
+
return [2 /*return*/, vorpal
|
|
43
|
+
.command("project-renew-token", "Configures the project access token for semantic release.")
|
|
44
|
+
.action(function () {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
switch (_a.label) {
|
|
48
|
+
case 0: return [4 /*yield*/, (0, setupAccessTokens_1.setupAccessTokens)(this)];
|
|
49
|
+
case 1:
|
|
50
|
+
_a.sent();
|
|
51
|
+
return [2 /*return*/];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
})];
|
|
56
|
+
});
|
|
57
|
+
}); });
|
|
58
|
+
//# sourceMappingURL=commandRenewToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandRenewToken.js","sourceRoot":"","sources":["../../../../../../../src/apps/cli/commands/project/commandRenewToken.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAA8D;AAE9D,mBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CACN,qBAAqB,EACrB,2DAA2D,CAC5D;iBACA,MAAM,CAAC;;;;oCACN,qBAAM,IAAA,qCAAiB,EAAC,IAAI,CAAC,EAAA;;gCAA7B,SAA6B,CAAC;;;;;aAC/B,CAAC,EAAA;;KAAA,EAAC"}
|
|
@@ -48,6 +48,7 @@ var commandGetMyTotalWorktime_1 = __importDefault(require("./commandGetMyTotalWo
|
|
|
48
48
|
var commandGetShell_1 = __importDefault(require("./commandGetShell"));
|
|
49
49
|
var commandGitlabCi_1 = __importDefault(require("./commandGitlabCi"));
|
|
50
50
|
var commandSetup_1 = __importDefault(require("./commandSetup"));
|
|
51
|
+
var commandRenewToken_1 = __importDefault(require("./commandRenewToken"));
|
|
51
52
|
var commandListPods_1 = __importDefault(require("./commandListPods"));
|
|
52
53
|
var commandMigrateHelm3_1 = __importDefault(require("./commandMigrateHelm3"));
|
|
53
54
|
var commandNamespace_1 = __importDefault(require("./commandNamespace"));
|
|
@@ -67,6 +68,7 @@ var commandSecurityEvaluate_1 = __importDefault(require("./commandSecurityEvalua
|
|
|
67
68
|
exports.default = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
69
|
return __generator(this, function (_a) {
|
|
69
70
|
(0, commandSetup_1.default)(vorpal);
|
|
71
|
+
(0, commandRenewToken_1.default)(vorpal);
|
|
70
72
|
(0, commandEnvVars_1.default)(vorpal);
|
|
71
73
|
(0, commandNamespace_1.default)(vorpal);
|
|
72
74
|
(0, commandListPods_1.default)(vorpal);
|