@catladder/cli 0.0.0-main-bdf1fe37 → 0.0.0-main-259d7c70
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 +64 -89
- package/dist/bundles/cli/index.js +64 -89
- package/dist/pipeline/src/pipeline/createAllJobs.js +61 -38
- package/dist/pipeline/src/pipeline/createAllJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +3 -3
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +3 -51
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -7428,6 +7428,17 @@ exports["default"] = ownPkg;
|
|
|
7428
7428
|
|
|
7429
7429
|
"use strict";
|
|
7430
7430
|
|
|
7431
|
+
var __assign = (this && this.__assign) || function () {
|
|
7432
|
+
__assign = Object.assign || function(t) {
|
|
7433
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7434
|
+
s = arguments[i];
|
|
7435
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7436
|
+
t[p] = s[p];
|
|
7437
|
+
}
|
|
7438
|
+
return t;
|
|
7439
|
+
};
|
|
7440
|
+
return __assign.apply(this, arguments);
|
|
7441
|
+
};
|
|
7431
7442
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7432
7443
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7433
7444
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -7467,48 +7478,60 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
7467
7478
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7468
7479
|
exports.createAllJobs = void 0;
|
|
7469
7480
|
var config_1 = __nccwpck_require__(3352);
|
|
7481
|
+
var context_1 = __nccwpck_require__(5875);
|
|
7470
7482
|
var createJobsForComponent_1 = __nccwpck_require__(2321);
|
|
7471
|
-
var
|
|
7472
|
-
var _c, _d;
|
|
7483
|
+
var createAllComponentContext = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
7473
7484
|
var config = _b.config, trigger = _b.trigger, pipelineType = _b.pipelineType;
|
|
7474
|
-
return __generator(this, function (
|
|
7475
|
-
switch (
|
|
7476
|
-
case 0:
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
var
|
|
7480
|
-
return __generator(this, function (
|
|
7481
|
-
switch (
|
|
7482
|
-
case 0:
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
trigger: trigger,
|
|
7497
|
-
pipelineType: pipelineType,
|
|
7498
|
-
})];
|
|
7499
|
-
case 1: return [2 /*return*/, _a.concat([
|
|
7500
|
-
_b.sent()
|
|
7501
|
-
])];
|
|
7502
|
-
}
|
|
7503
|
-
});
|
|
7504
|
-
}); }))];
|
|
7505
|
-
case 1: return [2 /*return*/, _a.concat([
|
|
7506
|
-
_c.apply(_b, [_d.sent()])
|
|
7507
|
-
])];
|
|
7485
|
+
return __generator(this, function (_c) {
|
|
7486
|
+
switch (_c.label) {
|
|
7487
|
+
case 0: return [4 /*yield*/, Promise.all(Object.keys(config.components).flatMap(function (componentName) {
|
|
7488
|
+
var envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
7489
|
+
return envs.map(function (env) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7490
|
+
var context;
|
|
7491
|
+
return __generator(this, function (_a) {
|
|
7492
|
+
switch (_a.label) {
|
|
7493
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)({
|
|
7494
|
+
config: config,
|
|
7495
|
+
componentName: componentName,
|
|
7496
|
+
env: env,
|
|
7497
|
+
trigger: trigger,
|
|
7498
|
+
pipelineType: pipelineType,
|
|
7499
|
+
})];
|
|
7500
|
+
case 1:
|
|
7501
|
+
context = _a.sent();
|
|
7502
|
+
return [2 /*return*/, {
|
|
7503
|
+
env: env,
|
|
7504
|
+
componentName: componentName,
|
|
7505
|
+
context: context,
|
|
7506
|
+
}];
|
|
7508
7507
|
}
|
|
7509
7508
|
});
|
|
7510
|
-
}); })
|
|
7511
|
-
|
|
7509
|
+
}); });
|
|
7510
|
+
}))];
|
|
7511
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
7512
|
+
}
|
|
7513
|
+
});
|
|
7514
|
+
}); };
|
|
7515
|
+
var createAllJobs = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
7516
|
+
var allComponentContext;
|
|
7517
|
+
var config = _b.config, trigger = _b.trigger, pipelineType = _b.pipelineType;
|
|
7518
|
+
return __generator(this, function (_c) {
|
|
7519
|
+
switch (_c.label) {
|
|
7520
|
+
case 0: return [4 /*yield*/, createAllComponentContext({
|
|
7521
|
+
config: config,
|
|
7522
|
+
trigger: trigger,
|
|
7523
|
+
pipelineType: pipelineType,
|
|
7524
|
+
})];
|
|
7525
|
+
case 1:
|
|
7526
|
+
allComponentContext = _c.sent();
|
|
7527
|
+
return [2 /*return*/, allComponentContext.reduce(function (acc, _a) {
|
|
7528
|
+
var componentName = _a.componentName, env = _a.env, context = _a.context;
|
|
7529
|
+
if (!acc[componentName]) {
|
|
7530
|
+
acc[componentName] = {};
|
|
7531
|
+
}
|
|
7532
|
+
acc[componentName][env] = (0, createJobsForComponent_1.createJobsForComponentContext)(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); });
|
|
7533
|
+
return acc;
|
|
7534
|
+
}, {})];
|
|
7512
7535
|
}
|
|
7513
7536
|
});
|
|
7514
7537
|
}); };
|
|
@@ -7616,42 +7639,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
7616
7639
|
};
|
|
7617
7640
|
return __assign.apply(this, arguments);
|
|
7618
7641
|
};
|
|
7619
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7620
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7621
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7622
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7623
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7624
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7625
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7626
|
-
});
|
|
7627
|
-
};
|
|
7628
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
7629
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
7630
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
7631
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
7632
|
-
function step(op) {
|
|
7633
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
7634
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
7635
|
-
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;
|
|
7636
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
7637
|
-
switch (op[0]) {
|
|
7638
|
-
case 0: case 1: t = op; break;
|
|
7639
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
7640
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
7641
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
7642
|
-
default:
|
|
7643
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
7644
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
7645
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
7646
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
7647
|
-
if (t[2]) _.ops.pop();
|
|
7648
|
-
_.trys.pop(); continue;
|
|
7649
|
-
}
|
|
7650
|
-
op = body.call(thisArg, _);
|
|
7651
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
7652
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
7653
|
-
}
|
|
7654
|
-
};
|
|
7655
7642
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
7656
7643
|
var t = {};
|
|
7657
7644
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -7689,9 +7676,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7689
7676
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
7690
7677
|
};
|
|
7691
7678
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7692
|
-
exports.
|
|
7679
|
+
exports.createJobsForComponentContext = void 0;
|
|
7693
7680
|
var build_1 = __nccwpck_require__(7862);
|
|
7694
|
-
var context_1 = __nccwpck_require__(5875);
|
|
7695
7681
|
var deploy_1 = __nccwpck_require__(8483);
|
|
7696
7682
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
7697
7683
|
return jobs.map(function (_a) {
|
|
@@ -7707,7 +7693,7 @@ var getCustomJobs = function (context) {
|
|
|
7707
7693
|
var rawJobs = context.customJobs;
|
|
7708
7694
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
7709
7695
|
};
|
|
7710
|
-
var
|
|
7696
|
+
var createJobsForComponentContext = function (context) {
|
|
7711
7697
|
var _a, _b;
|
|
7712
7698
|
var buildJobs = build_1.BUILD_TYPES[context.build.config.type].jobs(context);
|
|
7713
7699
|
var deployJobs = ((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config)
|
|
@@ -7716,18 +7702,7 @@ var createRawJobs = function (context) {
|
|
|
7716
7702
|
var customJobs = getCustomJobs(context);
|
|
7717
7703
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
7718
7704
|
};
|
|
7719
|
-
|
|
7720
|
-
var context;
|
|
7721
|
-
return __generator(this, function (_a) {
|
|
7722
|
-
switch (_a.label) {
|
|
7723
|
-
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
7724
|
-
case 1:
|
|
7725
|
-
context = _a.sent();
|
|
7726
|
-
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
7727
|
-
}
|
|
7728
|
-
});
|
|
7729
|
-
}); };
|
|
7730
|
-
exports.createJobsForComponent = createJobsForComponent;
|
|
7705
|
+
exports.createJobsForComponentContext = createJobsForComponentContext;
|
|
7731
7706
|
//# sourceMappingURL=createJobsForComponent.js.map
|
|
7732
7707
|
|
|
7733
7708
|
/***/ }),
|
|
@@ -14872,6 +14872,17 @@ exports["default"] = ownPkg;
|
|
|
14872
14872
|
|
|
14873
14873
|
"use strict";
|
|
14874
14874
|
|
|
14875
|
+
var __assign = (this && this.__assign) || function () {
|
|
14876
|
+
__assign = Object.assign || function(t) {
|
|
14877
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14878
|
+
s = arguments[i];
|
|
14879
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14880
|
+
t[p] = s[p];
|
|
14881
|
+
}
|
|
14882
|
+
return t;
|
|
14883
|
+
};
|
|
14884
|
+
return __assign.apply(this, arguments);
|
|
14885
|
+
};
|
|
14875
14886
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14876
14887
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14877
14888
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14911,48 +14922,60 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14911
14922
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14912
14923
|
exports.createAllJobs = void 0;
|
|
14913
14924
|
var config_1 = __nccwpck_require__(13352);
|
|
14925
|
+
var context_1 = __nccwpck_require__(5875);
|
|
14914
14926
|
var createJobsForComponent_1 = __nccwpck_require__(92321);
|
|
14915
|
-
var
|
|
14916
|
-
var _c, _d;
|
|
14927
|
+
var createAllComponentContext = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
14917
14928
|
var config = _b.config, trigger = _b.trigger, pipelineType = _b.pipelineType;
|
|
14918
|
-
return __generator(this, function (
|
|
14919
|
-
switch (
|
|
14920
|
-
case 0:
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
var
|
|
14924
|
-
return __generator(this, function (
|
|
14925
|
-
switch (
|
|
14926
|
-
case 0:
|
|
14927
|
-
|
|
14928
|
-
|
|
14929
|
-
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
trigger: trigger,
|
|
14941
|
-
pipelineType: pipelineType,
|
|
14942
|
-
})];
|
|
14943
|
-
case 1: return [2 /*return*/, _a.concat([
|
|
14944
|
-
_b.sent()
|
|
14945
|
-
])];
|
|
14946
|
-
}
|
|
14947
|
-
});
|
|
14948
|
-
}); }))];
|
|
14949
|
-
case 1: return [2 /*return*/, _a.concat([
|
|
14950
|
-
_c.apply(_b, [_d.sent()])
|
|
14951
|
-
])];
|
|
14929
|
+
return __generator(this, function (_c) {
|
|
14930
|
+
switch (_c.label) {
|
|
14931
|
+
case 0: return [4 /*yield*/, Promise.all(Object.keys(config.components).flatMap(function (componentName) {
|
|
14932
|
+
var envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
14933
|
+
return envs.map(function (env) { return __awaiter(void 0, void 0, void 0, function () {
|
|
14934
|
+
var context;
|
|
14935
|
+
return __generator(this, function (_a) {
|
|
14936
|
+
switch (_a.label) {
|
|
14937
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)({
|
|
14938
|
+
config: config,
|
|
14939
|
+
componentName: componentName,
|
|
14940
|
+
env: env,
|
|
14941
|
+
trigger: trigger,
|
|
14942
|
+
pipelineType: pipelineType,
|
|
14943
|
+
})];
|
|
14944
|
+
case 1:
|
|
14945
|
+
context = _a.sent();
|
|
14946
|
+
return [2 /*return*/, {
|
|
14947
|
+
env: env,
|
|
14948
|
+
componentName: componentName,
|
|
14949
|
+
context: context,
|
|
14950
|
+
}];
|
|
14952
14951
|
}
|
|
14953
14952
|
});
|
|
14954
|
-
}); })
|
|
14955
|
-
|
|
14953
|
+
}); });
|
|
14954
|
+
}))];
|
|
14955
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
14956
|
+
}
|
|
14957
|
+
});
|
|
14958
|
+
}); };
|
|
14959
|
+
var createAllJobs = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
14960
|
+
var allComponentContext;
|
|
14961
|
+
var config = _b.config, trigger = _b.trigger, pipelineType = _b.pipelineType;
|
|
14962
|
+
return __generator(this, function (_c) {
|
|
14963
|
+
switch (_c.label) {
|
|
14964
|
+
case 0: return [4 /*yield*/, createAllComponentContext({
|
|
14965
|
+
config: config,
|
|
14966
|
+
trigger: trigger,
|
|
14967
|
+
pipelineType: pipelineType,
|
|
14968
|
+
})];
|
|
14969
|
+
case 1:
|
|
14970
|
+
allComponentContext = _c.sent();
|
|
14971
|
+
return [2 /*return*/, allComponentContext.reduce(function (acc, _a) {
|
|
14972
|
+
var componentName = _a.componentName, env = _a.env, context = _a.context;
|
|
14973
|
+
if (!acc[componentName]) {
|
|
14974
|
+
acc[componentName] = {};
|
|
14975
|
+
}
|
|
14976
|
+
acc[componentName][env] = (0, createJobsForComponent_1.createJobsForComponentContext)(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); });
|
|
14977
|
+
return acc;
|
|
14978
|
+
}, {})];
|
|
14956
14979
|
}
|
|
14957
14980
|
});
|
|
14958
14981
|
}); };
|
|
@@ -15060,42 +15083,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
15060
15083
|
};
|
|
15061
15084
|
return __assign.apply(this, arguments);
|
|
15062
15085
|
};
|
|
15063
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15064
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15065
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15066
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15067
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15068
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
15069
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15070
|
-
});
|
|
15071
|
-
};
|
|
15072
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15073
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15074
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15075
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15076
|
-
function step(op) {
|
|
15077
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
15078
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
15079
|
-
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;
|
|
15080
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
15081
|
-
switch (op[0]) {
|
|
15082
|
-
case 0: case 1: t = op; break;
|
|
15083
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
15084
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
15085
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
15086
|
-
default:
|
|
15087
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
15088
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
15089
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
15090
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
15091
|
-
if (t[2]) _.ops.pop();
|
|
15092
|
-
_.trys.pop(); continue;
|
|
15093
|
-
}
|
|
15094
|
-
op = body.call(thisArg, _);
|
|
15095
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
15096
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
15097
|
-
}
|
|
15098
|
-
};
|
|
15099
15086
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
15100
15087
|
var t = {};
|
|
15101
15088
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -15133,9 +15120,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
15133
15120
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
15134
15121
|
};
|
|
15135
15122
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15136
|
-
exports.
|
|
15123
|
+
exports.createJobsForComponentContext = void 0;
|
|
15137
15124
|
var build_1 = __nccwpck_require__(67862);
|
|
15138
|
-
var context_1 = __nccwpck_require__(5875);
|
|
15139
15125
|
var deploy_1 = __nccwpck_require__(68483);
|
|
15140
15126
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
15141
15127
|
return jobs.map(function (_a) {
|
|
@@ -15151,7 +15137,7 @@ var getCustomJobs = function (context) {
|
|
|
15151
15137
|
var rawJobs = context.customJobs;
|
|
15152
15138
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
15153
15139
|
};
|
|
15154
|
-
var
|
|
15140
|
+
var createJobsForComponentContext = function (context) {
|
|
15155
15141
|
var _a, _b;
|
|
15156
15142
|
var buildJobs = build_1.BUILD_TYPES[context.build.config.type].jobs(context);
|
|
15157
15143
|
var deployJobs = ((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config)
|
|
@@ -15160,18 +15146,7 @@ var createRawJobs = function (context) {
|
|
|
15160
15146
|
var customJobs = getCustomJobs(context);
|
|
15161
15147
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
15162
15148
|
};
|
|
15163
|
-
|
|
15164
|
-
var context;
|
|
15165
|
-
return __generator(this, function (_a) {
|
|
15166
|
-
switch (_a.label) {
|
|
15167
|
-
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
15168
|
-
case 1:
|
|
15169
|
-
context = _a.sent();
|
|
15170
|
-
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
15171
|
-
}
|
|
15172
|
-
});
|
|
15173
|
-
}); };
|
|
15174
|
-
exports.createJobsForComponent = createJobsForComponent;
|
|
15149
|
+
exports.createJobsForComponentContext = createJobsForComponentContext;
|
|
15175
15150
|
//# sourceMappingURL=createJobsForComponent.js.map
|
|
15176
15151
|
|
|
15177
15152
|
/***/ }),
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -38,48 +49,60 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
50
|
exports.createAllJobs = void 0;
|
|
40
51
|
var config_1 = require("../config");
|
|
52
|
+
var context_1 = require("../context");
|
|
41
53
|
var createJobsForComponent_1 = require("./createJobsForComponent");
|
|
42
|
-
var
|
|
43
|
-
var _c, _d;
|
|
54
|
+
var createAllComponentContext = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
44
55
|
var config = _b.config, trigger = _b.trigger, pipelineType = _b.pipelineType;
|
|
45
|
-
return __generator(this, function (
|
|
46
|
-
switch (
|
|
47
|
-
case 0:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
return __generator(this, function (
|
|
52
|
-
switch (
|
|
53
|
-
case 0:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
trigger: trigger,
|
|
68
|
-
pipelineType: pipelineType,
|
|
69
|
-
})];
|
|
70
|
-
case 1: return [2 /*return*/, _a.concat([
|
|
71
|
-
_b.sent()
|
|
72
|
-
])];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); }))];
|
|
76
|
-
case 1: return [2 /*return*/, _a.concat([
|
|
77
|
-
_c.apply(_b, [_d.sent()])
|
|
78
|
-
])];
|
|
56
|
+
return __generator(this, function (_c) {
|
|
57
|
+
switch (_c.label) {
|
|
58
|
+
case 0: return [4 /*yield*/, Promise.all(Object.keys(config.components).flatMap(function (componentName) {
|
|
59
|
+
var envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
60
|
+
return envs.map(function (env) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var context;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)({
|
|
65
|
+
config: config,
|
|
66
|
+
componentName: componentName,
|
|
67
|
+
env: env,
|
|
68
|
+
trigger: trigger,
|
|
69
|
+
pipelineType: pipelineType,
|
|
70
|
+
})];
|
|
71
|
+
case 1:
|
|
72
|
+
context = _a.sent();
|
|
73
|
+
return [2 /*return*/, {
|
|
74
|
+
env: env,
|
|
75
|
+
componentName: componentName,
|
|
76
|
+
context: context,
|
|
77
|
+
}];
|
|
79
78
|
}
|
|
80
79
|
});
|
|
81
|
-
}); })
|
|
82
|
-
|
|
80
|
+
}); });
|
|
81
|
+
}))];
|
|
82
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}); };
|
|
86
|
+
var createAllJobs = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
87
|
+
var allComponentContext;
|
|
88
|
+
var config = _b.config, trigger = _b.trigger, pipelineType = _b.pipelineType;
|
|
89
|
+
return __generator(this, function (_c) {
|
|
90
|
+
switch (_c.label) {
|
|
91
|
+
case 0: return [4 /*yield*/, createAllComponentContext({
|
|
92
|
+
config: config,
|
|
93
|
+
trigger: trigger,
|
|
94
|
+
pipelineType: pipelineType,
|
|
95
|
+
})];
|
|
96
|
+
case 1:
|
|
97
|
+
allComponentContext = _c.sent();
|
|
98
|
+
return [2 /*return*/, allComponentContext.reduce(function (acc, _a) {
|
|
99
|
+
var componentName = _a.componentName, env = _a.env, context = _a.context;
|
|
100
|
+
if (!acc[componentName]) {
|
|
101
|
+
acc[componentName] = {};
|
|
102
|
+
}
|
|
103
|
+
acc[componentName][env] = (0, createJobsForComponent_1.createJobsForComponentContext)(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); });
|
|
104
|
+
return acc;
|
|
105
|
+
}, {})];
|
|
83
106
|
}
|
|
84
107
|
});
|
|
85
108
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAllJobs.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createAllJobs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAllJobs.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createAllJobs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAgD;AAChD,sCAAoD;AAQpD,mEAAyE;AAczE,IAAM,yBAAyB,GAAG,iEAAO,EAIxB;QAHf,MAAM,YAAA,EACN,OAAO,aAAA,EACP,YAAY,kBAAA;;;oBAQL,qBAAM,OAAO,CAAC,GAAG,CACtB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAC,aAAa;oBACnD,IAAM,IAAI,GAAG,IAAA,4BAAmB,EAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;oBACjE,OAAO,IAAI,CAAC,GAAG,CAAC,UAAO,GAAG;;;;wCACR,qBAAM,IAAA,gCAAsB,EAAC;wCAC3C,MAAM,QAAA;wCACN,aAAa,eAAA;wCACb,GAAG,KAAA;wCACH,OAAO,SAAA;wCACP,YAAY,cAAA;qCACb,CAAC,EAAA;;oCANI,OAAO,GAAG,SAMd;oCAEF,sBAAO;4CACL,GAAG,KAAA;4CACH,aAAa,eAAA;4CACb,OAAO,SAAA;yCACR,EAAC;;;yBACH,CAAC,CAAC;gBACL,CAAC,CAAC,CACH,EAAA;oBAnBD,sBAAO,SAmBN,EAAC;;;KACH,CAAC;AAEK,IAAM,aAAa,GAAG,iEAAO,EAInB;;QAHf,MAAM,YAAA,EACN,OAAO,aAAA,EACP,YAAY,kBAAA;;;oBAEgB,qBAAM,yBAAyB,CAAC;oBAC1D,MAAM,QAAA;oBACN,OAAO,SAAA;oBACP,YAAY,cAAA;iBACb,CAAC,EAAA;;gBAJI,mBAAmB,GAAG,SAI1B;gBAEF,sBAAO,mBAAmB,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,EAA+B;4BAA7B,aAAa,mBAAA,EAAE,GAAG,SAAA,EAAE,OAAO,aAAA;wBACnE,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;4BACxB,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;wBAC1B,CAAC;wBACD,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,GAAG,IAAA,sDAA6B,EAAC,OAAO,CAAC,CAAC,GAAG,CAClE,UAAC,GAAG,IAAK,OAAA,uBACJ,GAAG,KACN,OAAO,SAAA,IACP,EAHO,CAGP,CACH,CAAC;wBAEF,OAAO,GAAG,CAAC;oBACb,CAAC,EAAE,EAAsB,CAAC,EAAC;;;KAC5B,CAAC;AAxBW,QAAA,aAAa,iBAwBxB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export declare const
|
|
1
|
+
import type { ComponentContext } from "../types/context";
|
|
2
|
+
import type { CatladderJob } from "../types/jobs";
|
|
3
|
+
export declare const createJobsForComponentContext: (context: ComponentContext) => CatladderJob[];
|
|
@@ -10,42 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
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;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
14
|
var t = {};
|
|
51
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -83,9 +47,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
83
47
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
84
48
|
};
|
|
85
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
|
-
exports.
|
|
50
|
+
exports.createJobsForComponentContext = void 0;
|
|
87
51
|
var build_1 = require("../build");
|
|
88
|
-
var context_1 = require("../context");
|
|
89
52
|
var deploy_1 = require("../deploy");
|
|
90
53
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
91
54
|
return jobs.map(function (_a) {
|
|
@@ -101,7 +64,7 @@ var getCustomJobs = function (context) {
|
|
|
101
64
|
var rawJobs = context.customJobs;
|
|
102
65
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
103
66
|
};
|
|
104
|
-
var
|
|
67
|
+
var createJobsForComponentContext = function (context) {
|
|
105
68
|
var _a, _b;
|
|
106
69
|
var buildJobs = build_1.BUILD_TYPES[context.build.config.type].jobs(context);
|
|
107
70
|
var deployJobs = ((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config)
|
|
@@ -110,16 +73,5 @@ var createRawJobs = function (context) {
|
|
|
110
73
|
var customJobs = getCustomJobs(context);
|
|
111
74
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
112
75
|
};
|
|
113
|
-
|
|
114
|
-
var context;
|
|
115
|
-
return __generator(this, function (_a) {
|
|
116
|
-
switch (_a.label) {
|
|
117
|
-
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
118
|
-
case 1:
|
|
119
|
-
context = _a.sent();
|
|
120
|
-
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}); };
|
|
124
|
-
exports.createJobsForComponent = createJobsForComponent;
|
|
76
|
+
exports.createJobsForComponentContext = createJobsForComponentContext;
|
|
125
77
|
//# sourceMappingURL=createJobsForComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createJobsForComponent.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createJobsForComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createJobsForComponent.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createJobsForComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAuC;AACvC,oCAAyC;AAIzC,IAAM,6BAA6B,GAAG,UACpC,OAAyB,EACzB,IAAoB;IAEpB,OAAA,IAAI,CAAC,GAAG,CAAC,UAAC,EAAqB;;QAAnB,IAAA,SAAS,eAAA,EAAK,GAAG,cAAnB,aAAqB,CAAF;QAAO,OAAA,YAClC,SAAS,wBACJ,CAAC,MAAA,OAAO,CAAC,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,GACnC,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC,KAEnB,GAAG,EACN,CAAA;KAAA,CAAC;AANH,CAMG,CAAC;AACN,IAAM,aAAa,GAAG,UAAC,OAAyB;IAC9C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IACnC,OAAO,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC;AACK,IAAM,6BAA6B,GAAG,UAC3C,OAAyB;;IAEzB,IAAM,SAAS,GAAG,mBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvE,IAAM,UAAU,GAAG,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM;QACvC,CAAC,CAAC,qBAAY,CAAC,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QACzD,CAAC,CAAC,EAAE,CAAC;IAEP,IAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,4DAAW,SAAS,kBAAK,UAAU,kBAAK,UAAU,UAAE;AACtD,CAAC,CAAC;AAVW,QAAA,6BAA6B,iCAUxC"}
|