@catladder/pipeline 3.30.0 → 3.30.1
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/rails/index.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/automatic-releases.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-execute-script-on-deploy.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-http2.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-llama.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +1 -1
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +1 -1
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +1 -1
- package/examples/__snapshots__/custom-build-job.test.ts.snap +1 -1
- package/examples/__snapshots__/custom-deploy.test.ts.snap +1 -1
- package/examples/__snapshots__/custom-envs.test.ts.snap +1 -1
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +1 -1
- package/examples/__snapshots__/custom-verify-job.test.ts.snap +1 -1
- package/examples/__snapshots__/git-submodule.test.ts.snap +1 -1
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +1 -1
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +1 -1
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +1 -1
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +1 -1
- package/examples/__snapshots__/local-dot-env.test.ts.snap +1 -1
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +1 -1
- package/examples/__snapshots__/modify-generated-files.test.ts.snap +1 -1
- package/examples/__snapshots__/modify-generated-yaml.test.ts.snap +1 -1
- package/examples/__snapshots__/multiline-var.test.ts.snap +1 -1
- package/examples/__snapshots__/native-app.test.ts.snap +1 -1
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +1 -1
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +1 -1
- package/examples/__snapshots__/override-secrets.test.ts.snap +1 -1
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +1 -1
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +1 -1
- package/examples/__snapshots__/referencing-other-vars.test.ts.snap +1 -1
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +1 -1
- package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +1 -1
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +1 -1
- package/examples/automatic-releases.test.ts +1 -0
- package/examples/cloud-run-execute-script-on-deploy.test.ts +1 -0
- package/examples/cloud-run-health-check-defaults.test.ts +1 -0
- package/examples/cloud-run-health-check-only-startup.test.ts +1 -0
- package/examples/cloud-run-health-check.test.ts +1 -0
- package/examples/cloud-run-http2.test.ts +1 -0
- package/examples/cloud-run-llama.test.ts +1 -0
- package/examples/cloud-run-memory-limit.test.ts +1 -0
- package/examples/cloud-run-meteor-with-worker.test.ts +1 -0
- package/examples/cloud-run-nextjs.test.ts +1 -0
- package/examples/cloud-run-no-cpu-throttling.test.ts +1 -0
- package/examples/cloud-run-no-service.test.ts +1 -0
- package/examples/cloud-run-non-public.test.ts +1 -0
- package/examples/cloud-run-post-stop-job.test.ts +1 -0
- package/examples/cloud-run-service-custom-vpc-connector.test.ts +1 -0
- package/examples/cloud-run-service-custom-vpc.test.ts +1 -0
- package/examples/cloud-run-service-gen2.test.ts +1 -0
- package/examples/cloud-run-service-increase-timout.test.ts +1 -0
- package/examples/cloud-run-service-with-volumes.test.ts +1 -0
- package/examples/cloud-run-storybook.test.ts +1 -0
- package/examples/cloud-run-with-agents.test.ts +1 -0
- package/examples/cloud-run-with-gpu.test.ts +1 -0
- package/examples/cloud-run-with-ngnix.test.ts +1 -0
- package/examples/cloud-run-with-sql-legacy-jobs.test.ts +1 -0
- package/examples/cloud-run-with-sql-multiple-dbs.test.ts +1 -0
- package/examples/cloud-run-with-sql-reuse-db.test.ts +1 -0
- package/examples/cloud-run-with-sql.test.ts +1 -0
- package/examples/cloud-run-with-worker.test.ts +1 -0
- package/examples/custom-build-job-with-tests.test.ts +1 -0
- package/examples/custom-build-job.test.ts +1 -0
- package/examples/custom-deploy.test.ts +1 -0
- package/examples/custom-envs.test.ts +1 -0
- package/examples/custom-sbom-java.test.ts +1 -0
- package/examples/custom-verify-job.test.ts +1 -0
- package/examples/git-submodule.test.ts +1 -0
- package/examples/kubernetes-application-customization.test.ts +1 -0
- package/examples/kubernetes-with-cloud-sql.test.ts +1 -0
- package/examples/kubernetes-with-jobs.test.ts +1 -0
- package/examples/kubernetes-with-mongodb.test.ts +1 -0
- package/examples/local-dot-env.test.ts +1 -0
- package/examples/meteor-kubernetes.test.ts +1 -0
- package/examples/modify-generated-files.test.ts +1 -0
- package/examples/modify-generated-yaml.test.ts +1 -0
- package/examples/multiline-var.test.ts +1 -0
- package/examples/native-app.test.ts +1 -0
- package/examples/node-build-with-custom-image.test.ts +1 -0
- package/examples/node-build-with-docker-additions.test.ts +1 -0
- package/examples/override-secrets.test.ts +1 -0
- package/examples/rails-k8s-with-worker.test.ts +1 -0
- package/examples/referencing-other-vars.test.ts +1 -0
- package/examples/wait-for-other-deploy.test.ts +1 -0
- package/examples/workspace-api-www-turbo-cache.test.ts +1 -0
- package/examples/workspace-api-www.test.ts +1 -0
- package/package.json +1 -3
- package/scripts/generate-examples-test.ts +1 -0
- package/src/build/base/__tests__/__snapshots__/createArtifactsConfig.test.ts.snap +4 -4
- package/src/build/base/__tests__/createArtifactsConfig.test.ts +1 -0
- package/src/build/custom/__tests__/testJob.test.ts +1 -0
- package/src/build/rails/index.ts +1 -1
- package/src/config/__tests__/__snapshots__/getAllEnvs.test.ts.snap +4 -4
- package/src/config/__tests__/__snapshots__/getAllEnvsInAllComponents.test.ts.snap +2 -2
- package/src/config/__tests__/configruedEnvs.test.ts +1 -0
- package/src/config/__tests__/getAllEnvs.test.ts +1 -0
- package/src/config/__tests__/getAllEnvsInAllComponents.test.ts +1 -0
- package/src/pipeline/__tests__/__snapshots__/getPipelineStages.test.ts.snap +2 -2
- package/src/pipeline/__tests__/getPipelineStages.test.ts +1 -0
- package/src/variables/__tests__/resolveAllReferences.test.ts +1 -0
- package/src/variables/__tests__/resolveAllReferencesOnce.test.ts +1 -0
- package/src/variables/__tests__/resolveReferencesOnce.test.ts +1 -0
- package/src/variables/__tests__/variableValue.test.ts +1 -0
- package/tsconfig.json +2 -1
- package/dist/build/base/__tests__/createArtifactsConfig.test.d.ts +0 -1
- package/dist/build/base/__tests__/createArtifactsConfig.test.js +0 -42
- package/dist/build/custom/__tests__/testJob.test.d.ts +0 -1
- package/dist/build/custom/__tests__/testJob.test.js +0 -36
- package/dist/config/__tests__/configruedEnvs.test.d.ts +0 -1
- package/dist/config/__tests__/configruedEnvs.test.js +0 -112
- package/dist/config/__tests__/getAllEnvs.test.d.ts +0 -1
- package/dist/config/__tests__/getAllEnvs.test.js +0 -79
- package/dist/config/__tests__/getAllEnvsInAllComponents.test.d.ts +0 -1
- package/dist/config/__tests__/getAllEnvsInAllComponents.test.js +0 -73
- package/dist/pipeline/__tests__/getPipelineStages.test.d.ts +0 -1
- package/dist/pipeline/__tests__/getPipelineStages.test.js +0 -73
- package/dist/variables/__tests__/resolveAllReferences.test.d.ts +0 -1
- package/dist/variables/__tests__/resolveAllReferences.test.js +0 -218
- package/dist/variables/__tests__/resolveAllReferencesOnce.test.d.ts +0 -1
- package/dist/variables/__tests__/resolveAllReferencesOnce.test.js +0 -171
- package/dist/variables/__tests__/resolveReferencesOnce.test.d.ts +0 -1
- package/dist/variables/__tests__/resolveReferencesOnce.test.js +0 -199
- package/dist/variables/__tests__/variableValue.test.d.ts +0 -1
- package/dist/variables/__tests__/variableValue.test.js +0 -36
- /package/dist/build/rails/{test.d.ts → testJob.d.ts} +0 -0
- /package/dist/build/rails/{test.js → testJob.js} +0 -0
- /package/src/build/rails/{test.ts → testJob.ts} +0 -0
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"license": "MIT",
|
|
56
|
-
"version": "3.30.
|
|
56
|
+
"version": "3.30.1",
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build:tsc": "yarn tsc",
|
|
59
59
|
"build": "yarn build:compile && yarn build:inline-variables",
|
|
@@ -73,9 +73,7 @@
|
|
|
73
73
|
"@babel/core": "^7.25.2",
|
|
74
74
|
"@babel/plugin-syntax-typescript": "^7.25.4",
|
|
75
75
|
"@babel/preset-typescript": "^7.24.7",
|
|
76
|
-
"@jest/globals": "^29.7.0",
|
|
77
76
|
"@types/child-process-promise": "^2.2.6",
|
|
78
|
-
"@types/jest": "^29.5.12",
|
|
79
77
|
"@types/lodash": "^4.17.7",
|
|
80
78
|
"@types/node": "^22.5.1",
|
|
81
79
|
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
|
@@ -56,6 +56,7 @@ async function main() {
|
|
|
56
56
|
exampleFiles.map(async (exampleFile) => {
|
|
57
57
|
const kebabName = basename(exampleFile, ".ts");
|
|
58
58
|
const testFileContent = [
|
|
59
|
+
`import { it, expect } from "vitest";`,
|
|
59
60
|
`import { createYamlLocalPipeline } from "./__utils__/helpers";`,
|
|
60
61
|
`import config from "./${kebabName}";`,
|
|
61
62
|
`\n/**`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`createArtifactsConfig merges junit files if both given 1`] = `
|
|
3
|
+
exports[`createArtifactsConfig > merges junit files if both given 1`] = `
|
|
4
4
|
{
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"paths": [
|
|
@@ -17,7 +17,7 @@ exports[`createArtifactsConfig merges junit files if both given 1`] = `
|
|
|
17
17
|
}
|
|
18
18
|
`;
|
|
19
19
|
|
|
20
|
-
exports[`createArtifactsConfig returns artifacts if no artifactsReports 1`] = `
|
|
20
|
+
exports[`createArtifactsConfig > returns artifacts if no artifactsReports 1`] = `
|
|
21
21
|
{
|
|
22
22
|
"artifacts": {
|
|
23
23
|
"paths": [
|
|
@@ -35,7 +35,7 @@ exports[`createArtifactsConfig returns artifacts if no artifactsReports 1`] = `
|
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
37
|
|
|
38
|
-
exports[`createArtifactsConfig returns junit parts of artifactsReports 1`] = `
|
|
38
|
+
exports[`createArtifactsConfig > returns junit parts of artifactsReports 1`] = `
|
|
39
39
|
{
|
|
40
40
|
"artifacts": {
|
|
41
41
|
"paths": [],
|
package/src/build/rails/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentContextWithBuild } from "../../types";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
import { createRailsBuildJobs } from "./build";
|
|
4
|
-
import { createRailsTestJobs } from "./
|
|
4
|
+
import { createRailsTestJobs } from "./testJob";
|
|
5
5
|
|
|
6
6
|
export const createRailsJobs = (
|
|
7
7
|
context: ComponentContextWithBuild,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`getAllEnvs() should return all envs for app1 1`] = `
|
|
3
|
+
exports[`getAllEnvs() > should return all envs for app1 1`] = `
|
|
4
4
|
[
|
|
5
5
|
"dev",
|
|
6
6
|
"review",
|
|
@@ -10,7 +10,7 @@ exports[`getAllEnvs() should return all envs for app1 1`] = `
|
|
|
10
10
|
]
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
|
-
exports[`getAllEnvs() should return all envs for app2 1`] = `
|
|
13
|
+
exports[`getAllEnvs() > should return all envs for app2 1`] = `
|
|
14
14
|
[
|
|
15
15
|
"dev",
|
|
16
16
|
"review",
|
|
@@ -24,7 +24,7 @@ exports[`getAllEnvs() should return all envs for app2 1`] = `
|
|
|
24
24
|
]
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
|
-
exports[`getAllEnvs() should return all envs for app3 1`] = `
|
|
27
|
+
exports[`getAllEnvs() > should return all envs for app3 1`] = `
|
|
28
28
|
[
|
|
29
29
|
"local",
|
|
30
30
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`getAllEnvsInAllComponents() should return all envs for SIMPLE_CONFIG1 1`] = `
|
|
3
|
+
exports[`getAllEnvsInAllComponents() > should return all envs for SIMPLE_CONFIG1 1`] = `
|
|
4
4
|
[
|
|
5
5
|
"dev",
|
|
6
6
|
"review",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`getPipelineStages() should return all envs for SIMPLE_CONFIG1 1`] = `
|
|
3
|
+
exports[`getPipelineStages() > should return all envs for SIMPLE_CONFIG1 1`] = `
|
|
4
4
|
[
|
|
5
5
|
"setup",
|
|
6
6
|
"setup dev",
|
package/tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var createArtifactsConfig_1 = require("../createArtifactsConfig");
|
|
7
|
-
describe("createArtifactsConfig", function () {
|
|
8
|
-
it("returns undefined if no artifacts or artifactsReports", function () {
|
|
9
|
-
expect((0, createArtifactsConfig_1.createArtifactsConfig)(".")).toBeUndefined();
|
|
10
|
-
});
|
|
11
|
-
it("returns artifacts if no artifactsReports", function () {
|
|
12
|
-
expect((0, createArtifactsConfig_1.createArtifactsConfig)(".", undefined, {
|
|
13
|
-
paths: ["testpath"],
|
|
14
|
-
reports: {
|
|
15
|
-
coverage_report: {
|
|
16
|
-
coverage_format: "cobertura",
|
|
17
|
-
path: "some"
|
|
18
|
-
},
|
|
19
|
-
terraform: "something"
|
|
20
|
-
}
|
|
21
|
-
})).toMatchSnapshot();
|
|
22
|
-
});
|
|
23
|
-
it("returns junit parts of artifactsReports", function () {
|
|
24
|
-
expect((0, createArtifactsConfig_1.createArtifactsConfig)(".", {
|
|
25
|
-
junit: ["report.xml"]
|
|
26
|
-
})).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
it("merges junit files if both given", function () {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
var result = (0, createArtifactsConfig_1.createArtifactsConfig)(".", {
|
|
31
|
-
junit: ["partial-report.xml"]
|
|
32
|
-
}, {
|
|
33
|
-
paths: ["testpath"],
|
|
34
|
-
reports: {
|
|
35
|
-
junit: "full-report.xml",
|
|
36
|
-
terraform: "something"
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
expect(result).toMatchSnapshot();
|
|
40
|
-
expect((_b = (_a = result === null || result === void 0 ? void 0 : result.artifacts) === null || _a === void 0 ? void 0 : _a.reports) === null || _b === void 0 ? void 0 : _b.junit).toHaveLength(2);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var testJob_1 = require("../testJob");
|
|
7
|
-
describe("createCustomTestJobs", function () {
|
|
8
|
-
var baseContext = {
|
|
9
|
-
name: "testComponent",
|
|
10
|
-
environment: {
|
|
11
|
-
jobOnlyVars: {
|
|
12
|
-
build: {}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
build: {
|
|
16
|
-
config: {
|
|
17
|
-
type: "custom",
|
|
18
|
-
docker: {
|
|
19
|
-
type: "custom"
|
|
20
|
-
},
|
|
21
|
-
jobImage: ""
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
it("throws error when not build type custom", function () {
|
|
26
|
-
baseContext.build.config.type = "node";
|
|
27
|
-
expect(function () {
|
|
28
|
-
return (0, testJob_1.createCustomTestJobs)(baseContext);
|
|
29
|
-
}).toThrowError("deploy config is not custom");
|
|
30
|
-
baseContext.build.config.type = "custom";
|
|
31
|
-
});
|
|
32
|
-
it("returns empty array if no audit, lint, and test definition", function () {
|
|
33
|
-
var jobs = (0, testJob_1.createCustomTestJobs)(baseContext);
|
|
34
|
-
expect(jobs).toEqual([]);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var __1 = require("..");
|
|
7
|
-
describe("getAllEnvsByTrigger", function () {
|
|
8
|
-
var cluster = {
|
|
9
|
-
type: "gcloud",
|
|
10
|
-
name: "mega-cluster",
|
|
11
|
-
projectId: "super-google-project",
|
|
12
|
-
region: "ch-blabla"
|
|
13
|
-
};
|
|
14
|
-
var SIMPLE_CONFIG = {
|
|
15
|
-
appName: "my-app",
|
|
16
|
-
customerName: "pan",
|
|
17
|
-
components: {
|
|
18
|
-
app1: {
|
|
19
|
-
dir: "dir1",
|
|
20
|
-
build: {
|
|
21
|
-
type: "node"
|
|
22
|
-
},
|
|
23
|
-
deploy: {
|
|
24
|
-
type: "kubernetes",
|
|
25
|
-
cluster: cluster
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
app2: {
|
|
29
|
-
dir: "dir2",
|
|
30
|
-
build: {
|
|
31
|
-
type: "node"
|
|
32
|
-
},
|
|
33
|
-
deploy: {
|
|
34
|
-
type: "kubernetes",
|
|
35
|
-
cluster: cluster
|
|
36
|
-
},
|
|
37
|
-
env: {
|
|
38
|
-
dev2: {
|
|
39
|
-
type: "dev"
|
|
40
|
-
},
|
|
41
|
-
review2: {
|
|
42
|
-
type: "review"
|
|
43
|
-
},
|
|
44
|
-
stage2: {
|
|
45
|
-
type: "stage"
|
|
46
|
-
},
|
|
47
|
-
prod2: {
|
|
48
|
-
type: "prod"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
app3: {
|
|
53
|
-
dir: "dir2",
|
|
54
|
-
build: {
|
|
55
|
-
type: "node"
|
|
56
|
-
},
|
|
57
|
-
deploy: {
|
|
58
|
-
type: "kubernetes",
|
|
59
|
-
cluster: cluster
|
|
60
|
-
},
|
|
61
|
-
env: {
|
|
62
|
-
dev: false,
|
|
63
|
-
review: false,
|
|
64
|
-
stage: false,
|
|
65
|
-
prod: false
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
describe("mainBranch", function () {
|
|
71
|
-
it("always includes dev if not disabled", function () {
|
|
72
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app1", "mainBranch");
|
|
73
|
-
expect(envs).toEqual(["dev"]);
|
|
74
|
-
});
|
|
75
|
-
it("returns additional dev environments", function () {
|
|
76
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app2", "mainBranch");
|
|
77
|
-
expect(envs).toEqual(["dev", "dev2"]);
|
|
78
|
-
});
|
|
79
|
-
it("does not include disabled envs", function () {
|
|
80
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app3", "mainBranch");
|
|
81
|
-
expect(envs).toEqual([]);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
describe("mr", function () {
|
|
85
|
-
it("always includes review if not disabled", function () {
|
|
86
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app1", "mr");
|
|
87
|
-
expect(envs).toEqual(["review"]);
|
|
88
|
-
});
|
|
89
|
-
it("returns additional dev environments", function () {
|
|
90
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app2", "mr");
|
|
91
|
-
expect(envs).toEqual(["review", "review2"]);
|
|
92
|
-
});
|
|
93
|
-
it("does not include disabled envs", function () {
|
|
94
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app3", "mr");
|
|
95
|
-
expect(envs).toEqual([]);
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
describe("taggedRelease", function () {
|
|
99
|
-
it("always includes review if not disabled", function () {
|
|
100
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app1", "taggedRelease");
|
|
101
|
-
expect(envs).toEqual(["stage", "prod"]);
|
|
102
|
-
});
|
|
103
|
-
it("returns additional dev environments", function () {
|
|
104
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app2", "taggedRelease");
|
|
105
|
-
expect(envs).toEqual(["stage", "prod", "stage2", "prod2"]);
|
|
106
|
-
});
|
|
107
|
-
it("does not include disabled envs", function () {
|
|
108
|
-
var envs = (0, __1.getAllEnvsByTrigger)(SIMPLE_CONFIG, "app3", "taggedRelease");
|
|
109
|
-
expect(envs).toEqual([]);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var configruedEnvs_1 = require("../configruedEnvs");
|
|
7
|
-
describe("getAllEnvs()", function () {
|
|
8
|
-
var cluster = {
|
|
9
|
-
type: "gcloud",
|
|
10
|
-
name: "mega-cluster",
|
|
11
|
-
projectId: "super-google-project",
|
|
12
|
-
region: "ch-blabla"
|
|
13
|
-
};
|
|
14
|
-
var SIMPLE_CONFIG = {
|
|
15
|
-
appName: "my-app",
|
|
16
|
-
customerName: "pan",
|
|
17
|
-
components: {
|
|
18
|
-
app1: {
|
|
19
|
-
dir: "dir1",
|
|
20
|
-
build: {
|
|
21
|
-
type: "node"
|
|
22
|
-
},
|
|
23
|
-
deploy: {
|
|
24
|
-
type: "kubernetes",
|
|
25
|
-
cluster: cluster
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
app2: {
|
|
29
|
-
dir: "dir2",
|
|
30
|
-
build: {
|
|
31
|
-
type: "node"
|
|
32
|
-
},
|
|
33
|
-
deploy: {
|
|
34
|
-
type: "kubernetes",
|
|
35
|
-
cluster: cluster
|
|
36
|
-
},
|
|
37
|
-
env: {
|
|
38
|
-
dev2: {
|
|
39
|
-
type: "dev"
|
|
40
|
-
},
|
|
41
|
-
review2: {
|
|
42
|
-
type: "review"
|
|
43
|
-
},
|
|
44
|
-
stage2: {
|
|
45
|
-
type: "stage"
|
|
46
|
-
},
|
|
47
|
-
prod2: {
|
|
48
|
-
type: "prod"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
app3: {
|
|
53
|
-
dir: "dir2",
|
|
54
|
-
build: {
|
|
55
|
-
type: "node"
|
|
56
|
-
},
|
|
57
|
-
deploy: {
|
|
58
|
-
type: "kubernetes",
|
|
59
|
-
cluster: cluster
|
|
60
|
-
},
|
|
61
|
-
env: {
|
|
62
|
-
dev: false,
|
|
63
|
-
review: false,
|
|
64
|
-
stage: false,
|
|
65
|
-
prod: false
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
it("should return all envs for app1", function () {
|
|
71
|
-
expect((0, configruedEnvs_1.getAllEnvs)(SIMPLE_CONFIG, "app1")).toMatchSnapshot();
|
|
72
|
-
});
|
|
73
|
-
it("should return all envs for app2", function () {
|
|
74
|
-
expect((0, configruedEnvs_1.getAllEnvs)(SIMPLE_CONFIG, "app2")).toMatchSnapshot();
|
|
75
|
-
});
|
|
76
|
-
it("should return all envs for app3", function () {
|
|
77
|
-
expect((0, configruedEnvs_1.getAllEnvs)(SIMPLE_CONFIG, "app3")).toMatchSnapshot();
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var configruedEnvs_1 = require("../configruedEnvs");
|
|
7
|
-
describe("getAllEnvsInAllComponents()", function () {
|
|
8
|
-
var cluster = {
|
|
9
|
-
type: "gcloud",
|
|
10
|
-
name: "mega-cluster",
|
|
11
|
-
projectId: "super-google-project",
|
|
12
|
-
region: "ch-blabla"
|
|
13
|
-
};
|
|
14
|
-
var SIMPLE_CONFIG1 = {
|
|
15
|
-
appName: "my-app",
|
|
16
|
-
customerName: "pan",
|
|
17
|
-
components: {
|
|
18
|
-
app1: {
|
|
19
|
-
dir: "dir1",
|
|
20
|
-
build: {
|
|
21
|
-
type: "node"
|
|
22
|
-
},
|
|
23
|
-
deploy: {
|
|
24
|
-
type: "kubernetes",
|
|
25
|
-
cluster: cluster
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
app2: {
|
|
29
|
-
dir: "dir2",
|
|
30
|
-
build: {
|
|
31
|
-
type: "node"
|
|
32
|
-
},
|
|
33
|
-
deploy: {
|
|
34
|
-
type: "kubernetes",
|
|
35
|
-
cluster: cluster
|
|
36
|
-
},
|
|
37
|
-
env: {
|
|
38
|
-
dev2: {
|
|
39
|
-
type: "dev"
|
|
40
|
-
},
|
|
41
|
-
review2: {
|
|
42
|
-
type: "review"
|
|
43
|
-
},
|
|
44
|
-
stage2: {
|
|
45
|
-
type: "stage"
|
|
46
|
-
},
|
|
47
|
-
prod2: {
|
|
48
|
-
type: "prod"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
app3: {
|
|
53
|
-
dir: "dir2",
|
|
54
|
-
build: {
|
|
55
|
-
type: "node"
|
|
56
|
-
},
|
|
57
|
-
deploy: {
|
|
58
|
-
type: "kubernetes",
|
|
59
|
-
cluster: cluster
|
|
60
|
-
},
|
|
61
|
-
env: {
|
|
62
|
-
dev: false,
|
|
63
|
-
review: false,
|
|
64
|
-
stage: false,
|
|
65
|
-
prod: false
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
it("should return all envs for SIMPLE_CONFIG1", function () {
|
|
71
|
-
expect((0, configruedEnvs_1.getAllEnvsInAllComponents)(SIMPLE_CONFIG1)).toMatchSnapshot();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|