@catladder/pipeline 1.149.0 → 1.149.2

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/constants.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
7
- exports.PIPELINE_IMAGE_TAG = "v1-149-0-99090751" || "latest";
7
+ exports.PIPELINE_IMAGE_TAG = "v1-149-2-1e0f40fe" || "latest";
8
8
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
@@ -0,0 +1,16 @@
1
+ import type { PipelineType } from "../types";
2
+ import type { Config, PipelineTrigger } from "../types/config";
3
+ import type { ComponentContext, PackageManagerInfo } from "../types/context";
4
+ export type CreateComponentContextContext = {
5
+ config: Config;
6
+ componentName: string;
7
+ env: string;
8
+ pipelineType?: PipelineType;
9
+ trigger?: PipelineTrigger;
10
+ packageManagerInfo?: PackageManagerInfo;
11
+ };
12
+ export declare const createComponentContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
13
+ /**
14
+ * @deprecated use createComponentContext instead
15
+ */
16
+ export declare const createContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+
3
+ var __assign = this && this.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) {
15
+ return value instanceof P ? value : new P(function (resolve) {
16
+ resolve(value);
17
+ });
18
+ }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) {
21
+ try {
22
+ step(generator.next(value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function rejected(value) {
28
+ try {
29
+ step(generator["throw"](value));
30
+ } catch (e) {
31
+ reject(e);
32
+ }
33
+ }
34
+ function step(result) {
35
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
36
+ }
37
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
38
+ });
39
+ };
40
+ var __generator = this && this.__generator || function (thisArg, body) {
41
+ var _ = {
42
+ label: 0,
43
+ sent: function () {
44
+ if (t[0] & 1) throw t[1];
45
+ return t[1];
46
+ },
47
+ trys: [],
48
+ ops: []
49
+ },
50
+ f,
51
+ y,
52
+ t,
53
+ g;
54
+ return g = {
55
+ next: verb(0),
56
+ "throw": verb(1),
57
+ "return": verb(2)
58
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
59
+ return this;
60
+ }), g;
61
+ function verb(n) {
62
+ return function (v) {
63
+ return step([n, v]);
64
+ };
65
+ }
66
+ function step(op) {
67
+ if (f) throw new TypeError("Generator is already executing.");
68
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
69
+ 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;
70
+ if (y = 0, t) op = [op[0] & 2, t.value];
71
+ switch (op[0]) {
72
+ case 0:
73
+ case 1:
74
+ t = op;
75
+ break;
76
+ case 4:
77
+ _.label++;
78
+ return {
79
+ value: op[1],
80
+ done: false
81
+ };
82
+ case 5:
83
+ _.label++;
84
+ y = op[1];
85
+ op = [0];
86
+ continue;
87
+ case 7:
88
+ op = _.ops.pop();
89
+ _.trys.pop();
90
+ continue;
91
+ default:
92
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
93
+ _ = 0;
94
+ continue;
95
+ }
96
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
97
+ _.label = op[1];
98
+ break;
99
+ }
100
+ if (op[0] === 6 && _.label < t[1]) {
101
+ _.label = t[1];
102
+ t = op;
103
+ break;
104
+ }
105
+ if (t && _.label < t[2]) {
106
+ _.label = t[2];
107
+ _.ops.push(op);
108
+ break;
109
+ }
110
+ if (t[2]) _.ops.pop();
111
+ _.trys.pop();
112
+ continue;
113
+ }
114
+ op = body.call(thisArg, _);
115
+ } catch (e) {
116
+ op = [6, e];
117
+ y = 0;
118
+ } finally {
119
+ f = t = 0;
120
+ }
121
+ if (op[0] & 5) throw op[1];
122
+ return {
123
+ value: op[0] ? op[1] : void 0,
124
+ done: true
125
+ };
126
+ }
127
+ };
128
+ Object.defineProperty(exports, "__esModule", {
129
+ value: true
130
+ });
131
+ exports.createContext = exports.createComponentContext = void 0;
132
+ var lodash_1 = require("lodash");
133
+ var build_1 = require("../build");
134
+ var deploy_1 = require("../deploy");
135
+ var utils_1 = require("../utils");
136
+ var getEnvironment_1 = require("./getEnvironment");
137
+ var getEnvironmentContext_1 = require("./getEnvironmentContext");
138
+ var createComponentContext = function (ctx) {
139
+ return __awaiter(void 0, void 0, void 0, function () {
140
+ var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
141
+ return __generator(this, function (_a) {
142
+ switch (_a.label) {
143
+ case 0:
144
+ if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
145
+ throw new Error("componentName may only contain lower case letters, numbers and -");
146
+ }
147
+ envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
148
+ componentConfigWithoutDefaults = envContext.envConfigRaw;
149
+ defaults = componentConfigWithoutDefaults.deploy ? {
150
+ build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(envContext),
151
+ deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext)
152
+ } : {
153
+ build: {},
154
+ deploy: {}
155
+ };
156
+ componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
157
+ return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
158
+ case 1:
159
+ environment = _a.sent();
160
+ deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
161
+ context = {
162
+ fullConfig: ctx.config,
163
+ componentConfig: componentConfig,
164
+ build: {
165
+ dir: dir,
166
+ packageManagerInfo: ctx.packageManagerInfo,
167
+ config: build
168
+ },
169
+ deploy: deploy ? {
170
+ config: deploy
171
+ } : null,
172
+ componentName: ctx.componentName,
173
+ environment: environment,
174
+ packageManagerInfo: ctx.packageManagerInfo,
175
+ pipelineType: ctx.pipelineType,
176
+ trigger: ctx.trigger
177
+ };
178
+ resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs) ? customJobs(context) : customJobs;
179
+ return [2 /*return*/, __assign(__assign({}, context), {
180
+ customJobs: resolvedCustomJobs
181
+ })];
182
+ }
183
+ });
184
+ });
185
+ };
186
+ exports.createComponentContext = createComponentContext;
187
+ /**
188
+ * @deprecated use createComponentContext instead
189
+ */
190
+ exports.createContext = exports.createComponentContext;
@@ -1,18 +1,3 @@
1
- import type { PipelineType } from "../types";
2
- import type { Config, PipelineTrigger } from "../types/config";
3
- import type { ComponentContext, PackageManagerInfo } from "../types/context";
1
+ export * from "./createComponentContext";
4
2
  export * from "./getEnvironment";
5
- export * from "./getEnvironmentVariables";
6
- export type CreateComponentContextContext = {
7
- config: Config;
8
- componentName: string;
9
- env: string;
10
- pipelineType?: PipelineType;
11
- trigger?: PipelineTrigger;
12
- packageManagerInfo?: PackageManagerInfo;
13
- };
14
- export declare const createComponentContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
15
- /**
16
- * @deprecated use createComponentContext instead
17
- */
18
- export declare const createContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
3
+ export * from "./getEnvironmentVariables";
@@ -1,15 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var __assign = this && this.__assign || function () {
4
- __assign = Object.assign || function (t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
3
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
14
4
  if (k2 === undefined) k2 = k;
15
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -29,183 +19,9 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
29
19
  var __exportStar = this && this.__exportStar || function (m, exports) {
30
20
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
21
  };
32
- var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
33
- function adopt(value) {
34
- return value instanceof P ? value : new P(function (resolve) {
35
- resolve(value);
36
- });
37
- }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) {
40
- try {
41
- step(generator.next(value));
42
- } catch (e) {
43
- reject(e);
44
- }
45
- }
46
- function rejected(value) {
47
- try {
48
- step(generator["throw"](value));
49
- } catch (e) {
50
- reject(e);
51
- }
52
- }
53
- function step(result) {
54
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
55
- }
56
- step((generator = generator.apply(thisArg, _arguments || [])).next());
57
- });
58
- };
59
- var __generator = this && this.__generator || function (thisArg, body) {
60
- var _ = {
61
- label: 0,
62
- sent: function () {
63
- if (t[0] & 1) throw t[1];
64
- return t[1];
65
- },
66
- trys: [],
67
- ops: []
68
- },
69
- f,
70
- y,
71
- t,
72
- g;
73
- return g = {
74
- next: verb(0),
75
- "throw": verb(1),
76
- "return": verb(2)
77
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
78
- return this;
79
- }), g;
80
- function verb(n) {
81
- return function (v) {
82
- return step([n, v]);
83
- };
84
- }
85
- function step(op) {
86
- if (f) throw new TypeError("Generator is already executing.");
87
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
88
- 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;
89
- if (y = 0, t) op = [op[0] & 2, t.value];
90
- switch (op[0]) {
91
- case 0:
92
- case 1:
93
- t = op;
94
- break;
95
- case 4:
96
- _.label++;
97
- return {
98
- value: op[1],
99
- done: false
100
- };
101
- case 5:
102
- _.label++;
103
- y = op[1];
104
- op = [0];
105
- continue;
106
- case 7:
107
- op = _.ops.pop();
108
- _.trys.pop();
109
- continue;
110
- default:
111
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
112
- _ = 0;
113
- continue;
114
- }
115
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
116
- _.label = op[1];
117
- break;
118
- }
119
- if (op[0] === 6 && _.label < t[1]) {
120
- _.label = t[1];
121
- t = op;
122
- break;
123
- }
124
- if (t && _.label < t[2]) {
125
- _.label = t[2];
126
- _.ops.push(op);
127
- break;
128
- }
129
- if (t[2]) _.ops.pop();
130
- _.trys.pop();
131
- continue;
132
- }
133
- op = body.call(thisArg, _);
134
- } catch (e) {
135
- op = [6, e];
136
- y = 0;
137
- } finally {
138
- f = t = 0;
139
- }
140
- if (op[0] & 5) throw op[1];
141
- return {
142
- value: op[0] ? op[1] : void 0,
143
- done: true
144
- };
145
- }
146
- };
147
22
  Object.defineProperty(exports, "__esModule", {
148
23
  value: true
149
24
  });
150
- exports.createContext = exports.createComponentContext = void 0;
151
- var lodash_1 = require("lodash");
152
- var build_1 = require("../build");
153
- var deploy_1 = require("../deploy");
154
- var utils_1 = require("../utils");
155
- var getEnvironment_1 = require("./getEnvironment");
156
- var getEnvironmentContext_1 = require("./getEnvironmentContext");
25
+ __exportStar(require("./createComponentContext"), exports);
157
26
  __exportStar(require("./getEnvironment"), exports);
158
- __exportStar(require("./getEnvironmentVariables"), exports);
159
- var createComponentContext = function (ctx) {
160
- return __awaiter(void 0, void 0, void 0, function () {
161
- var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
162
- return __generator(this, function (_a) {
163
- switch (_a.label) {
164
- case 0:
165
- if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
166
- throw new Error("componentName may only contain lower case letters, numbers and -");
167
- }
168
- envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
169
- componentConfigWithoutDefaults = envContext.envConfigRaw;
170
- defaults = componentConfigWithoutDefaults.deploy ? {
171
- build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(envContext),
172
- deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext)
173
- } : {
174
- build: {},
175
- deploy: {}
176
- };
177
- componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
178
- return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
179
- case 1:
180
- environment = _a.sent();
181
- deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
182
- context = {
183
- fullConfig: ctx.config,
184
- componentConfig: componentConfig,
185
- build: {
186
- dir: dir,
187
- packageManagerInfo: ctx.packageManagerInfo,
188
- config: build
189
- },
190
- deploy: deploy ? {
191
- config: deploy
192
- } : null,
193
- componentName: ctx.componentName,
194
- environment: environment,
195
- packageManagerInfo: ctx.packageManagerInfo,
196
- pipelineType: ctx.pipelineType,
197
- trigger: ctx.trigger
198
- };
199
- resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs) ? customJobs(context) : customJobs;
200
- return [2 /*return*/, __assign(__assign({}, context), {
201
- customJobs: resolvedCustomJobs
202
- })];
203
- }
204
- });
205
- });
206
- };
207
- exports.createComponentContext = createComponentContext;
208
- /**
209
- * @deprecated use createComponentContext instead
210
- */
211
- exports.createContext = exports.createComponentContext;
27
+ __exportStar(require("./getEnvironmentVariables"), exports);