|
1 |
| -import { |
2 |
| - Client, |
3 |
| - ClientConfiguration, |
4 |
| - CreateReleaseCommandV1, |
5 |
| - Logger, |
6 |
| - Project, |
7 |
| - ProjectRepository, |
8 |
| - Space, |
9 |
| - SpaceRepository |
10 |
| -} from "@octopusdeploy/api-client"; |
| 1 | +import { Client, CreateReleaseCommandV1, Logger, Project, ProjectRepository, Space, SpaceRepository } from "@octopusdeploy/api-client"; |
11 | 2 | import { OctoServerConnectionDetails } from "../../Utils/connection";
|
12 | 3 | import { createReleaseFromInputs } from "./createRelease";
|
13 | 4 | import { createCommandFromInputs } from "./inputCommandBuilder";
|
14 | 5 | import os from "os";
|
15 | 6 | import { TaskWrapper } from "tasks/Utils/taskInput";
|
16 |
| -import { getUserAgentApp } from "../../Utils/pluginInformation"; |
17 | 7 | import path from "path";
|
18 | 8 | import { getVstsEnvironmentVariables } from "../../../tasksLegacy/Utils/environment";
|
19 | 9 | import { v4 as uuidv4 } from "uuid";
|
20 | 10 | import * as tasks from "azure-pipelines-task-lib";
|
| 11 | +import { getClient } from "../../Utils/client"; |
21 | 12 |
|
22 | 13 | export class Release {
|
23 | 14 | constructor(readonly connection: OctoServerConnectionDetails, readonly task: TaskWrapper, readonly logger: Logger) {}
|
24 | 15 |
|
25 | 16 | public async run() {
|
26 | 17 | try {
|
27 | 18 | const command = createCommandFromInputs(this.logger, this.task);
|
28 |
| - |
29 |
| - const config: ClientConfiguration = { |
30 |
| - userAgentApp: getUserAgentApp("release", "create", 6), |
31 |
| - instanceURL: this.connection.url, |
32 |
| - apiKey: this.connection.apiKey, |
33 |
| - logging: this.logger, |
34 |
| - }; |
35 |
| - const client = await Client.create(config); |
36 |
| - |
| 19 | + const client = await getClient(this.connection, this.logger, "release", "create", 6); |
37 | 20 | const version = await createReleaseFromInputs(client, command, this.task, this.logger);
|
38 | 21 |
|
39 | 22 | await this.tryCreateSummary(client, command, version);
|
|
0 commit comments