@abgov/nx-oc 13.0.1 → 13.1.0
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/package.json +1 -1
- package/src/generators/deployment/deployment.js +2 -2
- package/src/generators/deployment/deployment.js.map +1 -1
- package/src/generators/deployment/deployment.spec.ts +5 -4
- package/src/generators/deployment/schema.json +6 -26
- package/src/generators/sandbox/schema.json +3 -2
- package/src/generators/teardown/schema.json +3 -6
package/package.json
CHANGED
|
@@ -53,8 +53,8 @@ function default_1(host, options) {
|
|
|
53
53
|
}
|
|
54
54
|
const normalizedOptions = yield normalizeOptions(host, options);
|
|
55
55
|
if (!normalizedOptions.appType) {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
throw new Error(`Could not detect the application type for "${normalizedOptions.projectName}" from its build target. ` +
|
|
57
|
+
`Pass --appType=node|frontend|dotnet to set it explicitly.`);
|
|
58
58
|
}
|
|
59
59
|
config.targets = Object.assign(Object.assign({}, config.targets), { 'apply-envs': {
|
|
60
60
|
executor: '@abgov/nx-oc:apply',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/deployment/deployment.ts"],"names":[],"mappings":";;AAuEA,
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/deployment/deployment.ts"],"names":[],"mappings":";;AAuEA,4BAuCC;;AA9GD,uCAOoB;AACpB,6BAA6B;AAC7B,6BAA6B;AAC7B,uDAA2D;AAC3D,qDAAuE;AACvE,mDAAiF;AAEjF,qCAAkD;AAElD,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAExD,SAAe,gBAAgB,CAC7B,IAAU,EACV,OAAe;;;QAEf,MAAM,WAAW,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QAEpD,MAAM,MAAM,GAAG,IAAI,CA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AC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;;wBAAC,OAAA,CAAC;4BAC9D,OAAO;4BACP,GAAG,EAAE,MAAA,4BAAI,CAAC,CAAC,CAAC,0CAAE,WAAW,EAAE;yBAC5B,CAAC,CAAA;qBAAA,CAAC;iBACJ;aACF,GACF,CAAC;QAEF,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAE1D,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAClC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA"}
|
|
@@ -253,7 +253,7 @@ describe('Deployment Generator', () => {
|
|
|
253
253
|
expect(manifest).not.toContain('initContainers');
|
|
254
254
|
});
|
|
255
255
|
|
|
256
|
-
it('
|
|
256
|
+
it('throws an actionable error when the app type cannot be detected', async () => {
|
|
257
257
|
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
258
258
|
await pipeline(host, {
|
|
259
259
|
pipeline: 'test',
|
|
@@ -273,10 +273,11 @@ describe('Deployment Generator', () => {
|
|
|
273
273
|
},
|
|
274
274
|
});
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
// Unrecognized build executor + no --appType → detection fails → actionable throw.
|
|
277
|
+
await expect(
|
|
278
|
+
generator(host, { ...options, appType: null })
|
|
279
|
+
).rejects.toThrow(/--appType/);
|
|
277
280
|
expect(host.exists('.openshift/test/test.yml')).toBeFalsy();
|
|
278
|
-
expect(host.exists('.openshift/test/Dockerfile')).toBeFalsy();
|
|
279
|
-
|
|
280
281
|
const config = readProjectConfiguration(host, 'test');
|
|
281
282
|
expect(config.targets['apply-envs']).toBeFalsy();
|
|
282
283
|
});
|
|
@@ -15,39 +15,23 @@
|
|
|
15
15
|
},
|
|
16
16
|
"appType": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "Application type. Auto-detected from the project build target; only pass this to override detection.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
"x-prompt": {
|
|
25
|
-
"message": "What type of application is the project?",
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"frontend",
|
|
29
|
-
"dotnet",
|
|
30
|
-
"node"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
23
|
+
"enum": ["frontend", "node", "dotnet"]
|
|
33
24
|
},
|
|
34
25
|
"env": {
|
|
35
26
|
"type": "string",
|
|
36
|
-
"description": "
|
|
27
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
37
28
|
"$default": {
|
|
38
29
|
"$source": "argv",
|
|
39
30
|
"index": 2
|
|
40
31
|
},
|
|
41
32
|
"alias": "e",
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"type": "list",
|
|
45
|
-
"items": [
|
|
46
|
-
"dev",
|
|
47
|
-
"test",
|
|
48
|
-
"prod"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
33
|
+
"enum": ["test", "prod", "dev"],
|
|
34
|
+
"default": "test"
|
|
51
35
|
},
|
|
52
36
|
"accessToken": {
|
|
53
37
|
"type": "string",
|
|
@@ -64,10 +48,6 @@
|
|
|
64
48
|
"description": "Generate a sandbox deployment manifest (local image push, no ImageStream trigger)."
|
|
65
49
|
}
|
|
66
50
|
},
|
|
67
|
-
"required": [
|
|
68
|
-
"project",
|
|
69
|
-
"appType",
|
|
70
|
-
"env"
|
|
71
|
-
],
|
|
51
|
+
"required": ["project", "appType", "env"],
|
|
72
52
|
"additionalProperties": false
|
|
73
53
|
}
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"env": {
|
|
33
33
|
"type": "string",
|
|
34
|
-
"description": "ADSP environment to target.",
|
|
35
|
-
"default": "
|
|
34
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
35
|
+
"default": "test",
|
|
36
|
+
"enum": ["test", "prod", "dev"]
|
|
36
37
|
},
|
|
37
38
|
"accessToken": {
|
|
38
39
|
"type": "string",
|
|
@@ -15,17 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": ["dev", "test", "prod"]
|
|
28
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
29
26
|
}
|
|
30
27
|
},
|
|
31
28
|
"required": ["project", "env"],
|