@catladder/pipeline 1.75.3 → 1.75.5
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/build/base/createBuildJob.js +5 -27
- package/dist/build/base/writeBuildInfo.js +0 -3
- package/dist/build/custom/buildJob.js +3 -23
- package/dist/build/custom/index.js +3 -10
- package/dist/build/docker.js +5 -40
- package/dist/build/index.js +0 -8
- package/dist/build/node/buildJob.js +3 -25
- package/dist/build/node/cache.js +3 -21
- package/dist/build/node/index.js +3 -16
- package/dist/build/node/meteor.js +3 -20
- package/dist/build/node/testJob.js +5 -22
- package/dist/build/node/yarn.js +5 -18
- package/dist/build/rails/build.js +2 -8
- package/dist/build/rails/index.js +3 -11
- package/dist/build/rails/test.js +5 -18
- package/dist/build/types.d.ts +0 -9
- package/dist/build/types.js +0 -4
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/catladder-gitlab.js +6 -24
- 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.js +7 -22
- package/dist/config/index.js +0 -4
- 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/{resolveReferences.test.js → __tests__/resolveReferences.test.js} +52 -103
- package/dist/context/getEnvConfig.js +0 -8
- package/dist/context/getEnvType.js +0 -5
- package/dist/context/getEnvironment.js +13 -49
- package/dist/context/getEnvironmentContext.js +0 -5
- package/dist/context/getEnvironmentVariables.js +20 -83
- package/dist/context/getLabels.js +2 -13
- package/dist/context/index.js +13 -58
- package/dist/context/resolveReferences.js +36 -126
- package/dist/deploy/base.js +4 -19
- package/dist/deploy/cloudRun/deployJob.js +19 -61
- package/dist/deploy/cloudRun/index.js +15 -37
- package/dist/deploy/cloudRun/utils/database.js +11 -29
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +0 -4
- package/dist/deploy/cloudRun/utils/jobName.js +0 -2
- package/dist/deploy/custom/deployJob.js +3 -18
- package/dist/deploy/custom/index.js +0 -2
- package/dist/deploy/dockerTag/deployJob.js +0 -9
- package/dist/deploy/dockerTag/index.js +0 -2
- package/dist/deploy/index.js +0 -11
- package/dist/deploy/kubernetes/additionalSecretKeys.js +0 -9
- package/dist/deploy/kubernetes/cloudSql/index.js +0 -12
- package/dist/deploy/kubernetes/deployJob.js +3 -24
- package/dist/deploy/kubernetes/index.js +7 -17
- package/dist/deploy/kubernetes/kubeEnv.d.ts +0 -1
- package/dist/deploy/kubernetes/kubeEnv.js +5 -23
- package/dist/deploy/kubernetes/kubeValues.js +6 -24
- package/dist/deploy/kubernetes/mongodb.js +0 -24
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +2 -10
- package/dist/deploy/types/base.d.ts +0 -1
- package/dist/deploy/types/custom.d.ts +0 -6
- package/dist/deploy/types/googleCloudRun.d.ts +0 -12
- package/dist/deploy/types/index.js +0 -10
- package/dist/deploy/types/kubernetes.d.ts +1 -28
- package/dist/deploy/utils.js +0 -11
- package/dist/index.js +0 -10
- package/dist/pipeline/commitInfo/getBuildId.d.ts +1 -0
- package/dist/pipeline/{createChildPipeline.test.js → commitInfo/getBuildId.js} +25 -84
- package/dist/pipeline/commitInfo/getCommitInfo.d.ts +2 -0
- package/dist/{build/tests/storybook.test.js → pipeline/commitInfo/getCommitInfo.js} +30 -104
- package/dist/pipeline/createChildPipeline.js +19 -76
- package/dist/pipeline/createJobs.js +35 -135
- package/dist/pipeline/gitlab/makeGitlabJob.d.ts +1 -0
- package/dist/pipeline/gitlab/makeGitlabJob.js +13 -15
- package/dist/pipeline/index.js +0 -4
- 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/runner/index.js +0 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +0 -13
- package/dist/types/config.js +5 -15
- package/dist/types/context.d.ts +0 -2
- package/dist/types/environmentContext.d.ts +0 -1
- package/dist/types/gitlab-types.d.ts +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/jobs.d.ts +5 -15
- package/dist/utils/gitlab.js +3 -13
- package/dist/utils/index.js +5 -15
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1765 -0
- package/examples/__snapshots__/custom-build-job.ts.snap +1174 -0
- package/examples/__snapshots__/custom-envs.ts.snap +261 -0
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +1626 -0
- package/examples/__utils__/helpers.ts +14 -0
- package/examples/{cloud-sql.ts → cloud-run-with-sql.ts} +11 -15
- package/examples/custom-build-job.ts +4 -1
- package/examples/custom-envs.ts +31 -0
- package/examples/wait-for-other-deploy.ts +36 -0
- package/package.json +2 -2
- package/src/config/{configruedEnvs.test.ts → __tests__/configruedEnvs.test.ts} +3 -3
- package/src/context/{resolveReferences.test.ts → __tests__/resolveReferences.test.ts} +3 -3
- package/src/deploy/types/kubernetes.ts +1 -0
- package/src/pipeline/commitInfo/getBuildId.ts +6 -0
- package/src/pipeline/commitInfo/getCommitInfo.ts +12 -0
- package/src/pipeline/createChildPipeline.ts +6 -1
- package/src/pipeline/createJobs.ts +3 -10
- package/src/pipeline/gitlab/makeGitlabJob.ts +7 -1
- package/src/pipeline/packageManager.ts +4 -38
- package/src/pipeline/yarn/yarnUtils.ts +37 -0
- package/src/types/jobs.ts +2 -1
- package/tsconfig.json +1 -1
- package/dist/build/tests/storybook.test.d.ts +0 -1
- package/dist/pipeline/createChildPipeline.test.d.ts +0 -1
- package/src/build/tests/storybook.test.ts +0 -54
- package/src/pipeline/createChildPipeline.test.ts +0 -49
|
@@ -4,22 +4,18 @@ export declare type DeployConfigKubernetesClusterGCloud = {
|
|
|
4
4
|
/**
|
|
5
5
|
* gcoud name of the cluster
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
name: string;
|
|
9
8
|
/**
|
|
10
9
|
* google cloud project id
|
|
11
10
|
*/
|
|
12
|
-
|
|
13
11
|
projectId: string;
|
|
14
12
|
/**
|
|
15
13
|
* region
|
|
16
14
|
*/
|
|
17
|
-
|
|
18
15
|
region: string;
|
|
19
16
|
/**
|
|
20
17
|
* domain of the cluster, for canonical domains without custom host (e.g. review and dev apps)
|
|
21
18
|
*/
|
|
22
|
-
|
|
23
19
|
domainCanonical?: string;
|
|
24
20
|
};
|
|
25
21
|
export declare type DeployConfigKubernetesCluster = DeployConfigKubernetesClusterGCloud;
|
|
@@ -43,7 +39,6 @@ export declare type KubernetesAutoscale = {
|
|
|
43
39
|
/**
|
|
44
40
|
* declare a number of metrics (at least one). Usually you would use cpu as a metric
|
|
45
41
|
*/
|
|
46
|
-
|
|
47
42
|
metrics: KubernetesAutoscaleMetric[];
|
|
48
43
|
};
|
|
49
44
|
export declare type KubernetesResourcesDef = {
|
|
@@ -83,7 +78,6 @@ export declare type KubernetesUpdateStrategy = {
|
|
|
83
78
|
* can be absolute number or percentage
|
|
84
79
|
* defaults to 0 (kube default is 25%)
|
|
85
80
|
*/
|
|
86
|
-
|
|
87
81
|
maxUnavailable: number | string;
|
|
88
82
|
};
|
|
89
83
|
type: "RollingUpdate";
|
|
@@ -93,7 +87,6 @@ export declare type KubernetesWorkerDef = {
|
|
|
93
87
|
/**
|
|
94
88
|
* which command to run. defaults to `yarn start`
|
|
95
89
|
*/
|
|
96
|
-
|
|
97
90
|
command?: string;
|
|
98
91
|
resources?: KubernetesResourcesDef;
|
|
99
92
|
service?: {
|
|
@@ -111,8 +104,8 @@ export declare type DeployConfigMongodbBase = {
|
|
|
111
104
|
/**
|
|
112
105
|
* size of the volume, defaults to 8Gi
|
|
113
106
|
*/
|
|
114
|
-
|
|
115
107
|
size?: string;
|
|
108
|
+
resources?: KubernetesResourcesDef;
|
|
116
109
|
};
|
|
117
110
|
};
|
|
118
111
|
export declare type DeployConfigMongodbStandalone = {
|
|
@@ -123,7 +116,6 @@ export declare type DeployConfigMongodbReplicaset = {
|
|
|
123
116
|
/**
|
|
124
117
|
* defaults to 2
|
|
125
118
|
*/
|
|
126
|
-
|
|
127
119
|
replicaCount?: number;
|
|
128
120
|
};
|
|
129
121
|
export declare type DeployConfigMongodb = DeployConfigMongodbBase & (DeployConfigMongodbStandalone | DeployConfigMongodbReplicaset);
|
|
@@ -141,7 +133,6 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
141
133
|
* enable mongodb. The mongodb is deployed using a helm chart.
|
|
142
134
|
* See https://github.com/bitnami/charts/tree/master/bitnami/mongodb
|
|
143
135
|
*/
|
|
144
|
-
|
|
145
136
|
mongodb?: DeployConfigMongodb;
|
|
146
137
|
/**
|
|
147
138
|
* enable mailhog. Mailhog is a virtual mail server that catches all outgoing mailsl and show them in a mailbox.
|
|
@@ -151,7 +142,6 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
151
142
|
*
|
|
152
143
|
* Turn it of for production.
|
|
153
144
|
*/
|
|
154
|
-
|
|
155
145
|
mailhog?: {
|
|
156
146
|
enabled: boolean;
|
|
157
147
|
};
|
|
@@ -159,7 +149,6 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
159
149
|
* post-install/upgrade jobs. These use the app image and have all env vars available.
|
|
160
150
|
* Typically used for migrations and seeds
|
|
161
151
|
*/
|
|
162
|
-
|
|
163
152
|
jobs?: Record<string, AllowUnknownProps<{
|
|
164
153
|
/**
|
|
165
154
|
* the command to execute
|
|
@@ -170,13 +159,11 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
170
159
|
*
|
|
171
160
|
* defaults to post-install,post-upgrade
|
|
172
161
|
*/
|
|
173
|
-
|
|
174
162
|
hook?: string;
|
|
175
163
|
}>>;
|
|
176
164
|
/**
|
|
177
165
|
* cronjobs that run periodically. These use the app image have all env vars available.
|
|
178
166
|
*/
|
|
179
|
-
|
|
180
167
|
cronjobs?: Record<string, AllowUnknownProps<{
|
|
181
168
|
schedule: string;
|
|
182
169
|
command: string;
|
|
@@ -185,7 +172,6 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
185
172
|
/**
|
|
186
173
|
* configuration for the application ("Deployment" in kubernetes)
|
|
187
174
|
*/
|
|
188
|
-
|
|
189
175
|
application?: false | AllowUnknownProps<{
|
|
190
176
|
/**
|
|
191
177
|
* enable, disable app deployment, defaults to true
|
|
@@ -194,34 +180,28 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
194
180
|
/**
|
|
195
181
|
* redirects
|
|
196
182
|
*/
|
|
197
|
-
|
|
198
183
|
redirects?: AllowUnknownProps<{
|
|
199
184
|
host: string;
|
|
200
185
|
}>[];
|
|
201
186
|
/**
|
|
202
187
|
* Host aliases
|
|
203
188
|
*/
|
|
204
|
-
|
|
205
189
|
hostAliases?: string[];
|
|
206
190
|
/**
|
|
207
191
|
* how many pods will be started
|
|
208
192
|
*/
|
|
209
|
-
|
|
210
193
|
replicas?: number;
|
|
211
194
|
/**
|
|
212
195
|
* autoscale the pods horizontally
|
|
213
196
|
*/
|
|
214
|
-
|
|
215
197
|
autoscale?: KubernetesAutoscale;
|
|
216
198
|
/**
|
|
217
199
|
* the update strategy, see https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment
|
|
218
200
|
*/
|
|
219
|
-
|
|
220
201
|
updateStrategy?: KubernetesUpdateStrategy;
|
|
221
202
|
/**
|
|
222
203
|
* kubernetes resources
|
|
223
204
|
*/
|
|
224
|
-
|
|
225
205
|
resources?: KubernetesResourcesDef;
|
|
226
206
|
healthRoute?: string;
|
|
227
207
|
startupProbe?: KubernetesHealthDef;
|
|
@@ -232,7 +212,6 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
232
212
|
* The worker pod can use the same entry point as the app or a different one (specify command).
|
|
233
213
|
* It has the same environment variables as the application and an additional IS_WORKER="true" variable
|
|
234
214
|
*/
|
|
235
|
-
|
|
236
215
|
worker?: KubernetesWorkerDef;
|
|
237
216
|
}>;
|
|
238
217
|
/**
|
|
@@ -246,14 +225,12 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
246
225
|
*
|
|
247
226
|
* in all other cases use normal env var handling
|
|
248
227
|
*/
|
|
249
|
-
|
|
250
228
|
secretsFromOtherComponent?: {
|
|
251
229
|
[envVar: string]: string;
|
|
252
230
|
};
|
|
253
231
|
/**
|
|
254
232
|
* map another services internal endpoint into a env var.
|
|
255
233
|
*/
|
|
256
|
-
|
|
257
234
|
mapServiceUrlToEnv?: {
|
|
258
235
|
[envVar: string]: string;
|
|
259
236
|
};
|
|
@@ -263,7 +240,6 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
263
240
|
*
|
|
264
241
|
* @deprecated this will be removed in the future, because its very niche and not used
|
|
265
242
|
*/
|
|
266
|
-
|
|
267
243
|
secretsAsFile?: string[];
|
|
268
244
|
}>;
|
|
269
245
|
export declare type DeployConfigKubernetes = {
|
|
@@ -271,18 +247,15 @@ export declare type DeployConfigKubernetes = {
|
|
|
271
247
|
/**
|
|
272
248
|
* cluster config to use.
|
|
273
249
|
*/
|
|
274
|
-
|
|
275
250
|
cluster: DeployConfigKubernetesCluster;
|
|
276
251
|
/**
|
|
277
252
|
* prints out debug info (helm --debug)
|
|
278
253
|
*/
|
|
279
|
-
|
|
280
254
|
debug?: boolean;
|
|
281
255
|
additionalHelmArgs?: string[];
|
|
282
256
|
/**
|
|
283
257
|
* values to configure the app
|
|
284
258
|
*/
|
|
285
|
-
|
|
286
259
|
values?: DeployConfigKubernetesValues;
|
|
287
260
|
} & DeployConfigBase;
|
|
288
261
|
export {};
|
package/dist/deploy/utils.js
CHANGED
|
@@ -2,39 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.contextIsStoppable = exports.getKubernetesNamespace = exports.getFullKubernetesClusterName = void 0;
|
|
5
|
-
|
|
6
5
|
var types_1 = require("./types");
|
|
7
|
-
|
|
8
6
|
var getFullKubernetesClusterName = function (cluster) {
|
|
9
7
|
if (cluster.type === "gcloud") {
|
|
10
8
|
return "gke_".concat(cluster.projectId, "_").concat(cluster.region, "_").concat(cluster.name);
|
|
11
9
|
}
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
exports.getFullKubernetesClusterName = getFullKubernetesClusterName;
|
|
15
|
-
|
|
16
12
|
var getKubernetesNamespace = function (config, env) {
|
|
17
13
|
return "".concat(config.customerName, "-").concat(config.appName, "-").concat(env);
|
|
18
14
|
};
|
|
19
|
-
|
|
20
15
|
exports.getKubernetesNamespace = getKubernetesNamespace;
|
|
21
|
-
|
|
22
16
|
var contextIsStoppable = function (context) {
|
|
23
17
|
var deployConfig = context.componentConfig.deploy;
|
|
24
|
-
|
|
25
18
|
if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
26
19
|
return true;
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
if ((0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
30
22
|
return true;
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
if ((0, types_1.isOfDeployType)(deployConfig, "custom") && deployConfig.stopScript) {
|
|
34
25
|
return true;
|
|
35
26
|
}
|
|
36
|
-
|
|
37
27
|
return false;
|
|
38
28
|
};
|
|
39
|
-
|
|
40
29
|
exports.contextIsStoppable = contextIsStoppable;
|
package/dist/index.js
CHANGED
|
@@ -12,25 +12,15 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
13
13
|
o[k2] = m[k];
|
|
14
14
|
});
|
|
15
|
-
|
|
16
15
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
17
16
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
exports.__esModule = true;
|
|
21
|
-
|
|
22
19
|
__exportStar(require("./pipeline/"), exports);
|
|
23
|
-
|
|
24
20
|
__exportStar(require("./types"), exports);
|
|
25
|
-
|
|
26
21
|
__exportStar(require("./rules"), exports);
|
|
27
|
-
|
|
28
22
|
__exportStar(require("./runner"), exports);
|
|
29
|
-
|
|
30
23
|
__exportStar(require("./config"), exports);
|
|
31
|
-
|
|
32
24
|
__exportStar(require("./context"), exports);
|
|
33
|
-
|
|
34
25
|
__exportStar(require("./build"), exports);
|
|
35
|
-
|
|
36
26
|
__exportStar(require("./deploy"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBuildId: () => Promise<string>;
|
|
@@ -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,55 +115,21 @@ 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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
type: "node"
|
|
158
|
-
},
|
|
159
|
-
deploy: {
|
|
160
|
-
type: "kubernetes",
|
|
161
|
-
cluster: {
|
|
162
|
-
type: "gcloud",
|
|
163
|
-
name: "mega-cluster",
|
|
164
|
-
projectId: "super-google-project",
|
|
165
|
-
region: "ch-blabla"
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
119
|
+
exports.getBuildId = void 0;
|
|
120
|
+
var child_process_promise_1 = require("child-process-promise");
|
|
121
|
+
var getBuildId = function () {
|
|
122
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("git describe --tags || git rev-parse HEAD").then(function (s) {
|
|
127
|
+
return s.stdout.trim();
|
|
128
|
+
})];
|
|
129
|
+
case 1:
|
|
130
|
+
return [2 /*return*/, _a.sent()];
|
|
169
131
|
}
|
|
170
|
-
};
|
|
171
|
-
it("creates a pipeline for a single app on the main branch", function () {
|
|
172
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
173
|
-
var _a, image, jobs;
|
|
174
|
-
|
|
175
|
-
return __generator(this, function (_b) {
|
|
176
|
-
switch (_b.label) {
|
|
177
|
-
case 0:
|
|
178
|
-
return [4
|
|
179
|
-
/*yield*/
|
|
180
|
-
, (0, createChildPipeline_1.createChildPipeline)("gitlab", "mainBranch", config)];
|
|
181
|
-
|
|
182
|
-
case 1:
|
|
183
|
-
_a = _b.sent(), image = _a.image, jobs = _a.jobs;
|
|
184
|
-
expect(image).toEqual("git.panter.ch:5001/catladder/catladder/base-pipeline:");
|
|
185
|
-
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"]);
|
|
186
|
-
return [2
|
|
187
|
-
/*return*/
|
|
188
|
-
];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
132
|
});
|
|
193
133
|
});
|
|
194
|
-
}
|
|
134
|
+
};
|
|
135
|
+
exports.getBuildId = getBuildId;
|