@catladder/pipeline
Version:
Panter workflow for cloud CI/CD and DevOps
56 lines (55 loc) • 1.84 kB
JavaScript
;
var __read = this && this.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} catch (error) {
e = {
error: error
};
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPipelineStages = void 0;
var config_1 = require("../config");
var jobs_1 = require("../types/jobs");
/**
* while technically not required, we group different envs in its own stage
* each job from `createJobs` that is defined as `envMode: "stagePerEnv"` will have `deploy dev`, etc. instead of just `deploy`
* this is just so that it looks nicer in gitlab and makes running mutliple manual tasks more easy to use
*/
function getPipelineStages(config) {
var allEnvs = (0, config_1.getAllEnvsInAllComponents)(config).filter(function (e) {
return e !== "local";
});
var stages = jobs_1.BASE_STAGES.reduce(function (acc, baseStage) {
return __spreadArray(__spreadArray(__spreadArray([], __read(acc), false), [baseStage], false), __read(allEnvs.map(function (e) {
return "".concat(baseStage, " ").concat(e);
})), false);
}, []);
return stages;
}
exports.getPipelineStages = getPipelineStages;