@abgov/nx-oc 5.5.1 → 6.0.0-beta.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.
- package/package.json +8 -9
- package/src/adsp/adsp-utils.d.ts +1 -1
- package/src/adsp/adsp-utils.js +1 -1
- package/src/adsp/adsp-utils.js.map +1 -1
- package/src/adsp/environments.d.ts +1 -1
- package/src/executors/apply/apply.d.ts +1 -1
- package/src/executors/apply/apply.spec.ts +16 -16
- package/src/executors/apply/schema.json +3 -2
- package/src/generators/apply-infra/apply-infra.d.ts +1 -1
- package/src/generators/apply-infra/apply-infra.js.map +1 -1
- package/src/generators/apply-infra/apply-infra.spec.ts +5 -6
- package/src/generators/apply-infra/schema.json +0 -1
- package/src/generators/deployment/deployment.d.ts +1 -1
- package/src/generators/deployment/deployment.js +5 -5
- package/src/generators/deployment/deployment.js.map +1 -1
- package/src/generators/deployment/deployment.spec.ts +11 -14
- package/src/generators/deployment/schema.json +1 -2
- package/src/generators/pipeline/pipeline.d.ts +1 -1
- package/src/generators/pipeline/pipeline.js +1 -1
- package/src/generators/pipeline/pipeline.js.map +1 -1
- package/src/generators/pipeline/pipeline.spec.ts +7 -7
- package/src/generators/pipeline/schema.json +6 -2
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/nx-oc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"main": "src/index.js",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
6
|
"description": "Government of Alberta - Nx plugin for OpenShift.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
},
|
|
12
12
|
"generators": "./generators.json",
|
|
13
13
|
"executors": "./executors.json",
|
|
14
|
-
"peerDependencies": {
|
|
15
|
-
"@nrwl/devkit": "^15.0.0",
|
|
16
|
-
"express": "4.18.1",
|
|
17
|
-
"jest-mock": "28.1.3"
|
|
18
|
-
},
|
|
19
14
|
"dependencies": {
|
|
20
|
-
"
|
|
15
|
+
"@nx/devkit": "16.10.0",
|
|
16
|
+
"express": "4.18.2"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"jest-mock": "29.7.0"
|
|
21
20
|
},
|
|
22
|
-
"
|
|
21
|
+
"type": "commonjs"
|
|
23
22
|
}
|
package/src/adsp/adsp-utils.d.ts
CHANGED
package/src/adsp/adsp-utils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isAdspOptions = exports.getAdspConfiguration = exports.selectTenant = exports.getServiceUrls = exports.realmLogin = exports.hasDependency = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const axios_1 = require("axios");
|
|
7
7
|
const enquirer_1 = require("enquirer");
|
|
8
8
|
const express = require("express");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adsp-utils.js","sourceRoot":"","sources":["../../../../../packages/nx-oc/src/adsp/adsp-utils.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"adsp-utils.js","sourceRoot":"","sources":["../../../../../packages/nx-oc/src/adsp/adsp-utils.ts"],"names":[],"mappings":";;;;AAAA,uCAAmD;AACnD,iCAA0B;AAC1B,uCAAkC;AAClC,mCAAmC;AACnC,6BAA6B;AAC7B,iDAA+D;AAE/D,iDAA+D;AAO/D,SAAgB,aAAa,CAAC,IAAU,EAAE,UAAkB;IAC1D,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,GAAY,IAAA,iBAAQ,EACzD,IAAI,EACJ,cAAc,CACf,CAAC;IAEF,OAAO,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ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AAC,CAAC;YAE3D,OAAO;gBACL,MAAM,EAAE,IAAA,cAAK,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ;gBACnC,WAAW,EAAE,MAAM,CAAC,KAAK;gBACzB,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;gBAC9C,mBAAmB,EAAE,WAAW,CAAC,mBAAmB;aACrD,CAAC;SACH;IACH,CAAC;CAAA;AA1BD,oDA0BC;AAED,SAAgB,aAAa,CAAC,OAAgB;;IAC5C,OAAO,CAAC,CAAC,CAAA,MAAC,OAAuB,aAAvB,OAAO,uBAAP,OAAO,CAAkB,IAAI,0CAAE,WAAW,CAAA,CAAC;AACvD,CAAC;AAFD,sCAEC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExecutorContext } from '@
|
|
2
|
-
import { mocked } from 'jest-mock'
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { mocked } from 'jest-mock';
|
|
3
3
|
import { Schema } from './schema';
|
|
4
4
|
import executor from './apply';
|
|
5
5
|
import { runOcCommand } from '../../utils/oc-utils';
|
|
@@ -10,17 +10,18 @@ const mockedRunOcCommand = mocked(runOcCommand);
|
|
|
10
10
|
const options: Schema = { ocProject: 'test-dev' };
|
|
11
11
|
|
|
12
12
|
describe('Apply Executor', () => {
|
|
13
|
-
|
|
14
13
|
beforeEach(() => {
|
|
15
14
|
mockedRunOcCommand.mockReset();
|
|
16
15
|
});
|
|
17
16
|
|
|
18
17
|
it('can run', async () => {
|
|
19
18
|
mockedRunOcCommand.mockReturnValue({ success: true });
|
|
20
|
-
|
|
21
|
-
const { success } = await executor(options, {
|
|
19
|
+
|
|
20
|
+
const { success } = await executor(options, {
|
|
21
|
+
projectName: 'test',
|
|
22
|
+
} as ExecutorContext);
|
|
22
23
|
expect(success).toBe(true);
|
|
23
|
-
|
|
24
|
+
|
|
24
25
|
expect(mockedRunOcCommand.mock.calls.length).toBe(2);
|
|
25
26
|
expect(mockedRunOcCommand.mock.calls[0][0]).toBe('process');
|
|
26
27
|
expect(mockedRunOcCommand.mock.calls[1][0]).toBe('apply');
|
|
@@ -28,24 +29,23 @@ describe('Apply Executor', () => {
|
|
|
28
29
|
|
|
29
30
|
it('can run for multiple environments', async () => {
|
|
30
31
|
mockedRunOcCommand.mockReturnValue({ success: true });
|
|
31
|
-
|
|
32
|
+
|
|
32
33
|
const { success } = await executor(
|
|
33
|
-
{...options, ocProject: ['test-dev', 'test-qa'] },
|
|
34
|
-
{projectName: 'test'} as ExecutorContext
|
|
34
|
+
{ ...options, ocProject: ['test-dev', 'test-qa'] },
|
|
35
|
+
{ projectName: 'test' } as ExecutorContext
|
|
35
36
|
);
|
|
36
|
-
|
|
37
|
+
|
|
37
38
|
expect(success).toBe(true);
|
|
38
39
|
expect(mockedRunOcCommand.mock.calls.length).toBe(4);
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
it('can return unsuccessful result', async () => {
|
|
42
43
|
mockedRunOcCommand.mockReturnValue({ success: false });
|
|
43
|
-
|
|
44
|
-
const { success } = await executor(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
|
|
45
|
+
const { success } = await executor(options, {
|
|
46
|
+
projectName: 'test',
|
|
47
|
+
} as ExecutorContext);
|
|
48
|
+
|
|
49
49
|
expect(success).toBe(false);
|
|
50
50
|
expect(mockedRunOcCommand.mock.calls.length).toBe(1);
|
|
51
51
|
});
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"version": 2,
|
|
3
3
|
"outputCapture": "direct-nodejs",
|
|
4
4
|
"$schema": "http://json-schema.org/schema",
|
|
5
|
-
"cli": "nx",
|
|
6
5
|
"title": "Apply executor",
|
|
7
6
|
"description": "",
|
|
8
7
|
"type": "object",
|
|
@@ -36,5 +35,7 @@
|
|
|
36
35
|
]
|
|
37
36
|
}
|
|
38
37
|
},
|
|
39
|
-
"required": [
|
|
38
|
+
"required": [
|
|
39
|
+
"ocProject"
|
|
40
|
+
]
|
|
40
41
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Tree } from '@
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
2
|
export default function (host: Tree): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-infra.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/apply-infra/apply-infra.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"apply-infra.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/apply-infra/apply-infra.ts"],"names":[],"mappings":";;;AACA,mDAAoD;AAEpD,SAAS,gBAAgB,CAAC,IAAU;IAClC,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,uBAAY,EACpE,OAAO,EACP,EAAE,EACF,IAAI,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAC9C,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,EAAE,CAAC,CAAC;IAErC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,uBAAY,EAC1D,OAAO,EACP,EAAE,EACF,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CACzC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,EAAE,CAAC,CAAC;IAEhC,IAAI,CAAC,eAAe,IAAI,CAAC,UAAU,EAAE;QACnC,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;KACjE;AACH,CAAC;AAED,mBAA+B,IAAU;;QACvC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAY,EAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,OAAO,EAAE;YACX,gBAAgB,CAAC,IAAI,CAAC,CAAC;SACxB;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;SACtE;IACH,CAAC;CAAA;AAPD,4BAOC"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { createTree } from '@
|
|
2
|
-
import { mocked } from 'jest-mock'
|
|
1
|
+
import { createTree } from '@nx/devkit/testing';
|
|
2
|
+
import { mocked } from 'jest-mock';
|
|
3
3
|
import generator from './apply-infra';
|
|
4
4
|
import { runOcCommand } from '../../utils/oc-utils';
|
|
5
|
-
import { writeJson } from '@
|
|
5
|
+
import { writeJson } from '@nx/devkit';
|
|
6
6
|
|
|
7
7
|
jest.mock('../../utils/oc-utils');
|
|
8
8
|
const mockedRunOcCommand = mocked(runOcCommand);
|
|
9
9
|
|
|
10
10
|
describe('Apply Infra Generator', () => {
|
|
11
|
-
|
|
12
11
|
beforeEach(() => {
|
|
13
12
|
mockedRunOcCommand.mockReset();
|
|
14
13
|
});
|
|
15
14
|
|
|
16
|
-
it
|
|
15
|
+
it('can run', async () => {
|
|
17
16
|
const host = createTree();
|
|
18
17
|
writeJson(host, '.openshift/environment.infra.yml', {});
|
|
19
18
|
writeJson(host, '.openshift/environment.env.yml', {});
|
|
20
19
|
|
|
21
|
-
mockedRunOcCommand.mockReturnValue({success: true });
|
|
20
|
+
mockedRunOcCommand.mockReturnValue({ success: true });
|
|
22
21
|
|
|
23
22
|
await generator(host);
|
|
24
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const yaml = require("yaml");
|
|
7
7
|
const pipeline_envs_1 = require("../../pipeline-envs");
|
|
@@ -22,17 +22,17 @@ function normalizeOptions(host, options) {
|
|
|
22
22
|
let appType = options.appType;
|
|
23
23
|
if (!appType) {
|
|
24
24
|
switch (config.targets.build.executor) {
|
|
25
|
-
case '@
|
|
25
|
+
case '@nx/web:webpack':
|
|
26
26
|
case '@angular-devkit/build-angular:browser':
|
|
27
27
|
appType = 'frontend';
|
|
28
28
|
break;
|
|
29
|
-
case '@
|
|
29
|
+
case '@nx/node:build':
|
|
30
30
|
appType = 'node';
|
|
31
31
|
break;
|
|
32
32
|
case '@nx-dotnet/core:build':
|
|
33
33
|
appType = 'dotnet';
|
|
34
34
|
break;
|
|
35
|
-
case '@
|
|
35
|
+
case '@nx/webpack:webpack': {
|
|
36
36
|
// More recent version of NX switched to use a generic webpack executor for builds.
|
|
37
37
|
appType =
|
|
38
38
|
config.targets.build.options.target === 'node' ? 'node' : 'frontend';
|
|
@@ -60,7 +60,7 @@ function default_1(host, options) {
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
if (!host.exists(infraManifestFile)) {
|
|
63
|
-
console.log(`Cannot generate deployment; run 'nx g @abgov/nx-oc:
|
|
63
|
+
console.log(`Cannot generate deployment; run 'nx g @abgov/nx-oc:pipeline' first.`);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
const normalizedOptions = yield normalizeOptions(host, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/deployment/deployment.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/deployment/deployment.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AACpB,6BAA6B;AAC7B,6BAA6B;AAC7B,uDAA2D;AAC3D,qDAAwD;AAExD,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,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EAAE;gBACZ,QAAQ,EAAE,oBAAoB;gBAC9B,OAAO,EAAE;oBACP,SAAS,EAAE,iBAAiB,CAAC,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;AArCD,4BAqCC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
readProjectConfiguration,
|
|
4
|
-
} from '@nrwl/devkit';
|
|
5
|
-
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
|
|
1
|
+
import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
6
3
|
|
|
7
4
|
import * as utils from '../../adsp';
|
|
8
5
|
import { environments } from '../../adsp';
|
|
@@ -33,7 +30,7 @@ describe('Deployment Generator', () => {
|
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
it('can run', async () => {
|
|
36
|
-
const host =
|
|
33
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
37
34
|
await pipeline(host, {
|
|
38
35
|
pipeline: 'test',
|
|
39
36
|
type: 'jenkins',
|
|
@@ -46,7 +43,7 @@ describe('Deployment Generator', () => {
|
|
|
46
43
|
projectType: 'application',
|
|
47
44
|
targets: {
|
|
48
45
|
build: {
|
|
49
|
-
executor: '@
|
|
46
|
+
executor: '@nx/web:webpack',
|
|
50
47
|
},
|
|
51
48
|
},
|
|
52
49
|
});
|
|
@@ -64,7 +61,7 @@ describe('Deployment Generator', () => {
|
|
|
64
61
|
});
|
|
65
62
|
|
|
66
63
|
it('can generate deployment for react', async () => {
|
|
67
|
-
const host =
|
|
64
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
68
65
|
await pipeline(host, {
|
|
69
66
|
pipeline: 'test',
|
|
70
67
|
type: 'jenkins',
|
|
@@ -77,7 +74,7 @@ describe('Deployment Generator', () => {
|
|
|
77
74
|
projectType: 'application',
|
|
78
75
|
targets: {
|
|
79
76
|
build: {
|
|
80
|
-
executor: '@
|
|
77
|
+
executor: '@nx/webpack:webpack',
|
|
81
78
|
options: {
|
|
82
79
|
compiler: 'babel',
|
|
83
80
|
},
|
|
@@ -94,7 +91,7 @@ describe('Deployment Generator', () => {
|
|
|
94
91
|
});
|
|
95
92
|
|
|
96
93
|
it('can generate deployment for angular', async () => {
|
|
97
|
-
const host =
|
|
94
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
98
95
|
await pipeline(host, {
|
|
99
96
|
pipeline: 'test',
|
|
100
97
|
type: 'jenkins',
|
|
@@ -121,7 +118,7 @@ describe('Deployment Generator', () => {
|
|
|
121
118
|
});
|
|
122
119
|
|
|
123
120
|
it('can generate deployment for node', async () => {
|
|
124
|
-
const host =
|
|
121
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
125
122
|
await pipeline(host, {
|
|
126
123
|
pipeline: 'test',
|
|
127
124
|
type: 'jenkins',
|
|
@@ -134,7 +131,7 @@ describe('Deployment Generator', () => {
|
|
|
134
131
|
projectType: 'application',
|
|
135
132
|
targets: {
|
|
136
133
|
build: {
|
|
137
|
-
executor: '@
|
|
134
|
+
executor: '@nx/webpack:webpack',
|
|
138
135
|
options: {
|
|
139
136
|
compiler: 'tsc',
|
|
140
137
|
target: 'node',
|
|
@@ -152,7 +149,7 @@ describe('Deployment Generator', () => {
|
|
|
152
149
|
});
|
|
153
150
|
|
|
154
151
|
it('can generate deployment for dotnet', async () => {
|
|
155
|
-
const host =
|
|
152
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
156
153
|
await pipeline(host, {
|
|
157
154
|
pipeline: 'test',
|
|
158
155
|
type: 'jenkins',
|
|
@@ -179,7 +176,7 @@ describe('Deployment Generator', () => {
|
|
|
179
176
|
});
|
|
180
177
|
|
|
181
178
|
it('can skip unknown project type', async () => {
|
|
182
|
-
const host =
|
|
179
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
183
180
|
await pipeline(host, {
|
|
184
181
|
pipeline: 'test',
|
|
185
182
|
type: 'jenkins',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const pipeline_envs_1 = require("../../pipeline-envs");
|
|
7
7
|
const git_utils_1 = require("../../utils/git-utils");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/pipeline/pipeline.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../../../../packages/nx-oc/src/generators/pipeline/pipeline.ts"],"names":[],"mappings":";;;AAAA,uCAA8D;AAC9D,6BAA6B;AAC7B,uDAA2D;AAC3D,qDAAwD;AACxD,4DAA6D;AAG7D,SAAS,gBAAgB,CAAC,IAAU,EAAE,OAAe;;IACnD,MAAM,aAAa,GAAG,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,CAAC,KAAI,CAAC,OAAO,CAAC,KAAK,C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AAC,SAAS,EAAE,mBAAmB,CAAC,EACzC,qBAAqB,EACrB,eAAe,CAChB,CAAC;KACH;AACH,CAAC;AAED,mBAA+B,IAAU,EAAE,OAAe;;QACxD,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1D,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAClC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,iBAAiB,CAAC,aAAa,EAAE;YACnC,MAAM,IAAA,qBAAmB,EAAC,IAAI,CAAC,CAAC;SACjC;IACH,CAAC;CAAA;AATD,4BASC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
import generator from './pipeline';
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ describe('Pipeline Generator', () => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
it('can run', async () => {
|
|
15
|
-
const host =
|
|
15
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
16
16
|
await generator(host, options);
|
|
17
17
|
expect(host.exists('.openshift/Jenkinsfile')).toBeTruthy();
|
|
18
18
|
expect(host.exists('.openshift/environment.infra.yml')).toBeTruthy();
|
|
@@ -20,7 +20,7 @@ describe('Pipeline Generator', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('can generate multiple envs', async () => {
|
|
23
|
-
const host =
|
|
23
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
24
24
|
await generator(host, { ...options, envs: 'test-dev test-test' });
|
|
25
25
|
expect(host.exists('.openshift/environments.yml')).toBeTruthy();
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ describe('Pipeline Generator', () => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
it('can fail for duplicate env project', async () => {
|
|
33
|
-
const host =
|
|
33
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
34
34
|
await expect(
|
|
35
35
|
generator(host, { ...options, envs: 'test-dev test-dev' })
|
|
36
36
|
).rejects.toThrow('Each environment must be a unique project.');
|
|
@@ -46,7 +46,7 @@ describe('Pipeline Generator', () => {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
it('can run', async () => {
|
|
49
|
-
const host =
|
|
49
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
50
50
|
await generator(host, options);
|
|
51
51
|
expect(host.exists('.github/workflows/pipeline.yml')).toBeTruthy();
|
|
52
52
|
expect(host.exists('.openshift/environment.infra.yml')).toBeTruthy();
|
|
@@ -54,7 +54,7 @@ describe('Pipeline Generator', () => {
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
it('can generate multiple envs', async () => {
|
|
57
|
-
const host =
|
|
57
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
58
58
|
await generator(host, { ...options, envs: 'test-dev test-test' });
|
|
59
59
|
expect(host.exists('.openshift/environments.yml')).toBeTruthy();
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ describe('Pipeline Generator', () => {
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('can fail for duplicate env project', async () => {
|
|
67
|
-
const host =
|
|
67
|
+
const host = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
68
68
|
await expect(
|
|
69
69
|
generator(host, { ...options, envs: 'test-dev test-dev' })
|
|
70
70
|
).rejects.toThrow('Each environment must be a unique project.');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
3
|
"id": "NxOcPipeline",
|
|
5
4
|
"title": "",
|
|
6
5
|
"type": "object",
|
|
@@ -43,5 +42,10 @@
|
|
|
43
42
|
"x-prompt": "Apply the pipeline to OpenShift?"
|
|
44
43
|
}
|
|
45
44
|
},
|
|
46
|
-
"required": [
|
|
45
|
+
"required": [
|
|
46
|
+
"pipeline",
|
|
47
|
+
"infra",
|
|
48
|
+
"type",
|
|
49
|
+
"envs"
|
|
50
|
+
]
|
|
47
51
|
}
|