@catladder/pipeline 1.0.4 → 1.1.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.
Files changed (86) hide show
  1. package/dist/build/base/constants.d.ts +7 -0
  2. package/dist/build/base/constants.js +11 -0
  3. package/dist/build/base/createBuildJob.d.ts +5 -0
  4. package/dist/build/base/createBuildJob.js +99 -0
  5. package/dist/build/docker.d.ts +5 -0
  6. package/dist/build/docker.js +95 -0
  7. package/dist/build/index.d.ts +12 -0
  8. package/dist/build/index.js +63 -0
  9. package/dist/build/node/buildJob.d.ts +3 -0
  10. package/dist/build/node/buildJob.js +100 -0
  11. package/dist/build/node/cache.d.ts +4 -0
  12. package/dist/build/node/cache.js +67 -0
  13. package/dist/build/node/constants.d.ts +6 -0
  14. package/dist/build/node/constants.js +10 -0
  15. package/dist/build/node/index.d.ts +5 -0
  16. package/dist/build/node/index.js +63 -0
  17. package/dist/build/node/meteor.d.ts +3 -0
  18. package/dist/build/node/meteor.js +103 -0
  19. package/dist/build/node/testJob.d.ts +3 -0
  20. package/dist/build/node/testJob.js +112 -0
  21. package/dist/build/node/yarn.d.ts +2 -0
  22. package/dist/build/node/yarn.js +12 -0
  23. package/dist/build/tests/storybook.test.d.ts +1 -0
  24. package/dist/build/tests/storybook.test.js +221 -0
  25. package/dist/build/types.d.ts +63 -0
  26. package/dist/build/types.js +16 -0
  27. package/dist/catladder-gitlab.d.ts +1 -0
  28. package/dist/catladder-gitlab.js +44 -0
  29. package/dist/config/configruedEnvs.d.ts +4 -0
  30. package/dist/config/configruedEnvs.js +86 -0
  31. package/dist/config/configruedEnvs.test.d.ts +1 -0
  32. package/dist/config/configruedEnvs.test.js +103 -0
  33. package/dist/config/index.d.ts +2 -0
  34. package/dist/config/index.js +24 -0
  35. package/dist/config/readConfig.d.ts +2 -0
  36. package/dist/config/readConfig.js +47 -0
  37. package/dist/constants.d.ts +2 -0
  38. package/dist/constants.js +6 -0
  39. package/dist/context/index.d.ts +5 -0
  40. package/dist/context/index.js +211 -0
  41. package/dist/defaults/index.d.ts +2 -0
  42. package/dist/defaults/index.js +8 -0
  43. package/dist/deploy/base.d.ts +9 -0
  44. package/dist/deploy/base.js +94 -0
  45. package/dist/deploy/index.d.ts +11 -0
  46. package/dist/deploy/index.js +34 -0
  47. package/dist/deploy/kubernetes/cloudsql.d.ts +6 -0
  48. package/dist/deploy/kubernetes/cloudsql.js +16 -0
  49. package/dist/deploy/kubernetes/deployJob.d.ts +3 -0
  50. package/dist/deploy/kubernetes/deployJob.js +149 -0
  51. package/dist/deploy/kubernetes/index.d.ts +1 -0
  52. package/dist/deploy/kubernetes/index.js +22 -0
  53. package/dist/deploy/kubernetes/mongodb.d.ts +15 -0
  54. package/dist/deploy/kubernetes/mongodb.js +23 -0
  55. package/dist/deploy/types.d.ts +92 -0
  56. package/dist/deploy/types.js +16 -0
  57. package/dist/index.d.ts +8 -0
  58. package/dist/index.js +36 -0
  59. package/dist/pipeline/createChildPipeline.d.ts +9 -0
  60. package/dist/pipeline/createChildPipeline.js +266 -0
  61. package/dist/pipeline/createChildPipeline.test.d.ts +1 -0
  62. package/dist/pipeline/createChildPipeline.test.js +199 -0
  63. package/dist/pipeline/createJobs.d.ts +3 -0
  64. package/dist/pipeline/createJobs.js +331 -0
  65. package/dist/pipeline/index.d.ts +2 -0
  66. package/dist/pipeline/index.js +24 -0
  67. package/dist/pipeline/yarnInfo.d.ts +2 -0
  68. package/dist/pipeline/yarnInfo.js +296 -0
  69. package/dist/rules/index.d.ts +3 -0
  70. package/dist/rules/index.js +27 -0
  71. package/dist/runner/index.d.ts +3 -0
  72. package/dist/runner/index.js +12 -0
  73. package/dist/tsconfig.tsbuildinfo +1 -0
  74. package/dist/types/config.d.ts +73 -0
  75. package/dist/types/config.js +80 -0
  76. package/dist/types/context.d.ts +36 -0
  77. package/dist/types/context.js +3 -0
  78. package/dist/types/gitlab-types.d.ts +86 -0
  79. package/dist/types/gitlab-types.js +5 -0
  80. package/dist/types/index.d.ts +3 -0
  81. package/dist/types/index.js +26 -0
  82. package/dist/utils/index.d.ts +2 -0
  83. package/dist/utils/index.js +18 -0
  84. package/package.json +1 -1
  85. package/src/build/node/buildJob.ts +4 -0
  86. package/src/build/node/constants.ts +1 -1
@@ -0,0 +1,15 @@
1
+ import { Context } from "../..";
2
+ export declare const createMongodbBaseConfig: (context: Context) => {
3
+ mongodb: {
4
+ enabled: boolean;
5
+ backup: {
6
+ enabled: boolean;
7
+ };
8
+ };
9
+ "mongodb-replicaset": {
10
+ replicas: number;
11
+ persistentVolume: {
12
+ storageClass: string;
13
+ };
14
+ };
15
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.createMongodbBaseConfig = void 0;
5
+
6
+ var createMongodbBaseConfig = function (context) {
7
+ return {
8
+ mongodb: {
9
+ enabled: true,
10
+ backup: {
11
+ enabled: ["prod", "stage"].includes(context.environment.envType)
12
+ }
13
+ },
14
+ "mongodb-replicaset": {
15
+ replicas: 1,
16
+ persistentVolume: {
17
+ storageClass: ["prod", "stage"].includes(context.environment.envType) ? "fast" : "standard"
18
+ }
19
+ }
20
+ };
21
+ };
22
+
23
+ exports.createMongodbBaseConfig = createMongodbBaseConfig;
@@ -0,0 +1,92 @@
1
+ export declare type DeployConfigBase = {};
2
+ declare type AllowUnknownProps<T extends Record<string, unknown>> = T & Record<string, unknown>;
3
+ export declare type DeployConfigKubernetes = {
4
+ type: "kubernetes";
5
+ cluster?: string;
6
+ additionalHelmArgs?: string[];
7
+ values?: AllowUnknownProps<{
8
+ cloudsql?: {
9
+ enabled: boolean;
10
+ instanceId?: string;
11
+ projectId?: string;
12
+ region?: string;
13
+ };
14
+ mongodb?: AllowUnknownProps<{
15
+ enabled: boolean;
16
+ }>;
17
+ mailhog?: {
18
+ enabled: boolean;
19
+ };
20
+ jobs?: Record<string, AllowUnknownProps<{
21
+ command: string;
22
+ }>>;
23
+ cronjobs?: Record<string, AllowUnknownProps<{
24
+ schedule: string;
25
+ command: string;
26
+ concurrencyPolicy?: "Forbid" | "Allow" | "Replace";
27
+ }>>;
28
+ application?: AllowUnknownProps<{
29
+ redirects?: AllowUnknownProps<{
30
+ host: string;
31
+ }>[];
32
+ replicas?: number;
33
+ resources?: {
34
+ limits?: {
35
+ cpu?: string;
36
+ memory?: string;
37
+ };
38
+ requests?: {
39
+ cpu?: string;
40
+ memory?: string;
41
+ };
42
+ };
43
+ }>;
44
+ }>;
45
+ } & DeployConfigBase;
46
+ export declare type DeployConfig = DeployConfigKubernetes;
47
+ export declare const isOfDeployType: <T extends "kubernetes"[]>(t: DeployConfig | false, ...types: T) => t is Extract<{
48
+ type: "kubernetes";
49
+ cluster?: string | undefined;
50
+ additionalHelmArgs?: string[] | undefined;
51
+ values?: AllowUnknownProps<{
52
+ cloudsql?: {
53
+ enabled: boolean;
54
+ instanceId?: string | undefined;
55
+ projectId?: string | undefined;
56
+ region?: string | undefined;
57
+ } | undefined;
58
+ mongodb?: AllowUnknownProps<{
59
+ enabled: boolean;
60
+ }> | undefined;
61
+ mailhog?: {
62
+ enabled: boolean;
63
+ } | undefined;
64
+ jobs?: Record<string, AllowUnknownProps<{
65
+ command: string;
66
+ }>> | undefined;
67
+ cronjobs?: Record<string, AllowUnknownProps<{
68
+ schedule: string;
69
+ command: string;
70
+ concurrencyPolicy?: "Forbid" | "Allow" | "Replace" | undefined;
71
+ }>> | undefined;
72
+ application?: AllowUnknownProps<{
73
+ redirects?: AllowUnknownProps<{
74
+ host: string;
75
+ }>[] | undefined;
76
+ replicas?: number | undefined;
77
+ resources?: {
78
+ limits?: {
79
+ cpu?: string | undefined;
80
+ memory?: string | undefined;
81
+ } | undefined;
82
+ requests?: {
83
+ cpu?: string | undefined;
84
+ memory?: string | undefined;
85
+ } | undefined;
86
+ } | undefined;
87
+ }> | undefined;
88
+ }> | undefined;
89
+ }, {
90
+ type: T[number];
91
+ }>;
92
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.isOfDeployType = void 0;
5
+
6
+ var isOfDeployType = function (t) {
7
+ var types = [];
8
+
9
+ for (var _i = 1; _i < arguments.length; _i++) {
10
+ types[_i - 1] = arguments[_i];
11
+ }
12
+
13
+ return t && types.includes(t.type);
14
+ };
15
+
16
+ exports.isOfDeployType = isOfDeployType;
@@ -0,0 +1,8 @@
1
+ export * from "./pipeline/";
2
+ export * from "./types";
3
+ export * from "./rules";
4
+ export * from "./runner";
5
+ export * from "./config";
6
+ export * from "./context";
7
+ export * from "./build";
8
+ export * from "./deploy";
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ Object.defineProperty(o, k2, {
6
+ enumerable: true,
7
+ get: function () {
8
+ return m[k];
9
+ }
10
+ });
11
+ } : function (o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ });
15
+
16
+ var __exportStar = this && this.__exportStar || function (m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+
20
+ exports.__esModule = true;
21
+
22
+ __exportStar(require("./pipeline/"), exports);
23
+
24
+ __exportStar(require("./types"), exports);
25
+
26
+ __exportStar(require("./rules"), exports);
27
+
28
+ __exportStar(require("./runner"), exports);
29
+
30
+ __exportStar(require("./config"), exports);
31
+
32
+ __exportStar(require("./context"), exports);
33
+
34
+ __exportStar(require("./build"), exports);
35
+
36
+ __exportStar(require("./deploy"), exports);
@@ -0,0 +1,9 @@
1
+ import { Config, PipelineTrigger } from "../types/config";
2
+ import { GitlabJobDef } from "../types/gitlab-types";
3
+ export declare const createChildPipeline: (trigger: PipelineTrigger, config: Config) => Promise<{
4
+ image: string;
5
+ workflow: {
6
+ rules: import("../types/gitlab-types").GitlabRule[];
7
+ };
8
+ stages: string[];
9
+ } & Record<string, GitlabJobDef>>;
@@ -0,0 +1,266 @@
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
+
8
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+
17
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) {
19
+ return value instanceof P ? value : new P(function (resolve) {
20
+ resolve(value);
21
+ });
22
+ }
23
+
24
+ return new (P || (P = Promise))(function (resolve, reject) {
25
+ function fulfilled(value) {
26
+ try {
27
+ step(generator.next(value));
28
+ } catch (e) {
29
+ reject(e);
30
+ }
31
+ }
32
+
33
+ function rejected(value) {
34
+ try {
35
+ step(generator["throw"](value));
36
+ } catch (e) {
37
+ reject(e);
38
+ }
39
+ }
40
+
41
+ function step(result) {
42
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
43
+ }
44
+
45
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
46
+ });
47
+ };
48
+
49
+ var __generator = this && this.__generator || function (thisArg, body) {
50
+ var _ = {
51
+ label: 0,
52
+ sent: function () {
53
+ if (t[0] & 1) throw t[1];
54
+ return t[1];
55
+ },
56
+ trys: [],
57
+ ops: []
58
+ },
59
+ f,
60
+ y,
61
+ t,
62
+ g;
63
+ return g = {
64
+ next: verb(0),
65
+ "throw": verb(1),
66
+ "return": verb(2)
67
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
68
+ return this;
69
+ }), g;
70
+
71
+ function verb(n) {
72
+ return function (v) {
73
+ return step([n, v]);
74
+ };
75
+ }
76
+
77
+ function step(op) {
78
+ if (f) throw new TypeError("Generator is already executing.");
79
+
80
+ while (_) try {
81
+ 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;
82
+ if (y = 0, t) op = [op[0] & 2, t.value];
83
+
84
+ switch (op[0]) {
85
+ case 0:
86
+ case 1:
87
+ t = op;
88
+ break;
89
+
90
+ case 4:
91
+ _.label++;
92
+ return {
93
+ value: op[1],
94
+ done: false
95
+ };
96
+
97
+ case 5:
98
+ _.label++;
99
+ y = op[1];
100
+ op = [0];
101
+ continue;
102
+
103
+ case 7:
104
+ op = _.ops.pop();
105
+
106
+ _.trys.pop();
107
+
108
+ continue;
109
+
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
+
116
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
117
+ _.label = op[1];
118
+ break;
119
+ }
120
+
121
+ if (op[0] === 6 && _.label < t[1]) {
122
+ _.label = t[1];
123
+ t = op;
124
+ break;
125
+ }
126
+
127
+ if (t && _.label < t[2]) {
128
+ _.label = t[2];
129
+
130
+ _.ops.push(op);
131
+
132
+ break;
133
+ }
134
+
135
+ if (t[2]) _.ops.pop();
136
+
137
+ _.trys.pop();
138
+
139
+ continue;
140
+ }
141
+
142
+ op = body.call(thisArg, _);
143
+ } catch (e) {
144
+ op = [6, e];
145
+ y = 0;
146
+ } finally {
147
+ f = t = 0;
148
+ }
149
+
150
+ if (op[0] & 5) throw op[1];
151
+ return {
152
+ value: op[0] ? op[1] : void 0,
153
+ done: true
154
+ };
155
+ }
156
+ };
157
+
158
+ var __read = this && this.__read || function (o, n) {
159
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
160
+ if (!m) return o;
161
+ var i = m.call(o),
162
+ r,
163
+ ar = [],
164
+ e;
165
+
166
+ try {
167
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
168
+ } catch (error) {
169
+ e = {
170
+ error: error
171
+ };
172
+ } finally {
173
+ try {
174
+ if (r && !r.done && (m = i["return"])) m.call(i);
175
+ } finally {
176
+ if (e) throw e.error;
177
+ }
178
+ }
179
+
180
+ return ar;
181
+ };
182
+
183
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
184
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
185
+ if (ar || !(i in from)) {
186
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
187
+ ar[i] = from[i];
188
+ }
189
+ }
190
+ return to.concat(ar || Array.prototype.slice.call(from));
191
+ };
192
+
193
+ exports.__esModule = true;
194
+ exports.createChildPipeline = void 0;
195
+
196
+ var config_1 = require("../config");
197
+
198
+ var createJobs_1 = require("./createJobs");
199
+
200
+ var rules_1 = require("../rules");
201
+
202
+ var runner_1 = require("../runner");
203
+
204
+ var baseStages = ["setup", "test", "build", "deploy", "verify", "stop"];
205
+
206
+ var createChildPipeline = function (trigger, config) {
207
+ return __awaiter(void 0, void 0, void 0, function () {
208
+ var components, jobs, allEnvs, stages, childPipeline;
209
+ return __generator(this, function (_a) {
210
+ switch (_a.label) {
211
+ case 0:
212
+ components = Object.keys(config.components);
213
+ return [4
214
+ /*yield*/
215
+ , components.reduce(function (acc, componentName) {
216
+ return __awaiter(void 0, void 0, void 0, function () {
217
+ var envs, _a, _b;
218
+
219
+ return __generator(this, function (_c) {
220
+ switch (_c.label) {
221
+ case 0:
222
+ envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
223
+ _a = [{}];
224
+ return [4
225
+ /*yield*/
226
+ , acc];
227
+
228
+ case 1:
229
+ _b = [__assign.apply(void 0, _a.concat([_c.sent()]))];
230
+ return [4
231
+ /*yield*/
232
+ , (0, createJobs_1.createJobs)(envs, config, componentName, trigger)];
233
+
234
+ case 2:
235
+ return [2
236
+ /*return*/
237
+ , __assign.apply(void 0, _b.concat([_c.sent()]))];
238
+ }
239
+ });
240
+ });
241
+ }, Promise.resolve({}))];
242
+
243
+ case 1:
244
+ jobs = _a.sent();
245
+ allEnvs = (0, config_1.getAllEnvsInAllComponents)(config);
246
+ stages = baseStages.reduce(function (acc, baseStage) {
247
+ return __spreadArray(__spreadArray(__spreadArray([], __read(acc), false), [baseStage], false), __read(allEnvs.map(function (e) {
248
+ return "".concat(baseStage, " ").concat(e);
249
+ })), false);
250
+ }, []);
251
+ childPipeline = __assign({
252
+ image: (0, runner_1.getRunnerImage)("jobs"),
253
+ workflow: {
254
+ rules: rules_1.RULES_ALWAYS
255
+ },
256
+ stages: stages
257
+ }, jobs);
258
+ return [2
259
+ /*return*/
260
+ , childPipeline];
261
+ }
262
+ });
263
+ });
264
+ };
265
+
266
+ exports.createChildPipeline = createChildPipeline;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+
3
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) {
5
+ return value instanceof P ? value : new P(function (resolve) {
6
+ resolve(value);
7
+ });
8
+ }
9
+
10
+ return new (P || (P = Promise))(function (resolve, reject) {
11
+ function fulfilled(value) {
12
+ try {
13
+ step(generator.next(value));
14
+ } catch (e) {
15
+ reject(e);
16
+ }
17
+ }
18
+
19
+ function rejected(value) {
20
+ try {
21
+ step(generator["throw"](value));
22
+ } catch (e) {
23
+ reject(e);
24
+ }
25
+ }
26
+
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+
35
+ var __generator = this && this.__generator || function (thisArg, body) {
36
+ var _ = {
37
+ label: 0,
38
+ sent: function () {
39
+ if (t[0] & 1) throw t[1];
40
+ return t[1];
41
+ },
42
+ trys: [],
43
+ ops: []
44
+ },
45
+ f,
46
+ y,
47
+ t,
48
+ g;
49
+ return g = {
50
+ next: verb(0),
51
+ "throw": verb(1),
52
+ "return": verb(2)
53
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
54
+ return this;
55
+ }), g;
56
+
57
+ function verb(n) {
58
+ return function (v) {
59
+ return step([n, v]);
60
+ };
61
+ }
62
+
63
+ function step(op) {
64
+ if (f) throw new TypeError("Generator is already executing.");
65
+
66
+ while (_) try {
67
+ 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;
68
+ if (y = 0, t) op = [op[0] & 2, t.value];
69
+
70
+ switch (op[0]) {
71
+ case 0:
72
+ case 1:
73
+ t = op;
74
+ break;
75
+
76
+ case 4:
77
+ _.label++;
78
+ return {
79
+ value: op[1],
80
+ done: false
81
+ };
82
+
83
+ case 5:
84
+ _.label++;
85
+ y = op[1];
86
+ op = [0];
87
+ continue;
88
+
89
+ case 7:
90
+ op = _.ops.pop();
91
+
92
+ _.trys.pop();
93
+
94
+ continue;
95
+
96
+ default:
97
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
98
+ _ = 0;
99
+ continue;
100
+ }
101
+
102
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
103
+ _.label = op[1];
104
+ break;
105
+ }
106
+
107
+ if (op[0] === 6 && _.label < t[1]) {
108
+ _.label = t[1];
109
+ t = op;
110
+ break;
111
+ }
112
+
113
+ if (t && _.label < t[2]) {
114
+ _.label = t[2];
115
+
116
+ _.ops.push(op);
117
+
118
+ break;
119
+ }
120
+
121
+ if (t[2]) _.ops.pop();
122
+
123
+ _.trys.pop();
124
+
125
+ continue;
126
+ }
127
+
128
+ op = body.call(thisArg, _);
129
+ } catch (e) {
130
+ op = [6, e];
131
+ y = 0;
132
+ } finally {
133
+ f = t = 0;
134
+ }
135
+
136
+ if (op[0] & 5) throw op[1];
137
+ return {
138
+ value: op[0] ? op[1] : void 0,
139
+ done: true
140
+ };
141
+ }
142
+ };
143
+
144
+ var __rest = this && this.__rest || function (s, e) {
145
+ var t = {};
146
+
147
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
148
+
149
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
150
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
151
+ }
152
+ return t;
153
+ };
154
+
155
+ exports.__esModule = true;
156
+
157
+ var createChildPipeline_1 = require("./createChildPipeline");
158
+
159
+ describe("createChildPipeline", function () {
160
+ describe("node-app to kuberntes", function () {
161
+ var config = {
162
+ appName: "test",
163
+ customerName: "pan",
164
+ components: {
165
+ "my-app": {
166
+ dir: "myapp",
167
+ build: {
168
+ type: "node"
169
+ },
170
+ deploy: {
171
+ type: "kubernetes"
172
+ }
173
+ }
174
+ }
175
+ };
176
+ it("creates a pipeline for a single app on the main branch", function () {
177
+ return __awaiter(void 0, void 0, void 0, function () {
178
+ var _a, image, stages, workflow, jobs;
179
+
180
+ return __generator(this, function (_b) {
181
+ switch (_b.label) {
182
+ case 0:
183
+ return [4
184
+ /*yield*/
185
+ , (0, createChildPipeline_1.createChildPipeline)("mainBranch", config)];
186
+
187
+ case 1:
188
+ _a = _b.sent(), image = _a.image, stages = _a.stages, workflow = _a.workflow, jobs = __rest(_a, ["image", "stages", "workflow"]);
189
+ expect(image).toEqual("git.panter.ch:5001/catladder/catladder/base-pipeline:");
190
+ expect(Object.keys(jobs)).toEqual(["my-app audit", "my-app lint", "my-app test", "dev my-app app-build", "dev my-app docker-build", "dev my-app deploy-to-kubernetes", "dev my-app kubernetes-stop"]);
191
+ return [2
192
+ /*return*/
193
+ ];
194
+ }
195
+ });
196
+ });
197
+ });
198
+ });
199
+ });
@@ -0,0 +1,3 @@
1
+ import { Config, PipelineTrigger } from "../types/config";
2
+ import { GitlabJobDef } from "../types/gitlab-types";
3
+ export declare const createJobs: (envs: string[], config: Config, componentName: string, trigger: PipelineTrigger) => Promise<Record<string, GitlabJobDef>>;