@adinsure-ops/ops-cli 4.8.3 → 5.0.0-rc4
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/CHANGELOGS.md +52 -36
- package/LICENSE +1 -1
- package/README.md +32 -242
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +1 -1
- package/bin/run.js +8 -0
- package/lib/command.base.d.ts +9 -5
- package/lib/command.base.jira.d.ts +7 -8
- package/lib/command.base.jira.js +26 -24
- package/lib/command.base.js +69 -57
- package/lib/commands/docker/update-image-version.d.ts +6 -9
- package/lib/commands/docker/update-image-version.js +35 -34
- package/lib/commands/doctor.d.ts +15 -5
- package/lib/commands/doctor.js +219 -186
- package/lib/commands/download/client.d.ts +10 -7
- package/lib/commands/download/client.js +60 -52
- package/lib/commands/download/identity-server.d.ts +9 -7
- package/lib/commands/download/identity-server.js +59 -53
- package/lib/commands/download/jmeter.d.ts +5 -5
- package/lib/commands/download/jmeter.js +54 -49
- package/lib/commands/download/keycloak-scim.d.ts +6 -6
- package/lib/commands/download/keycloak-scim.js +56 -51
- package/lib/commands/download/platform.d.ts +9 -7
- package/lib/commands/download/platform.js +59 -53
- package/lib/commands/download/scheduler.d.ts +9 -7
- package/lib/commands/download/scheduler.js +59 -53
- package/lib/commands/download/server.d.ts +9 -7
- package/lib/commands/download/server.js +59 -53
- package/lib/commands/download/signalr.d.ts +9 -7
- package/lib/commands/download/signalr.js +59 -53
- package/lib/commands/download/studio.d.ts +12 -9
- package/lib/commands/download/studio.js +107 -82
- package/lib/commands/gitlab/get-tag-pipeline.d.ts +11 -14
- package/lib/commands/gitlab/get-tag-pipeline.js +95 -92
- package/lib/commands/gitlab/next-nightly-tag.d.ts +10 -12
- package/lib/commands/gitlab/next-nightly-tag.js +96 -98
- package/lib/commands/jira/issue.d.ts +6 -8
- package/lib/commands/jira/issue.js +25 -23
- package/lib/commands/jira/labels.d.ts +9 -12
- package/lib/commands/jira/labels.js +52 -51
- package/lib/commands/log/add.d.ts +6 -8
- package/lib/commands/log/add.js +92 -87
- package/lib/commands/log/generate.d.ts +9 -10
- package/lib/commands/log/generate.js +112 -107
- package/lib/commands/log/validate.d.ts +2 -2
- package/lib/commands/log/validate.js +47 -43
- package/lib/commands/login.d.ts +9 -10
- package/lib/commands/login.js +101 -97
- package/lib/commands/npm/check-publish.d.ts +7 -8
- package/lib/commands/npm/check-publish.js +59 -54
- package/lib/commands/npm/dependency-update.d.ts +14 -12
- package/lib/commands/npm/dependency-update.js +94 -86
- package/lib/commands/npm/publish.d.ts +8 -9
- package/lib/commands/npm/publish.js +154 -140
- package/lib/commands/nuget/dependency-update.d.ts +15 -10
- package/lib/commands/nuget/dependency-update.js +60 -49
- package/lib/commands/sql.d.ts +24 -20
- package/lib/commands/sql.js +245 -226
- package/lib/commands/translate.d.ts +15 -16
- package/lib/commands/translate.js +109 -104
- package/lib/commands/version.d.ts +29 -19
- package/lib/commands/version.js +215 -190
- package/lib/config.js +3 -6
- package/lib/hooks/init/version-override.d.ts +2 -2
- package/lib/hooks/init/version-override.js +15 -13
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -4
- package/lib/lib/command.d.ts +2 -0
- package/lib/lib/command.js +65 -58
- package/lib/lib/gitlab.d.ts +8 -2
- package/lib/lib/gitlab.js +94 -82
- package/lib/lib/npm.d.ts +7 -3
- package/lib/lib/npm.js +72 -60
- package/lib/lib/npmrc.d.ts +5 -0
- package/lib/lib/npmrc.js +20 -13
- package/lib/lib/nuget.d.ts +2 -0
- package/lib/lib/nuget.js +20 -17
- package/lib/security/cache.js +31 -27
- package/lib/security/context.d.ts +2 -1
- package/lib/security/context.js +106 -103
- package/lib/types/changelog.types.js +1 -2
- package/lib/types/npm.types.d.ts +5 -5
- package/lib/types/npm.types.js +1 -2
- package/oclif.manifest.json +1223 -1
- package/package.json +50 -46
- package/bin/run +0 -5
- package/lib/commands/prepare-content.d.ts +0 -29
- package/lib/commands/prepare-content.js +0 -386
|
@@ -1,116 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const command_2 = require("../../lib/command");
|
|
11
|
-
class DownloadStudio extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import CommandBase from '../../command.base.js';
|
|
8
|
+
import ChildProcessCommand from '../../lib/command.js';
|
|
9
|
+
class DownloadStudio extends CommandBase {
|
|
12
10
|
constructor() {
|
|
13
11
|
super(...arguments);
|
|
14
12
|
this.url = 'https://ops.adinsure.com/api/storage/extensions/';
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
|
-
* Get unique
|
|
15
|
+
* Get unique AdInsure Studio vsix zip by specified version
|
|
16
|
+
* @param {string} version The version of AdInsure Studio vsix
|
|
17
|
+
* @returns {Promise<AxiosResponse<any, any>>}
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
downloadFile(version) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
return axios.get(`${this.url}/adinsure-studio-${version}.vsix`, {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: 'Bearer ' + (yield this.security.getToken()),
|
|
25
|
+
'Content-Type': 'application/octet-stream',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
});
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
installExtension(extensionPath) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const cp = new ChildProcessCommand();
|
|
33
|
+
yield cp.runCommand(['code', '--install-extension', extensionPath, '--force']);
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
|
-
|
|
36
|
+
findExtensionIfEnabled(studioVersion, enabled) {
|
|
34
37
|
var _a;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (!enabled) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const cp = new ChildProcessCommand();
|
|
43
|
+
const result = yield cp.runCommand(['code', '--list-extensions', '--show-versions']);
|
|
44
|
+
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.includes(studioVersion);
|
|
45
|
+
});
|
|
41
46
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
run() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const { flags } = yield this.parse(DownloadStudio);
|
|
50
|
+
const basePath = flags.output;
|
|
51
|
+
const filename = `adinsure-studio-${flags.version}.vsix`;
|
|
52
|
+
const studioVersion = `adacta-fintech.adinsure-studio@${flags.version}`;
|
|
53
|
+
const filePath = path.resolve(basePath, filename);
|
|
54
|
+
const skipInstallation = yield this.findExtensionIfEnabled(studioVersion, flags.skip);
|
|
55
|
+
if (skipInstallation) {
|
|
56
|
+
this.log(`The ${studioVersion} already exists. Skipping install.`);
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const alreadyDownloaded = yield fs.pathExists(filePath);
|
|
61
|
+
if (alreadyDownloaded && flags.install) {
|
|
62
|
+
ux.action.start(`Installing already downloaded AdInsure Studio version ${flags.version} from ${filePath}`, undefined, { stdout: true });
|
|
63
|
+
yield this.installExtension(filePath);
|
|
64
|
+
ux.action.stop(`${chalk.green('Done')}`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
ux.action.start(`Downloading AdInsure Studio version ${flags.version} to ${filePath}`, undefined, { stdout: true });
|
|
68
|
+
const file = yield this.downloadFile(flags.version);
|
|
69
|
+
const writeStream = fs.createWriteStream(filePath);
|
|
70
|
+
writeStream.write(file.data, 'binary');
|
|
71
|
+
writeStream.on('finish', () => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
ux.action.stop(`${chalk.green('OK')}`);
|
|
73
|
+
if (flags.install) {
|
|
74
|
+
ux.action.start(`Installing into VSCode`, undefined, { stdout: true });
|
|
75
|
+
yield this.installExtension(filePath);
|
|
76
|
+
ux.action.stop(`${chalk.green('Done')}`);
|
|
77
|
+
if (!flags.keep) {
|
|
78
|
+
ux.action.start(`Removing VSIX file`, undefined, { stdout: true });
|
|
79
|
+
fs.removeSync(filePath);
|
|
80
|
+
}
|
|
81
|
+
ux.action.stop(`${chalk.green('Done')}`);
|
|
82
|
+
this.log(`${chalk.yellow('Use \'CRTL + SHIFT + P\' and select reload windows to apply this studio version.')}`);
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
writeStream.end();
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
switch (error.statusCode) {
|
|
90
|
+
case 404: {
|
|
91
|
+
this.error('Does not exists.', { exit: 1 });
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case 400: {
|
|
95
|
+
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
default: {
|
|
99
|
+
this.error(error.message);
|
|
100
|
+
}
|
|
68
101
|
}
|
|
69
|
-
});
|
|
70
|
-
writeStream.end();
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
switch (err.statusCode) {
|
|
74
|
-
case 404:
|
|
75
|
-
// cli.action.stop(`${chalk.red('Does not exists.')}`);
|
|
76
|
-
this.error('Does not exists.', { exit: 1 });
|
|
77
|
-
break;
|
|
78
|
-
case 400:
|
|
79
|
-
this.error('Try refreshing your login credentials with "ops login".', { exit: 1 });
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
this.error(err.message);
|
|
83
102
|
}
|
|
84
|
-
}
|
|
103
|
+
});
|
|
85
104
|
}
|
|
86
105
|
}
|
|
87
|
-
exports.default = DownloadStudio;
|
|
88
106
|
DownloadStudio.description = 'download AdInsure Studio vsix from azure storage';
|
|
89
107
|
DownloadStudio.usage = 'download:studio <flags>';
|
|
90
108
|
DownloadStudio.examples = [
|
|
91
109
|
`$ ops download:studio -v 15.0.0 -o ~/Downloads`,
|
|
92
110
|
`$ ops download:studio -v 15.0.0 -i`,
|
|
93
|
-
`$ ops download:studio -v 15.0.0 -i -s
|
|
111
|
+
`$ ops download:studio -v 15.0.0 -i -s`,
|
|
112
|
+
`$ ops download:studio -v 15.0.0 -i -k`,
|
|
94
113
|
];
|
|
95
114
|
DownloadStudio.flags = {
|
|
96
|
-
version:
|
|
115
|
+
version: Flags.string({
|
|
97
116
|
char: 'v',
|
|
98
117
|
description: 'version we want to download',
|
|
99
|
-
required: true
|
|
118
|
+
required: true,
|
|
100
119
|
}),
|
|
101
|
-
output:
|
|
120
|
+
output: Flags.string({
|
|
102
121
|
char: 'o',
|
|
103
122
|
description: 'output directory',
|
|
104
|
-
default: './'
|
|
123
|
+
default: './',
|
|
105
124
|
}),
|
|
106
|
-
install:
|
|
125
|
+
install: Flags.boolean({
|
|
107
126
|
char: 'i',
|
|
108
127
|
description: 'install plugin to vscode. save to temp folder and remove vsix after.',
|
|
109
|
-
default: false
|
|
128
|
+
default: false,
|
|
110
129
|
}),
|
|
111
|
-
skip:
|
|
130
|
+
skip: Flags.boolean({
|
|
112
131
|
char: 's',
|
|
113
132
|
description: 'only with install. If passed, and desired version is installed it will skip it.',
|
|
114
|
-
dependsOn: ['install']
|
|
133
|
+
dependsOn: ['install'],
|
|
134
|
+
}),
|
|
135
|
+
keep: Flags.boolean({
|
|
136
|
+
char: 'k',
|
|
137
|
+
description: 'only with install. If passed, it will not remove the vsix file.',
|
|
138
|
+
dependsOn: ['install'],
|
|
115
139
|
}),
|
|
116
140
|
};
|
|
141
|
+
export default DownloadStudio;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export default class GitlabGetTagPipeline extends CommandBase {
|
|
1
|
+
import CommandBase from '../../command.base.js';
|
|
2
|
+
import GitLab from '../../lib/gitlab.js';
|
|
3
|
+
export default class GitlabGetTagPipeline extends CommandBase<typeof GitlabGetTagPipeline> {
|
|
5
4
|
static description: string;
|
|
6
5
|
static usage: string;
|
|
7
6
|
static examples: string[];
|
|
8
7
|
static args: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
required: boolean;
|
|
12
|
-
}[];
|
|
8
|
+
tag: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
13
10
|
static flags: {
|
|
14
|
-
pat:
|
|
15
|
-
host:
|
|
16
|
-
project:
|
|
17
|
-
wait: import("@oclif/
|
|
18
|
-
timeout:
|
|
19
|
-
delay:
|
|
11
|
+
pat: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
host: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
project: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
|
+
timeout: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
delay: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
20
17
|
};
|
|
21
18
|
waitPipelineStatus(gitlab: GitLab, tag: string, timeout: number, delay: number): Promise<string>;
|
|
22
19
|
run(): Promise<void>;
|
|
@@ -1,143 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
let status = await gitlab.getTagPipelineStatus(tag);
|
|
13
|
-
switch (status) {
|
|
14
|
-
case 'unknown': {
|
|
15
|
-
reject(new Error(`Pipeline or tag does not exist!`));
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
case 'failed': {
|
|
19
|
-
reject(new Error(`Pipeline failed!`));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
case 'canceled': {
|
|
23
|
-
reject(new Error(`Pipeline canceled!`));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
case 'skipped': {
|
|
27
|
-
reject(new Error(`Pipeline skipped!`));
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
case 'success': {
|
|
31
|
-
resolve(`Pipeline passed successfully!`);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
reject(new Error(err.message));
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const interval = setInterval(async () => {
|
|
41
|
-
if (time >= timeout) {
|
|
42
|
-
reject(new Error('Timeout waiting pipeline'));
|
|
43
|
-
clearInterval(interval);
|
|
44
|
-
}
|
|
45
|
-
time += delay;
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import CommandBase from '../../command.base.js';
|
|
5
|
+
import GitLab from '../../lib/gitlab.js';
|
|
6
|
+
class GitlabGetTagPipeline extends CommandBase {
|
|
7
|
+
waitPipelineStatus(gitlab, tag, timeout, delay) {
|
|
8
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
let time = 0;
|
|
46
11
|
try {
|
|
47
|
-
|
|
12
|
+
const status = yield gitlab.getTagPipelineStatus(tag);
|
|
48
13
|
switch (status) {
|
|
49
14
|
case 'unknown': {
|
|
50
15
|
reject(new Error(`Pipeline or tag does not exist!`));
|
|
51
|
-
|
|
52
|
-
break;
|
|
16
|
+
return;
|
|
53
17
|
}
|
|
54
18
|
case 'failed': {
|
|
55
19
|
reject(new Error(`Pipeline failed!`));
|
|
56
|
-
|
|
57
|
-
break;
|
|
20
|
+
return;
|
|
58
21
|
}
|
|
59
22
|
case 'canceled': {
|
|
60
23
|
reject(new Error(`Pipeline canceled!`));
|
|
61
|
-
|
|
62
|
-
break;
|
|
24
|
+
return;
|
|
63
25
|
}
|
|
64
26
|
case 'skipped': {
|
|
65
27
|
reject(new Error(`Pipeline skipped!`));
|
|
66
|
-
|
|
67
|
-
break;
|
|
28
|
+
return;
|
|
68
29
|
}
|
|
69
30
|
case 'success': {
|
|
70
31
|
resolve(`Pipeline passed successfully!`);
|
|
71
|
-
|
|
32
|
+
return;
|
|
72
33
|
}
|
|
73
34
|
}
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
36
|
}
|
|
75
|
-
catch (
|
|
76
|
-
reject(new Error(
|
|
77
|
-
|
|
37
|
+
catch (error) {
|
|
38
|
+
reject(new Error(error.message));
|
|
39
|
+
return;
|
|
78
40
|
}
|
|
79
|
-
|
|
41
|
+
const interval = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (time >= timeout) {
|
|
43
|
+
reject(new Error('Timeout waiting pipeline'));
|
|
44
|
+
clearInterval(interval);
|
|
45
|
+
}
|
|
46
|
+
time += delay;
|
|
47
|
+
try {
|
|
48
|
+
const status = yield gitlab.getTagPipelineStatus(tag);
|
|
49
|
+
switch (status) {
|
|
50
|
+
case 'unknown': {
|
|
51
|
+
reject(new Error(`Pipeline or tag does not exist!`));
|
|
52
|
+
clearInterval(interval);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case 'failed': {
|
|
56
|
+
reject(new Error(`Pipeline failed!`));
|
|
57
|
+
clearInterval(interval);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
case 'canceled': {
|
|
61
|
+
reject(new Error(`Pipeline canceled!`));
|
|
62
|
+
clearInterval(interval);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case 'skipped': {
|
|
66
|
+
reject(new Error(`Pipeline skipped!`));
|
|
67
|
+
clearInterval(interval);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case 'success': {
|
|
71
|
+
resolve(`Pipeline passed successfully!`);
|
|
72
|
+
clearInterval(interval);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
reject(new Error(error.message));
|
|
79
|
+
clearInterval(interval);
|
|
80
|
+
}
|
|
81
|
+
}), delay * 1000);
|
|
82
|
+
}));
|
|
80
83
|
});
|
|
81
84
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
run() {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
const { args, flags } = yield this.parse(GitlabGetTagPipeline);
|
|
88
|
+
const gitlab = new GitLab(flags.host, flags.project, flags.pat);
|
|
89
|
+
if (!flags.wait) {
|
|
90
|
+
const status = yield gitlab.getTagPipelineStatus(args.tag);
|
|
91
|
+
return this.log(`${chalk.green(status)}`);
|
|
92
|
+
}
|
|
90
93
|
try {
|
|
91
|
-
|
|
94
|
+
const status = yield this.waitPipelineStatus(gitlab, args.tag, Number.parseInt(flags.timeout, 10), Number.parseInt(flags.delay, 10));
|
|
92
95
|
this.log(status);
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
97
|
}
|
|
94
|
-
catch (
|
|
95
|
-
this.error(
|
|
98
|
+
catch (error) {
|
|
99
|
+
this.error(error.message);
|
|
96
100
|
}
|
|
97
|
-
}
|
|
101
|
+
});
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
|
-
exports.default = GitlabGetTagPipeline;
|
|
101
104
|
GitlabGetTagPipeline.description = 'get pipeline status for tag';
|
|
102
105
|
GitlabGetTagPipeline.usage = 'gitlab:get-tag-pipeline <tag>';
|
|
103
106
|
GitlabGetTagPipeline.examples = [
|
|
104
|
-
`$ ops gitlab:get-tag-pipeline 17.0.0
|
|
107
|
+
`$ ops gitlab:get-tag-pipeline 17.0.0`,
|
|
105
108
|
];
|
|
106
|
-
GitlabGetTagPipeline.args =
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
+
GitlabGetTagPipeline.args = {
|
|
110
|
+
tag: Args.string({
|
|
111
|
+
required: true,
|
|
109
112
|
description: 'Tag',
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
];
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
113
115
|
GitlabGetTagPipeline.flags = {
|
|
114
|
-
pat:
|
|
116
|
+
pat: Flags.string({
|
|
115
117
|
required: true,
|
|
116
118
|
env: 'PRIVATE_TOKEN',
|
|
117
|
-
description: 'Token from user that has permissions to list and create tags'
|
|
119
|
+
description: 'Token from user that has permissions to list and create tags',
|
|
118
120
|
}),
|
|
119
|
-
host:
|
|
121
|
+
host: Flags.string({
|
|
120
122
|
required: true,
|
|
121
123
|
default: 'https://git.adacta-fintech.com',
|
|
122
124
|
env: 'CI_SERVER_URL',
|
|
123
|
-
description: 'Server hostname'
|
|
125
|
+
description: 'Server hostname',
|
|
124
126
|
}),
|
|
125
|
-
project:
|
|
127
|
+
project: Flags.string({
|
|
126
128
|
required: true,
|
|
127
129
|
default: '413',
|
|
128
130
|
env: 'CI_PROJECT_ID',
|
|
129
|
-
description: 'Project ID'
|
|
131
|
+
description: 'Project ID',
|
|
130
132
|
}),
|
|
131
|
-
wait:
|
|
133
|
+
wait: Flags.boolean({
|
|
132
134
|
description: 'Wait for pipeline to finish',
|
|
133
|
-
default: false
|
|
135
|
+
default: false,
|
|
134
136
|
}),
|
|
135
|
-
timeout:
|
|
137
|
+
timeout: Flags.string({
|
|
136
138
|
default: '120',
|
|
137
|
-
description: 'Timeout for wait command in seconds (defaults to 120 seconds)'
|
|
139
|
+
description: 'Timeout for wait command in seconds (defaults to 120 seconds)',
|
|
138
140
|
}),
|
|
139
|
-
delay:
|
|
141
|
+
delay: Flags.string({
|
|
140
142
|
default: '5',
|
|
141
|
-
description: 'Delay of check in seconds (defaults to 5 seconds)'
|
|
142
|
-
})
|
|
143
|
+
description: 'Delay of check in seconds (defaults to 5 seconds)',
|
|
144
|
+
}),
|
|
143
145
|
};
|
|
146
|
+
export default GitlabGetTagPipeline;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class GitlabNextNightlyTag extends CommandBase {
|
|
1
|
+
import CommandBase from '../../command.base.js';
|
|
2
|
+
export default class GitlabNextNightlyTag extends CommandBase<typeof GitlabNextNightlyTag> {
|
|
4
3
|
static description: string;
|
|
5
4
|
static usage: string;
|
|
6
5
|
static examples: string[];
|
|
7
6
|
static args: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}[];
|
|
7
|
+
version: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
11
9
|
static flags: {
|
|
12
|
-
pat:
|
|
13
|
-
host:
|
|
14
|
-
project:
|
|
15
|
-
reference:
|
|
16
|
-
outputVersionOnly: import("@oclif/
|
|
17
|
-
dryRun: import("@oclif/
|
|
10
|
+
pat: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
host: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
project: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
reference: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
outputVersionOnly: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
|
+
dryRun: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
18
16
|
};
|
|
19
17
|
run(): Promise<undefined>;
|
|
20
18
|
}
|