nitor 1.7.0 → 1.7.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/CHANGELOG.md +6 -0
- package/README.md +1 -0
- package/package.json +2 -2
- package/services/autocomplete.js +4 -0
- package/services/merge.js +2 -1
- package/services/process-commands.js +8 -6
- package/services/utils.js +33 -13
package/CHANGELOG.md
CHANGED
|
@@ -83,3 +83,9 @@ For a complete list of changes and discussion, see [Issue #1](https://github.com
|
|
|
83
83
|
- Removed unused `commander` and `compression` dependencies.
|
|
84
84
|
- Declared `engines.node >= 18` to reflect the actual minimum supported by
|
|
85
85
|
runtime dependencies (notably `@google/generative-ai`).
|
|
86
|
+
|
|
87
|
+
## [1.7.2] - 2026-05-20
|
|
88
|
+
|
|
89
|
+
### New Features
|
|
90
|
+
|
|
91
|
+
- Added `skip` option to build and build-deploy commands.
|
package/README.md
CHANGED
|
@@ -368,6 +368,7 @@ The backup service is designed to work on Windows, macOS, and Linux:
|
|
|
368
368
|
- `-project` or `-p` : Project name (`portal`, `gateway`, `phr`)
|
|
369
369
|
- `-components` or `-c` : Components (`client`, `backend`, etc.)
|
|
370
370
|
- `-instance` or `-i` : Instance/environment (`dev`, `qa`, `pilot`)
|
|
371
|
+
- `-skip` or `-sk` : Skip steps (`owasp`, `sonar`)
|
|
371
372
|
- `-branch` or `-b` : Git branch (optional)
|
|
372
373
|
- `-task` or `-t` : Task number
|
|
373
374
|
- `-type` or `-ty` : Type (`feat`, `fix`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitor",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "A comprehensive CLI toolkit for automating GitLab operations, AI-powered code review, build/deploy automation, MongoDB backup/restore, and developer productivity tools",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Nithin V <mails2nithin@gmail.com>",
|
|
@@ -104,4 +104,4 @@
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
"type": "commonjs"
|
|
107
|
-
}
|
|
107
|
+
}
|
package/services/autocomplete.js
CHANGED
|
@@ -35,6 +35,8 @@ const setupAutocomplete = () => {
|
|
|
35
35
|
'-c': ['client', 'administration', 'provider', 'rest-api'],
|
|
36
36
|
'-instance': ['dev', 'qa', 'pilot'],
|
|
37
37
|
'-i': ['dev', 'qa', 'pilot'],
|
|
38
|
+
'-skip': ['owasp', 'sonar'],
|
|
39
|
+
'-sk': ['owasp', 'sonar'],
|
|
38
40
|
'-help': [],
|
|
39
41
|
'--h': [],
|
|
40
42
|
},
|
|
@@ -99,6 +101,8 @@ const setupAutocomplete = () => {
|
|
|
99
101
|
'-c': ['client', 'administration', 'provider', 'rest-api'],
|
|
100
102
|
'-instance': ['dev', 'qa', 'pilot'],
|
|
101
103
|
'-i': ['dev', 'qa', 'pilot'],
|
|
104
|
+
'-skip': ['owasp', 'sonar'],
|
|
105
|
+
'-sk': ['owasp', 'sonar'],
|
|
102
106
|
'-help': [],
|
|
103
107
|
'--h': [],
|
|
104
108
|
},
|
package/services/merge.js
CHANGED
|
@@ -16,8 +16,9 @@ const merge = async (values) => {
|
|
|
16
16
|
|
|
17
17
|
const execOptions = { stdio: 'inherit', shell: isWindows ? 'cmd.exe' : '/bin/sh' };
|
|
18
18
|
|
|
19
|
-
execSync('
|
|
19
|
+
execSync('nitor cleanup', execOptions);
|
|
20
20
|
execSync('git pull', execOptions);
|
|
21
|
+
execSync('git fetch', execOptions);
|
|
21
22
|
execSync(`git checkout ${source}`, execOptions);
|
|
22
23
|
execSync('git pull', execOptions);
|
|
23
24
|
|
|
@@ -49,15 +49,16 @@ const processArgs = async (type, value) => {
|
|
|
49
49
|
switch (type) {
|
|
50
50
|
case ACTIONS.BUILD: {
|
|
51
51
|
if (value === '-help' || value === '--h') {
|
|
52
|
-
console.log(`usage: \tnu build [-project <project name>] [-components <component name>] [-instance <instance name>]
|
|
53
|
-
\tnu build [-p <project name>] [-c <component name>] [-i <instance name>]
|
|
52
|
+
console.log(`usage: \tnu build [-project <project name>] [-components <component name>] [-instance <instance name>] [-skip <owasp|sonar>]
|
|
53
|
+
\tnu build [-p <project name>] [-c <component name>] [-i <instance name>] [-sk <owasp|sonar>]
|
|
54
54
|
|
|
55
55
|
Build specified components
|
|
56
56
|
|
|
57
57
|
Options:
|
|
58
58
|
-p, --project <name> project name | portal, gateway, phr, configService, healthRecords, centralAuth, mpi, phrAdminBackend, phrAdminClient, terminologyService
|
|
59
59
|
-c, --components <name> component name | client, administration, provider, rest-api
|
|
60
|
-
-i, --instance <name> instance name | dev, qa, pilot
|
|
60
|
+
-i, --instance <name> instance name | dev, qa, pilot
|
|
61
|
+
-sk, --skip <steps> skip steps | owasp, sonar`);
|
|
61
62
|
|
|
62
63
|
break;
|
|
63
64
|
}
|
|
@@ -69,15 +70,16 @@ Options:
|
|
|
69
70
|
|
|
70
71
|
case ACTIONS.BUILD_DEPLOY: {
|
|
71
72
|
if (value === '-help' || value === '--h') {
|
|
72
|
-
console.log(`usage: \tnu build-deploy [-project <project name>] [-components <component name>] [-instance <instance name>]
|
|
73
|
-
\tnu build-deploy [-p <project name>] [-c <component name>] [-i <instance name>]
|
|
73
|
+
console.log(`usage: \tnu build-deploy [-project <project name>] [-components <component name>] [-instance <instance name>] [-skip <owasp|sonar>]
|
|
74
|
+
\tnu build-deploy [-p <project name>] [-c <component name>] [-i <instance name>] [-sk <owasp|sonar>]
|
|
74
75
|
|
|
75
76
|
Build and deploy specified components
|
|
76
77
|
|
|
77
78
|
Options:
|
|
78
79
|
-p, --project <name> project name | portal, gateway, phr, configService, healthRecords, centralAuth, mpi, phrAdminBackend, phrAdminClient, terminologyService
|
|
79
80
|
-c, --components <name> component name | client, administration, provider, rest-api
|
|
80
|
-
-i, --instance <name> instance name | dev, qa, pilot
|
|
81
|
+
-i, --instance <name> instance name | dev, qa, pilot
|
|
82
|
+
-sk, --skip <steps> skip steps | owasp, sonar`);
|
|
81
83
|
|
|
82
84
|
break;
|
|
83
85
|
}
|
package/services/utils.js
CHANGED
|
@@ -67,6 +67,8 @@ const keyMap = {
|
|
|
67
67
|
st: 'state',
|
|
68
68
|
search: 'search',
|
|
69
69
|
q: 'search',
|
|
70
|
+
skip: 'skip',
|
|
71
|
+
sk: 'skip',
|
|
70
72
|
};
|
|
71
73
|
const projectMap = {
|
|
72
74
|
portal: 'medica-portal',
|
|
@@ -184,11 +186,27 @@ const generateBuildConfigs = (values = {}) => {
|
|
|
184
186
|
|
|
185
187
|
const variables_attributes = [];
|
|
186
188
|
|
|
189
|
+
if (values.skip?.includes('owasp')) {
|
|
190
|
+
variables_attributes.push({
|
|
191
|
+
variable_type: 'env_var',
|
|
192
|
+
key: 'SKIP_OWASP',
|
|
193
|
+
value: 'true',
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (values.skip?.includes('sonar')) {
|
|
198
|
+
variables_attributes.push({
|
|
199
|
+
variable_type: 'env_var',
|
|
200
|
+
key: 'SKIP_SONAR',
|
|
201
|
+
value: 'true',
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
187
205
|
if (values.instance) {
|
|
188
206
|
variables_attributes.push({
|
|
189
207
|
variable_type: 'env_var',
|
|
190
208
|
key: 'TAG',
|
|
191
|
-
|
|
209
|
+
value: values.instance,
|
|
192
210
|
});
|
|
193
211
|
|
|
194
212
|
if (!values.branch) {
|
|
@@ -208,7 +226,7 @@ const generateBuildConfigs = (values = {}) => {
|
|
|
208
226
|
// Client config
|
|
209
227
|
if (values.components.includes('client')) {
|
|
210
228
|
configs.client.config = makeConfig(`${gitlabConfig.url}/cxd/${project}-client/-/pipelines`, {
|
|
211
|
-
...dataBase,
|
|
229
|
+
pipeline: { ...dataBase },
|
|
212
230
|
});
|
|
213
231
|
}
|
|
214
232
|
|
|
@@ -227,16 +245,16 @@ const generateBuildConfigs = (values = {}) => {
|
|
|
227
245
|
{
|
|
228
246
|
variable_type: 'env_var',
|
|
229
247
|
key: 'APPS',
|
|
230
|
-
|
|
248
|
+
value: apps.join(' '),
|
|
231
249
|
},
|
|
232
250
|
]
|
|
233
251
|
: []),
|
|
234
252
|
],
|
|
235
253
|
};
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
backendData,
|
|
239
|
-
);
|
|
254
|
+
|
|
255
|
+
configs.backend.config = makeConfig(`${gitlabConfig.url}/cxd/${project}-backend/-/pipelines`, {
|
|
256
|
+
pipeline: backendData,
|
|
257
|
+
});
|
|
240
258
|
}
|
|
241
259
|
|
|
242
260
|
return { configs: removeEmpty(configs, true) };
|
|
@@ -275,7 +293,7 @@ const generateDeployConfigs = (values = {}) => {
|
|
|
275
293
|
variables_attributes.push({
|
|
276
294
|
variable_type: 'env_var',
|
|
277
295
|
key: 'IMAGE_TAG',
|
|
278
|
-
|
|
296
|
+
value: values.instance,
|
|
279
297
|
});
|
|
280
298
|
}
|
|
281
299
|
|
|
@@ -283,7 +301,7 @@ const generateDeployConfigs = (values = {}) => {
|
|
|
283
301
|
variables_attributes.push({
|
|
284
302
|
variable_type: 'env_var',
|
|
285
303
|
key: 'INSTANCE',
|
|
286
|
-
|
|
304
|
+
value: imageTagMap[values.instance] || values.instance,
|
|
287
305
|
});
|
|
288
306
|
}
|
|
289
307
|
|
|
@@ -291,20 +309,22 @@ const generateDeployConfigs = (values = {}) => {
|
|
|
291
309
|
variables_attributes.push({
|
|
292
310
|
variable_type: 'env_var',
|
|
293
311
|
key: 'COMPONENT',
|
|
294
|
-
|
|
312
|
+
value: 'client-pilot',
|
|
295
313
|
});
|
|
296
314
|
} else {
|
|
297
315
|
variables_attributes.push({
|
|
298
316
|
variable_type: 'env_var',
|
|
299
317
|
key: 'COMPONENT',
|
|
300
|
-
|
|
318
|
+
value: values.components || 'client',
|
|
301
319
|
});
|
|
302
320
|
}
|
|
303
321
|
|
|
304
322
|
const project = projectMap[values.project] || projectMap.portal;
|
|
305
323
|
const configs = makeConfig(`${gitlabConfig.url}/cxd/${project}-deployment/-/pipelines`, {
|
|
306
|
-
|
|
307
|
-
|
|
324
|
+
pipeline: {
|
|
325
|
+
ref: `refs/heads/${deploymentBranchMap[values.instance]}`,
|
|
326
|
+
variables_attributes,
|
|
327
|
+
},
|
|
308
328
|
});
|
|
309
329
|
|
|
310
330
|
return { configs: removeEmpty(configs, true) };
|