@catladder/pipeline 0.0.0-node16-ddfae617 → 0.0.0-prettier-cbceeed9
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/bin/catladder-gitlab-dev.js +3 -0
- package/bin/catladder-gitlab.js +1 -1
- package/dist/build/base/createBuildJob.d.ts +2 -2
- package/dist/build/base/createBuildJob.js +15 -30
- package/dist/build/base/writeBuildInfo.d.ts +2 -0
- package/dist/build/base/{getBuildInfo.js → writeBuildInfo.js} +3 -6
- package/dist/build/custom/buildJob.d.ts +3 -0
- package/dist/build/custom/buildJob.js +83 -0
- package/dist/build/custom/index.d.ts +3 -0
- package/dist/build/custom/index.js +40 -0
- package/dist/build/docker.d.ts +33 -9
- package/dist/build/docker.js +51 -54
- package/dist/build/index.d.ts +6 -5
- package/dist/build/index.js +20 -6
- package/dist/build/node/buildJob.d.ts +2 -2
- package/dist/build/node/buildJob.js +3 -25
- package/dist/build/node/cache.d.ts +2 -2
- package/dist/build/node/cache.js +19 -22
- package/dist/build/node/index.d.ts +1 -1
- package/dist/build/node/index.js +3 -16
- package/dist/build/node/meteor.d.ts +1 -1
- package/dist/build/node/meteor.js +9 -20
- package/dist/build/node/testJob.d.ts +2 -2
- package/dist/build/node/testJob.js +7 -21
- package/dist/build/node/yarn.d.ts +1 -1
- package/dist/build/node/yarn.js +14 -15
- package/dist/build/rails/build.d.ts +3 -0
- package/dist/build/rails/build.js +51 -0
- package/dist/build/rails/index.d.ts +3 -0
- package/dist/build/rails/index.js +41 -0
- package/dist/build/rails/test.d.ts +3 -0
- package/dist/build/rails/test.js +94 -0
- package/dist/build/types.d.ts +84 -9
- package/dist/build/types.js +0 -4
- package/dist/bundles/catladder-gitlab/index.js +32979 -0
- package/dist/catladder-gitlab.js +7 -26
- package/dist/config/{configruedEnvs.test.d.ts → __tests__/configruedEnvs.test.d.ts} +0 -0
- package/dist/config/{configruedEnvs.test.js → __tests__/configruedEnvs.test.js} +10 -12
- package/dist/config/configruedEnvs.d.ts +1 -1
- package/dist/config/configruedEnvs.js +7 -22
- package/dist/config/index.js +0 -4
- package/dist/config/readConfig.d.ts +1 -1
- package/dist/config/readConfig.js +2 -13
- package/dist/constants.js +1 -1
- package/dist/context/{resolveReferences.test.d.ts → __tests__/resolveReferences.test.d.ts} +0 -0
- package/dist/context/__tests__/resolveReferences.test.js +336 -0
- package/dist/context/getEnvConfig.d.ts +2 -0
- package/dist/context/getEnvConfig.js +18 -0
- package/dist/context/getEnvType.d.ts +4 -0
- package/dist/context/getEnvType.js +13 -0
- package/dist/context/getEnvironment.d.ts +3 -0
- package/dist/{pipeline/createChildPipeline.test.js → context/getEnvironment.js} +42 -84
- package/dist/context/getEnvironmentContext.d.ts +4 -0
- package/dist/context/getEnvironmentContext.js +33 -0
- package/dist/context/getEnvironmentVariables.d.ts +10 -0
- package/dist/context/getEnvironmentVariables.js +260 -0
- package/dist/context/getLabels.d.ts +8 -0
- package/dist/context/getLabels.js +38 -0
- package/dist/context/index.d.ts +5 -6
- package/dist/context/index.js +158 -208
- package/dist/context/resolveReferences.d.ts +1 -3
- package/dist/context/resolveReferences.js +213 -52
- package/dist/defaults/index.d.ts +1 -1
- package/dist/deploy/base.d.ts +4 -2
- package/dist/deploy/base.js +38 -33
- package/dist/deploy/cloudRun/deployJob.d.ts +3 -0
- package/dist/deploy/cloudRun/deployJob.js +238 -0
- package/dist/deploy/cloudRun/index.d.ts +4 -0
- package/dist/deploy/cloudRun/index.js +112 -0
- package/dist/deploy/cloudRun/utils/createArgsString.d.ts +11 -0
- package/dist/deploy/cloudRun/utils/createArgsString.js +55 -0
- package/dist/deploy/cloudRun/utils/database.d.ts +4 -0
- package/dist/deploy/cloudRun/utils/database.js +64 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +10 -0
- package/dist/deploy/cloudRun/utils/jobName.d.ts +1 -0
- package/dist/deploy/cloudRun/utils/jobName.js +8 -0
- package/dist/deploy/custom/deployJob.d.ts +2 -2
- package/dist/deploy/custom/deployJob.js +10 -16
- package/dist/deploy/custom/index.d.ts +2 -1
- package/dist/deploy/custom/index.js +14 -19
- package/dist/deploy/dockerTag/deployJob.d.ts +3 -0
- package/dist/deploy/dockerTag/deployJob.js +24 -0
- package/dist/deploy/dockerTag/index.d.ts +2 -0
- package/dist/deploy/dockerTag/index.js +17 -0
- package/dist/deploy/index.d.ts +12 -8
- package/dist/deploy/index.js +7 -20
- package/dist/deploy/kubernetes/additionalSecretKeys.d.ts +4 -0
- package/dist/deploy/kubernetes/additionalSecretKeys.js +24 -0
- package/dist/deploy/kubernetes/cloudSql/index.d.ts +13 -0
- package/dist/deploy/kubernetes/cloudSql/index.js +30 -0
- package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/deploy/kubernetes/deployJob.js +17 -91
- package/dist/deploy/kubernetes/index.d.ts +3 -1
- package/dist/deploy/kubernetes/index.js +42 -4
- package/dist/deploy/kubernetes/kubeEnv.d.ts +9 -0
- package/dist/deploy/kubernetes/kubeEnv.js +72 -0
- package/dist/deploy/kubernetes/kubeValues.d.ts +97 -0
- package/dist/deploy/kubernetes/kubeValues.js +124 -0
- package/dist/deploy/kubernetes/mongodb.d.ts +18 -5
- package/dist/deploy/kubernetes/mongodb.js +96 -10
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +25 -21
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +2 -10
- package/dist/deploy/types/base.d.ts +14 -0
- package/dist/deploy/types/base.js +3 -0
- package/dist/deploy/types/custom.d.ts +33 -0
- package/dist/deploy/types/custom.js +3 -0
- package/dist/deploy/types/dockerTag.d.ts +10 -0
- package/dist/deploy/types/dockerTag.js +3 -0
- package/dist/deploy/types/googleCloudRun.d.ts +121 -0
- package/dist/deploy/types/googleCloudRun.js +3 -0
- package/dist/deploy/types/index.d.ts +22 -0
- package/dist/deploy/types/index.js +31 -0
- package/dist/deploy/types/kubernetes.d.ts +276 -0
- package/dist/deploy/types/kubernetes.js +3 -0
- package/dist/deploy/utils.d.ts +2 -2
- package/dist/deploy/utils.js +3 -10
- package/dist/index.js +0 -10
- package/dist/pipeline/commitInfo/getBuildId.d.ts +1 -0
- package/dist/pipeline/commitInfo/getBuildId.js +135 -0
- package/dist/pipeline/commitInfo/getCommitInfo.d.ts +2 -0
- package/dist/pipeline/commitInfo/getCommitInfo.js +140 -0
- package/dist/pipeline/createAllJobs.d.ts +8 -0
- package/dist/{build/tests/storybook.test.js → pipeline/createAllJobs.js} +54 -104
- package/dist/pipeline/createChildPipeline.d.ts +2 -2
- package/dist/pipeline/createChildPipeline.js +40 -121
- package/dist/pipeline/createJobsForComponent.d.ts +3 -0
- package/dist/pipeline/{createJobs.js → createJobsForComponent.js} +33 -192
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +14 -0
- package/dist/pipeline/gitlab/createGitlabJobs.js +260 -0
- package/dist/pipeline/index.d.ts +1 -1
- package/dist/pipeline/index.js +1 -5
- package/dist/pipeline/packageManager.d.ts +1 -1
- package/dist/pipeline/packageManager.js +20 -173
- package/dist/pipeline/yarn/yarnUtils.d.ts +4 -0
- package/dist/pipeline/yarn/yarnUtils.js +193 -0
- package/dist/rules/index.d.ts +3 -1
- package/dist/rules/index.js +7 -6
- package/dist/runner/index.d.ts +2 -3
- package/dist/runner/index.js +0 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +19 -25
- package/dist/types/config.js +6 -16
- package/dist/types/context.d.ts +16 -3
- package/dist/types/environmentContext.d.ts +28 -0
- package/dist/types/environmentContext.js +3 -0
- package/dist/types/gitlab-types.d.ts +39 -7
- package/dist/types/index.js +0 -6
- package/dist/types/jobs.d.ts +25 -17
- package/dist/types/jobs.js +1 -1
- package/dist/types/pipeline.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -0
- package/dist/types/utils.js +3 -0
- package/dist/utils/gitlab.d.ts +5 -0
- package/dist/utils/gitlab.js +48 -0
- package/dist/utils/index.js +5 -15
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +1560 -0
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +1560 -0
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +1560 -0
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +3092 -0
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +3103 -0
- package/examples/__snapshots__/custom-build-job.ts.snap +1162 -0
- package/examples/__snapshots__/custom-envs.ts.snap +261 -0
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +2280 -0
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +4077 -0
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +1911 -0
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +1626 -0
- package/examples/__utils__/helpers.ts +14 -0
- package/examples/cloud-run-memory-limit.ts +28 -0
- package/examples/cloud-run-no-cpu-throttling.ts +33 -0
- package/examples/cloud-run-non-public.ts +27 -0
- package/examples/cloud-run-with-sql-reuse-db.ts +54 -0
- package/examples/cloud-run-with-sql.ts +61 -0
- package/examples/custom-build-job.ts +28 -0
- package/examples/custom-envs.ts +31 -0
- package/examples/kubernetes-application-customization.ts +57 -0
- package/examples/kubernetes-with-jobs.ts +68 -0
- package/examples/rails-k8s-with-worker.ts +95 -0
- package/examples/wait-for-other-deploy.ts +36 -0
- package/package.json +16 -13
- package/scripts/bundle +2 -0
- package/src/build/base/createBuildJob.ts +12 -5
- package/src/build/base/{getBuildInfo.ts → writeBuildInfo.ts} +2 -2
- package/src/build/custom/buildJob.ts +64 -0
- package/src/build/custom/index.ts +7 -0
- package/src/build/docker.ts +58 -33
- package/src/build/index.ts +24 -5
- package/src/build/node/buildJob.ts +2 -2
- package/src/build/node/cache.ts +19 -8
- package/src/build/node/index.ts +1 -1
- package/src/build/node/meteor.ts +8 -2
- package/src/build/node/testJob.ts +4 -2
- package/src/build/node/yarn.ts +21 -10
- package/src/build/rails/build.ts +38 -0
- package/src/build/rails/index.ts +8 -0
- package/src/build/rails/test.ts +86 -0
- package/src/build/types.ts +97 -2
- package/src/catladder-gitlab.ts +4 -2
- package/src/config/{configruedEnvs.test.ts → __tests__/configruedEnvs.test.ts} +3 -3
- package/src/config/configruedEnvs.ts +2 -7
- package/src/config/readConfig.ts +1 -1
- package/src/context/{resolveReferences.test.ts → __tests__/resolveReferences.test.ts} +23 -38
- package/src/context/getEnvConfig.ts +21 -0
- package/src/context/getEnvType.ts +17 -0
- package/src/context/getEnvironment.ts +40 -0
- package/src/context/getEnvironmentContext.ts +57 -0
- package/src/context/getEnvironmentVariables.ts +155 -0
- package/src/context/getLabels.ts +20 -0
- package/src/context/index.ts +28 -193
- package/src/context/resolveReferences.ts +35 -31
- package/src/defaults/index.ts +1 -1
- package/src/deploy/base.ts +43 -19
- package/src/deploy/cloudRun/deployJob.ts +276 -0
- package/src/deploy/cloudRun/index.ts +95 -0
- package/src/deploy/cloudRun/utils/createArgsString.ts +26 -0
- package/src/deploy/cloudRun/utils/database.ts +55 -0
- package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +14 -0
- package/src/deploy/cloudRun/utils/jobName.ts +2 -0
- package/src/deploy/custom/deployJob.ts +13 -3
- package/src/deploy/custom/index.ts +9 -1
- package/src/deploy/dockerTag/deployJob.ts +31 -0
- package/src/deploy/dockerTag/index.ts +9 -0
- package/src/deploy/index.ts +26 -17
- package/src/deploy/kubernetes/additionalSecretKeys.ts +23 -0
- package/src/deploy/kubernetes/cloudSql/index.ts +28 -0
- package/src/deploy/kubernetes/deployJob.ts +21 -78
- package/src/deploy/kubernetes/index.ts +42 -1
- package/src/deploy/kubernetes/kubeEnv.ts +48 -0
- package/src/deploy/kubernetes/kubeValues.ts +96 -0
- package/src/deploy/kubernetes/mongodb.ts +104 -7
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +1 -1
- package/src/deploy/types/base.ts +17 -0
- package/src/deploy/types/custom.ts +36 -0
- package/src/deploy/types/dockerTag.ts +12 -0
- package/src/deploy/types/googleCloudRun.ts +179 -0
- package/src/deploy/types/index.ts +28 -0
- package/src/deploy/types/kubernetes.ts +301 -0
- package/src/deploy/utils.ts +6 -2
- package/src/pipeline/commitInfo/getBuildId.ts +6 -0
- package/src/pipeline/commitInfo/getCommitInfo.ts +12 -0
- package/src/pipeline/createAllJobs.ts +38 -0
- package/src/pipeline/createChildPipeline.ts +9 -20
- package/src/pipeline/createJobsForComponent.ts +64 -0
- package/src/pipeline/gitlab/createGitlabJobs.ts +149 -0
- package/src/pipeline/index.ts +1 -1
- package/src/pipeline/packageManager.ts +4 -38
- package/src/pipeline/yarn/yarnUtils.ts +37 -0
- package/src/rules/index.ts +9 -6
- package/src/runner/index.ts +2 -1
- package/src/types/config.ts +26 -13
- package/src/types/context.ts +23 -2
- package/src/types/environmentContext.ts +33 -0
- package/src/types/gitlab-types.ts +36 -6
- package/src/types/jobs.ts +30 -6
- package/src/types/pipeline.ts +1 -1
- package/src/types/utils.ts +7 -0
- package/src/utils/gitlab.ts +23 -0
- package/tsconfig.json +3 -1
- package/dist/build/base/getBuildInfo.d.ts +0 -2
- package/dist/build/tests/storybook.test.d.ts +0 -1
- package/dist/context/resolveReferences.test.js +0 -141
- package/dist/deploy/kubernetes/cloudsql.d.ts +0 -6
- package/dist/deploy/kubernetes/cloudsql.js +0 -16
- package/dist/deploy/types.d.ts +0 -196
- package/dist/deploy/types.js +0 -16
- package/dist/pipeline/createChildPipeline.test.d.ts +0 -1
- package/dist/pipeline/createJobs.d.ts +0 -3
- package/dist/pipeline/gitlab/makeGitlabJob.d.ts +0 -8
- package/dist/pipeline/gitlab/makeGitlabJob.js +0 -45
- package/src/build/tests/storybook.test.ts +0 -54
- package/src/deploy/kubernetes/cloudsql.ts +0 -12
- package/src/deploy/types.ts +0 -189
- package/src/pipeline/createChildPipeline.test.ts +0 -49
- package/src/pipeline/createJobs.ts +0 -195
- package/src/pipeline/gitlab/makeGitlabJob.ts +0 -16
|
@@ -6,7 +6,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
6
6
|
resolve(value);
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
10
|
function fulfilled(value) {
|
|
12
11
|
try {
|
|
@@ -15,7 +14,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
15
14
|
reject(e);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
function rejected(value) {
|
|
20
18
|
try {
|
|
21
19
|
step(generator["throw"](value));
|
|
@@ -23,29 +21,26 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
23
21
|
reject(e);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
|
|
27
24
|
function step(result) {
|
|
28
25
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
26
|
}
|
|
30
|
-
|
|
31
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
28
|
});
|
|
33
29
|
};
|
|
34
|
-
|
|
35
30
|
var __generator = this && this.__generator || function (thisArg, body) {
|
|
36
31
|
var _ = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function () {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
38
|
+
ops: []
|
|
41
39
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
y,
|
|
47
|
-
t,
|
|
48
|
-
g;
|
|
40
|
+
f,
|
|
41
|
+
y,
|
|
42
|
+
t,
|
|
43
|
+
g;
|
|
49
44
|
return g = {
|
|
50
45
|
next: verb(0),
|
|
51
46
|
"throw": verb(1),
|
|
@@ -53,78 +48,59 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
53
48
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
54
49
|
return this;
|
|
55
50
|
}), g;
|
|
56
|
-
|
|
57
51
|
function verb(n) {
|
|
58
52
|
return function (v) {
|
|
59
53
|
return step([n, v]);
|
|
60
54
|
};
|
|
61
55
|
}
|
|
62
|
-
|
|
63
56
|
function step(op) {
|
|
64
57
|
if (f) throw new TypeError("Generator is already executing.");
|
|
65
|
-
|
|
66
58
|
while (_) try {
|
|
67
59
|
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
60
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
69
|
-
|
|
70
61
|
switch (op[0]) {
|
|
71
62
|
case 0:
|
|
72
63
|
case 1:
|
|
73
64
|
t = op;
|
|
74
65
|
break;
|
|
75
|
-
|
|
76
66
|
case 4:
|
|
77
67
|
_.label++;
|
|
78
68
|
return {
|
|
79
69
|
value: op[1],
|
|
80
70
|
done: false
|
|
81
71
|
};
|
|
82
|
-
|
|
83
72
|
case 5:
|
|
84
73
|
_.label++;
|
|
85
74
|
y = op[1];
|
|
86
75
|
op = [0];
|
|
87
76
|
continue;
|
|
88
|
-
|
|
89
77
|
case 7:
|
|
90
78
|
op = _.ops.pop();
|
|
91
|
-
|
|
92
79
|
_.trys.pop();
|
|
93
|
-
|
|
94
80
|
continue;
|
|
95
|
-
|
|
96
81
|
default:
|
|
97
82
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
98
83
|
_ = 0;
|
|
99
84
|
continue;
|
|
100
85
|
}
|
|
101
|
-
|
|
102
86
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
103
87
|
_.label = op[1];
|
|
104
88
|
break;
|
|
105
89
|
}
|
|
106
|
-
|
|
107
90
|
if (op[0] === 6 && _.label < t[1]) {
|
|
108
91
|
_.label = t[1];
|
|
109
92
|
t = op;
|
|
110
93
|
break;
|
|
111
94
|
}
|
|
112
|
-
|
|
113
95
|
if (t && _.label < t[2]) {
|
|
114
96
|
_.label = t[2];
|
|
115
|
-
|
|
116
97
|
_.ops.push(op);
|
|
117
|
-
|
|
118
98
|
break;
|
|
119
99
|
}
|
|
120
|
-
|
|
121
100
|
if (t[2]) _.ops.pop();
|
|
122
|
-
|
|
123
101
|
_.trys.pop();
|
|
124
|
-
|
|
125
102
|
continue;
|
|
126
103
|
}
|
|
127
|
-
|
|
128
104
|
op = body.call(thisArg, _);
|
|
129
105
|
} catch (e) {
|
|
130
106
|
op = [6, e];
|
|
@@ -132,7 +108,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
132
108
|
} finally {
|
|
133
109
|
f = t = 0;
|
|
134
110
|
}
|
|
135
|
-
|
|
136
111
|
if (op[0] & 5) throw op[1];
|
|
137
112
|
return {
|
|
138
113
|
value: op[0] ? op[1] : void 0,
|
|
@@ -140,75 +115,50 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
140
115
|
};
|
|
141
116
|
}
|
|
142
117
|
};
|
|
143
|
-
|
|
144
118
|
exports.__esModule = true;
|
|
145
|
-
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
119
|
+
exports.createAllJobs = void 0;
|
|
120
|
+
var config_1 = require("../config");
|
|
121
|
+
var createJobsForComponent_1 = require("./createJobsForComponent");
|
|
122
|
+
var createAllJobs = function (config, trigger) {
|
|
123
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
return __generator(this, function (_c) {
|
|
126
|
+
switch (_c.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
_b = (_a = Object).fromEntries;
|
|
129
|
+
return [4 /*yield*/, Promise.all(Object.keys(config.components).map(function (componentName) {
|
|
130
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
131
|
+
var envs, _a, _b, _c;
|
|
132
|
+
return __generator(this, function (_d) {
|
|
133
|
+
switch (_d.label) {
|
|
134
|
+
case 0:
|
|
135
|
+
envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
136
|
+
_a = [componentName];
|
|
137
|
+
_c = (_b = Object).fromEntries;
|
|
138
|
+
return [4 /*yield*/, Promise.all(envs.map(function (env) {
|
|
139
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
140
|
+
var _a;
|
|
141
|
+
return __generator(this, function (_b) {
|
|
142
|
+
switch (_b.label) {
|
|
143
|
+
case 0:
|
|
144
|
+
_a = [env];
|
|
145
|
+
return [4 /*yield*/, (0, createJobsForComponent_1.createJobsForComponent)(config, componentName, env, trigger)];
|
|
146
|
+
case 1:
|
|
147
|
+
return [2 /*return*/, _a.concat([_b.sent()])];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}))];
|
|
152
|
+
case 1:
|
|
153
|
+
return [2 /*return*/, _a.concat([_c.apply(_b, [_d.sent()])])];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}))];
|
|
158
|
+
case 1:
|
|
159
|
+
return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
|
169
160
|
}
|
|
170
|
-
};
|
|
171
|
-
it("creates a pipeline for storybook that does not contain test stages", function () {
|
|
172
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
173
|
-
var jobs;
|
|
174
|
-
return __generator(this, function (_a) {
|
|
175
|
-
switch (_a.label) {
|
|
176
|
-
case 0:
|
|
177
|
-
return [4
|
|
178
|
-
/*yield*/
|
|
179
|
-
, (0, __1.createChildPipeline)("gitlab", "mainBranch", config)];
|
|
180
|
-
|
|
181
|
-
case 1:
|
|
182
|
-
jobs = _a.sent().jobs;
|
|
183
|
-
expect(Object.keys(jobs)).toEqual(["dev my-app app-build", "dev my-app docker-build", "dev my-app deploy-to-kubernetes", "dev my-app kubernetes-stop"]);
|
|
184
|
-
return [2
|
|
185
|
-
/*return*/
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
it("runs build and renames folder", function () {
|
|
192
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
-
var jobs, buildJob;
|
|
194
|
-
return __generator(this, function (_a) {
|
|
195
|
-
switch (_a.label) {
|
|
196
|
-
case 0:
|
|
197
|
-
return [4
|
|
198
|
-
/*yield*/
|
|
199
|
-
, (0, __1.createChildPipeline)("gitlab", "mainBranch", config)];
|
|
200
|
-
|
|
201
|
-
case 1:
|
|
202
|
-
jobs = _a.sent().jobs;
|
|
203
|
-
buildJob = jobs["dev my-app app-build"];
|
|
204
|
-
expect(buildJob.script).toContain("yarn storybook");
|
|
205
|
-
expect(buildJob.script).toContain("mv ./storybook-out /dist");
|
|
206
|
-
return [2
|
|
207
|
-
/*return*/
|
|
208
|
-
];
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
161
|
});
|
|
213
162
|
});
|
|
214
|
-
}
|
|
163
|
+
};
|
|
164
|
+
exports.createAllJobs = createAllJobs;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Pipeline } from "../types";
|
|
2
|
-
import { Config, PipelineTrigger } from "../types/config";
|
|
1
|
+
import type { Pipeline } from "../types";
|
|
2
|
+
import type { Config, PipelineTrigger } from "../types/config";
|
|
3
3
|
export declare const createChildPipeline: <T extends "gitlab">(type: T, trigger: PipelineTrigger, config: Config) => Promise<Pipeline<T>>;
|
|
@@ -1,26 +1,11 @@
|
|
|
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
|
-
|
|
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
3
|
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
18
4
|
function adopt(value) {
|
|
19
5
|
return value instanceof P ? value : new P(function (resolve) {
|
|
20
6
|
resolve(value);
|
|
21
7
|
});
|
|
22
8
|
}
|
|
23
|
-
|
|
24
9
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
25
10
|
function fulfilled(value) {
|
|
26
11
|
try {
|
|
@@ -29,7 +14,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
29
14
|
reject(e);
|
|
30
15
|
}
|
|
31
16
|
}
|
|
32
|
-
|
|
33
17
|
function rejected(value) {
|
|
34
18
|
try {
|
|
35
19
|
step(generator["throw"](value));
|
|
@@ -37,29 +21,26 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
37
21
|
reject(e);
|
|
38
22
|
}
|
|
39
23
|
}
|
|
40
|
-
|
|
41
24
|
function step(result) {
|
|
42
25
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
43
26
|
}
|
|
44
|
-
|
|
45
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
28
|
});
|
|
47
29
|
};
|
|
48
|
-
|
|
49
30
|
var __generator = this && this.__generator || function (thisArg, body) {
|
|
50
31
|
var _ = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function () {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
38
|
+
ops: []
|
|
55
39
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
y,
|
|
61
|
-
t,
|
|
62
|
-
g;
|
|
40
|
+
f,
|
|
41
|
+
y,
|
|
42
|
+
t,
|
|
43
|
+
g;
|
|
63
44
|
return g = {
|
|
64
45
|
next: verb(0),
|
|
65
46
|
"throw": verb(1),
|
|
@@ -67,78 +48,59 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
67
48
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
68
49
|
return this;
|
|
69
50
|
}), g;
|
|
70
|
-
|
|
71
51
|
function verb(n) {
|
|
72
52
|
return function (v) {
|
|
73
53
|
return step([n, v]);
|
|
74
54
|
};
|
|
75
55
|
}
|
|
76
|
-
|
|
77
56
|
function step(op) {
|
|
78
57
|
if (f) throw new TypeError("Generator is already executing.");
|
|
79
|
-
|
|
80
58
|
while (_) try {
|
|
81
59
|
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
60
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
83
|
-
|
|
84
61
|
switch (op[0]) {
|
|
85
62
|
case 0:
|
|
86
63
|
case 1:
|
|
87
64
|
t = op;
|
|
88
65
|
break;
|
|
89
|
-
|
|
90
66
|
case 4:
|
|
91
67
|
_.label++;
|
|
92
68
|
return {
|
|
93
69
|
value: op[1],
|
|
94
70
|
done: false
|
|
95
71
|
};
|
|
96
|
-
|
|
97
72
|
case 5:
|
|
98
73
|
_.label++;
|
|
99
74
|
y = op[1];
|
|
100
75
|
op = [0];
|
|
101
76
|
continue;
|
|
102
|
-
|
|
103
77
|
case 7:
|
|
104
78
|
op = _.ops.pop();
|
|
105
|
-
|
|
106
79
|
_.trys.pop();
|
|
107
|
-
|
|
108
80
|
continue;
|
|
109
|
-
|
|
110
81
|
default:
|
|
111
82
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
112
83
|
_ = 0;
|
|
113
84
|
continue;
|
|
114
85
|
}
|
|
115
|
-
|
|
116
86
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
117
87
|
_.label = op[1];
|
|
118
88
|
break;
|
|
119
89
|
}
|
|
120
|
-
|
|
121
90
|
if (op[0] === 6 && _.label < t[1]) {
|
|
122
91
|
_.label = t[1];
|
|
123
92
|
t = op;
|
|
124
93
|
break;
|
|
125
94
|
}
|
|
126
|
-
|
|
127
95
|
if (t && _.label < t[2]) {
|
|
128
96
|
_.label = t[2];
|
|
129
|
-
|
|
130
97
|
_.ops.push(op);
|
|
131
|
-
|
|
132
98
|
break;
|
|
133
99
|
}
|
|
134
|
-
|
|
135
100
|
if (t[2]) _.ops.pop();
|
|
136
|
-
|
|
137
101
|
_.trys.pop();
|
|
138
|
-
|
|
139
102
|
continue;
|
|
140
103
|
}
|
|
141
|
-
|
|
142
104
|
op = body.call(thisArg, _);
|
|
143
105
|
} catch (e) {
|
|
144
106
|
op = [6, e];
|
|
@@ -146,7 +108,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
146
108
|
} finally {
|
|
147
109
|
f = t = 0;
|
|
148
110
|
}
|
|
149
|
-
|
|
150
111
|
if (op[0] & 5) throw op[1];
|
|
151
112
|
return {
|
|
152
113
|
value: op[0] ? op[1] : void 0,
|
|
@@ -154,15 +115,13 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
154
115
|
};
|
|
155
116
|
}
|
|
156
117
|
};
|
|
157
|
-
|
|
158
118
|
var __read = this && this.__read || function (o, n) {
|
|
159
119
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
160
120
|
if (!m) return o;
|
|
161
121
|
var i = m.call(o),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
122
|
+
r,
|
|
123
|
+
ar = [],
|
|
124
|
+
e;
|
|
166
125
|
try {
|
|
167
126
|
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
168
127
|
} catch (error) {
|
|
@@ -176,10 +135,8 @@ var __read = this && this.__read || function (o, n) {
|
|
|
176
135
|
if (e) throw e.error;
|
|
177
136
|
}
|
|
178
137
|
}
|
|
179
|
-
|
|
180
138
|
return ar;
|
|
181
139
|
};
|
|
182
|
-
|
|
183
140
|
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
184
141
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
185
142
|
if (ar || !(i in from)) {
|
|
@@ -189,87 +146,49 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
189
146
|
}
|
|
190
147
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
191
148
|
};
|
|
192
|
-
|
|
193
149
|
exports.__esModule = true;
|
|
194
150
|
exports.createChildPipeline = void 0;
|
|
195
|
-
|
|
196
151
|
var config_1 = require("../config");
|
|
197
|
-
|
|
198
152
|
var rules_1 = require("../rules");
|
|
199
|
-
|
|
200
153
|
var runner_1 = require("../runner");
|
|
201
|
-
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
var baseStages = ["setup", "test", "build", "deploy", "verify", "stop"];
|
|
205
|
-
|
|
154
|
+
var jobs_1 = require("../types/jobs");
|
|
155
|
+
var createAllJobs_1 = require("./createAllJobs");
|
|
156
|
+
var createGitlabJobs_1 = require("./gitlab/createGitlabJobs");
|
|
206
157
|
var createChildPipeline = function (type, trigger, config) {
|
|
207
158
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
|
|
159
|
+
var jobs, allEnvs, stages, pipeline;
|
|
160
|
+
var _a;
|
|
161
|
+
return __generator(this, function (_b) {
|
|
162
|
+
switch (_b.label) {
|
|
211
163
|
case 0:
|
|
212
|
-
|
|
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)(type, 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
|
-
|
|
164
|
+
return [4 /*yield*/, (0, createAllJobs_1.createAllJobs)(config, trigger)];
|
|
243
165
|
case 1:
|
|
244
|
-
jobs =
|
|
166
|
+
jobs = _b.sent();
|
|
245
167
|
allEnvs = (0, config_1.getAllEnvsInAllComponents)(config);
|
|
246
|
-
stages =
|
|
168
|
+
stages = jobs_1.BASE_STAGES.reduce(function (acc, baseStage) {
|
|
247
169
|
return __spreadArray(__spreadArray(__spreadArray([], __read(acc), false), [baseStage], false), __read(allEnvs.map(function (e) {
|
|
248
170
|
return "".concat(baseStage, " ").concat(e);
|
|
249
171
|
})), false);
|
|
250
172
|
}, []);
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
|
|
173
|
+
if (!(type === "gitlab")) return [3 /*break*/, 3];
|
|
174
|
+
_a = {
|
|
175
|
+
image: (0, runner_1.getRunnerImage)("jobs-default"),
|
|
176
|
+
variables: {
|
|
177
|
+
FF_USE_FASTZIP: "true"
|
|
178
|
+
},
|
|
179
|
+
workflow: {
|
|
180
|
+
rules: rules_1.RULES_ALWAYS
|
|
181
|
+
},
|
|
182
|
+
stages: stages
|
|
183
|
+
};
|
|
184
|
+
return [4 /*yield*/, (0, createGitlabJobs_1.createGitlabJobs)(jobs)];
|
|
185
|
+
case 2:
|
|
186
|
+
pipeline = (_a.jobs = _b.sent(), _a);
|
|
187
|
+
return [2 /*return*/, pipeline];
|
|
188
|
+
case 3:
|
|
269
189
|
throw new Error("".concat(type, " is not supported"));
|
|
270
190
|
}
|
|
271
191
|
});
|
|
272
192
|
});
|
|
273
193
|
};
|
|
274
|
-
|
|
275
194
|
exports.createChildPipeline = createChildPipeline;
|