-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcli.ts
More file actions
29 lines (27 loc) · 1.02 KB
/
cli.ts
File metadata and controls
29 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* Copyright (c) Trainline Limited, 2020. All rights reserved.
* See LICENSE.md in the project root for license information.
*/
import TeamCityDataSource, { TeamCityDataSourceConfiguration } from '.';
import { CliProgram } from '../../CliProgram';
const createCli: CliProgram = (program, execAction) => {
program
.command('teamcity <baseSha> <headSha>')
.requiredOption('-s, --server-url <serverUrl>', 'server url')
.requiredOption('-u, --username <username>', 'username to log into TeamCity')
.requiredOption('-p, --password <password>', 'password to log into TeamCity')
.requiredOption(
'-b, --build-type <buildType>',
'<your build pipeline> > Edit Configuration > General Settings > Build configuration ID'
)
.action(
async (baseSha: string, headSha: string, cmdObject: TeamCityDataSourceConfiguration) => {
await execAction({
dataSource: new TeamCityDataSource(cmdObject),
baseSha,
headSha,
});
}
);
};
export default createCli;