azure-pipelines-task-lib 3.3.1 → 4.0.0-preview
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/LICENSE +22 -22
- package/README.md +74 -74
- package/Strings/resources.resjson/de-DE/resources.resjson +34 -34
- package/Strings/resources.resjson/es-ES/resources.resjson +34 -34
- package/Strings/resources.resjson/fr-FR/resources.resjson +34 -34
- package/Strings/resources.resjson/ja-JP/resources.resjson +34 -34
- package/ThirdPartyNotice.txt +1114 -1114
- package/internal.d.ts +130 -130
- package/internal.js +885 -885
- package/lib.json +37 -37
- package/mock-answer.d.ts +55 -55
- package/mock-answer.js +41 -41
- package/mock-run.d.ts +44 -44
- package/mock-run.js +92 -92
- package/mock-task.d.ts +111 -111
- package/mock-task.js +447 -447
- package/mock-test.d.ts +28 -28
- package/mock-test.js +298 -298
- package/mock-toolrunner.d.ts +41 -41
- package/mock-toolrunner.js +268 -268
- package/package.json +49 -49
- package/task.d.ts +718 -718
- package/task.js +2003 -2003
- package/taskcommand.d.ts +10 -10
- package/taskcommand.js +103 -103
- package/toolrunner.d.ts +159 -159
- package/toolrunner.js +967 -967
- package/vault.d.ts +10 -10
- package/vault.js +71 -71
package/task.d.ts
CHANGED
|
@@ -1,718 +1,718 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import Q = require('q');
|
|
3
|
-
import fs = require('fs');
|
|
4
|
-
import im = require('./internal');
|
|
5
|
-
import trm = require('./toolrunner');
|
|
6
|
-
export declare enum TaskResult {
|
|
7
|
-
Succeeded = 0,
|
|
8
|
-
SucceededWithIssues = 1,
|
|
9
|
-
Failed = 2,
|
|
10
|
-
Cancelled = 3,
|
|
11
|
-
Skipped = 4
|
|
12
|
-
}
|
|
13
|
-
export declare enum TaskState {
|
|
14
|
-
Unknown = 0,
|
|
15
|
-
Initialized = 1,
|
|
16
|
-
InProgress = 2,
|
|
17
|
-
Completed = 3
|
|
18
|
-
}
|
|
19
|
-
export declare enum IssueType {
|
|
20
|
-
Error = 0,
|
|
21
|
-
Warning = 1
|
|
22
|
-
}
|
|
23
|
-
export declare enum ArtifactType {
|
|
24
|
-
Container = 0,
|
|
25
|
-
FilePath = 1,
|
|
26
|
-
VersionControl = 2,
|
|
27
|
-
GitRef = 3,
|
|
28
|
-
TfvcLabel = 4
|
|
29
|
-
}
|
|
30
|
-
export declare enum FieldType {
|
|
31
|
-
AuthParameter = 0,
|
|
32
|
-
DataParameter = 1,
|
|
33
|
-
Url = 2
|
|
34
|
-
}
|
|
35
|
-
/** Platforms supported by our build agent */
|
|
36
|
-
export declare enum Platform {
|
|
37
|
-
Windows = 0,
|
|
38
|
-
MacOS = 1,
|
|
39
|
-
Linux = 2
|
|
40
|
-
}
|
|
41
|
-
export declare const setStdStream: typeof im._setStdStream;
|
|
42
|
-
export declare const setErrStream: typeof im._setErrStream;
|
|
43
|
-
/**
|
|
44
|
-
* Sets the result of the task.
|
|
45
|
-
* Execution will continue.
|
|
46
|
-
* If not set, task will be Succeeded.
|
|
47
|
-
* If multiple calls are made to setResult the most pessimistic call wins (Failed) regardless of the order of calls.
|
|
48
|
-
*
|
|
49
|
-
* @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped.
|
|
50
|
-
* @param message A message which will be logged as an error issue if the result is Failed.
|
|
51
|
-
* @param done Optional. Instructs the agent the task is done. This is helpful when child processes
|
|
52
|
-
* may still be running and prevent node from fully exiting. This argument is supported
|
|
53
|
-
* from agent version 2.142.0 or higher (otherwise will no-op).
|
|
54
|
-
* @returns void
|
|
55
|
-
*/
|
|
56
|
-
export declare function setResult(result: TaskResult, message: string, done?: boolean): void;
|
|
57
|
-
export declare const setResourcePath: typeof im._setResourcePath;
|
|
58
|
-
export declare const loc: typeof im._loc;
|
|
59
|
-
export declare const getVariable: typeof im._getVariable;
|
|
60
|
-
/**
|
|
61
|
-
* Asserts the agent version is at least the specified minimum.
|
|
62
|
-
*
|
|
63
|
-
* @param minimum minimum version version - must be 2.104.1 or higher
|
|
64
|
-
*/
|
|
65
|
-
export declare function assertAgent(minimum: string): void;
|
|
66
|
-
/**
|
|
67
|
-
* Gets a snapshot of the current state of all job variables available to the task.
|
|
68
|
-
* Requires a 2.104.1 agent or higher for full functionality.
|
|
69
|
-
*
|
|
70
|
-
* Limitations on an agent prior to 2.104.1:
|
|
71
|
-
* 1) The return value does not include all public variables. Only public variables
|
|
72
|
-
* that have been added using setVariable are returned.
|
|
73
|
-
* 2) The name returned for each secret variable is the formatted environment variable
|
|
74
|
-
* name, not the actual variable name (unless it was set explicitly at runtime using
|
|
75
|
-
* setVariable).
|
|
76
|
-
*
|
|
77
|
-
* @returns VariableInfo[]
|
|
78
|
-
*/
|
|
79
|
-
export declare function getVariables(): VariableInfo[];
|
|
80
|
-
/**
|
|
81
|
-
* Sets a variable which will be available to subsequent tasks as well.
|
|
82
|
-
*
|
|
83
|
-
* @param name name of the variable to set
|
|
84
|
-
* @param val value to set
|
|
85
|
-
* @param secret whether variable is secret. Multi-line secrets are not allowed. Optional, defaults to false
|
|
86
|
-
* @param isOutput whether variable is an output variable. Optional, defaults to false
|
|
87
|
-
* @returns void
|
|
88
|
-
*/
|
|
89
|
-
export declare function setVariable(name: string, val: string, secret?: boolean, isOutput?: boolean): void;
|
|
90
|
-
/**
|
|
91
|
-
* Registers a value with the logger, so the value will be masked from the logs. Multi-line secrets are not allowed.
|
|
92
|
-
*
|
|
93
|
-
* @param val value to register
|
|
94
|
-
*/
|
|
95
|
-
export declare function setSecret(val: string): void;
|
|
96
|
-
/** Snapshot of a variable at the time when getVariables was called. */
|
|
97
|
-
export interface VariableInfo {
|
|
98
|
-
name: string;
|
|
99
|
-
value: string;
|
|
100
|
-
secret: boolean;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Gets the value of an input.
|
|
104
|
-
* If required is true and the value is not set, it will throw.
|
|
105
|
-
*
|
|
106
|
-
* @param name name of the input to get
|
|
107
|
-
* @param required whether input is required. optional, defaults to false
|
|
108
|
-
* @returns string
|
|
109
|
-
*/
|
|
110
|
-
export declare function getInput(name: string, required?: boolean): string | undefined;
|
|
111
|
-
/**
|
|
112
|
-
* Gets the value of an input.
|
|
113
|
-
* If the value is not set, it will throw.
|
|
114
|
-
*
|
|
115
|
-
* @param name name of the input to get
|
|
116
|
-
* @returns string
|
|
117
|
-
*/
|
|
118
|
-
export declare function getInputRequired(name: string): string;
|
|
119
|
-
/**
|
|
120
|
-
* Gets the value of an input and converts to a bool. Convenience.
|
|
121
|
-
* If required is true and the value is not set, it will throw.
|
|
122
|
-
* If required is false and the value is not set, returns false.
|
|
123
|
-
*
|
|
124
|
-
* @param name name of the bool input to get
|
|
125
|
-
* @param required whether input is required. optional, defaults to false
|
|
126
|
-
* @returns boolean
|
|
127
|
-
*/
|
|
128
|
-
export declare function getBoolInput(name: string, required?: boolean): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Gets the value of an input and splits the value using a delimiter (space, comma, etc).
|
|
131
|
-
* Empty values are removed. This function is useful for splitting an input containing a simple
|
|
132
|
-
* list of items - such as build targets.
|
|
133
|
-
* IMPORTANT: Do not use this function for splitting additional args! Instead use argString(), which
|
|
134
|
-
* follows normal argument splitting rules and handles values encapsulated by quotes.
|
|
135
|
-
* If required is true and the value is not set, it will throw.
|
|
136
|
-
*
|
|
137
|
-
* @param name name of the input to get
|
|
138
|
-
* @param delim delimiter to split on
|
|
139
|
-
* @param required whether input is required. optional, defaults to false
|
|
140
|
-
* @returns string[]
|
|
141
|
-
*/
|
|
142
|
-
export declare function getDelimitedInput(name: string, delim: string | RegExp, required?: boolean): string[];
|
|
143
|
-
/**
|
|
144
|
-
* Checks whether a path inputs value was supplied by the user
|
|
145
|
-
* File paths are relative with a picker, so an empty path is the root of the repo.
|
|
146
|
-
* Useful if you need to condition work (like append an arg) if a value was supplied
|
|
147
|
-
*
|
|
148
|
-
* @param name name of the path input to check
|
|
149
|
-
* @returns boolean
|
|
150
|
-
*/
|
|
151
|
-
export declare function filePathSupplied(name: string): boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Gets the value of a path input
|
|
154
|
-
* It will be quoted for you if it isn't already and contains spaces
|
|
155
|
-
* If required is true and the value is not set, it will throw.
|
|
156
|
-
* If check is true and the path does not exist, it will throw.
|
|
157
|
-
*
|
|
158
|
-
* @param name name of the input to get
|
|
159
|
-
* @param required whether input is required. optional, defaults to false
|
|
160
|
-
* @param check whether path is checked. optional, defaults to false
|
|
161
|
-
* @returns string
|
|
162
|
-
*/
|
|
163
|
-
export declare function getPathInput(name: string, required?: boolean, check?: boolean): string | undefined;
|
|
164
|
-
/**
|
|
165
|
-
* Gets the value of a path input
|
|
166
|
-
* It will be quoted for you if it isn't already and contains spaces
|
|
167
|
-
* If the value is not set, it will throw.
|
|
168
|
-
* If check is true and the path does not exist, it will throw.
|
|
169
|
-
*
|
|
170
|
-
* @param name name of the input to get
|
|
171
|
-
* @param check whether path is checked. optional, defaults to false
|
|
172
|
-
* @returns string
|
|
173
|
-
*/
|
|
174
|
-
export declare function getPathInputRequired(name: string, check?: boolean): string;
|
|
175
|
-
/**
|
|
176
|
-
* Gets the url for a service endpoint
|
|
177
|
-
* If the url was not set and is not optional, it will throw.
|
|
178
|
-
*
|
|
179
|
-
* @param id name of the service endpoint
|
|
180
|
-
* @param optional whether the url is optional
|
|
181
|
-
* @returns string
|
|
182
|
-
*/
|
|
183
|
-
export declare function getEndpointUrl(id: string, optional: boolean): string | undefined;
|
|
184
|
-
/**
|
|
185
|
-
* Gets the url for a service endpoint
|
|
186
|
-
* If the url was not set, it will throw.
|
|
187
|
-
*
|
|
188
|
-
* @param id name of the service endpoint
|
|
189
|
-
* @returns string
|
|
190
|
-
*/
|
|
191
|
-
export declare function getEndpointUrlRequired(id: string): string;
|
|
192
|
-
export declare function getEndpointDataParameter(id: string, key: string, optional: boolean): string | undefined;
|
|
193
|
-
export declare function getEndpointDataParameterRequired(id: string, key: string): string;
|
|
194
|
-
/**
|
|
195
|
-
* Gets the endpoint authorization scheme for a service endpoint
|
|
196
|
-
* If the endpoint authorization scheme is not set and is not optional, it will throw.
|
|
197
|
-
*
|
|
198
|
-
* @param id name of the service endpoint
|
|
199
|
-
* @param optional whether the endpoint authorization scheme is optional
|
|
200
|
-
* @returns {string} value of the endpoint authorization scheme
|
|
201
|
-
*/
|
|
202
|
-
export declare function getEndpointAuthorizationScheme(id: string, optional: boolean): string | undefined;
|
|
203
|
-
/**
|
|
204
|
-
* Gets the endpoint authorization scheme for a service endpoint
|
|
205
|
-
* If the endpoint authorization scheme is not set, it will throw.
|
|
206
|
-
*
|
|
207
|
-
* @param id name of the service endpoint
|
|
208
|
-
* @returns {string} value of the endpoint authorization scheme
|
|
209
|
-
*/
|
|
210
|
-
export declare function getEndpointAuthorizationSchemeRequired(id: string): string;
|
|
211
|
-
/**
|
|
212
|
-
* Gets the endpoint authorization parameter value for a service endpoint with specified key
|
|
213
|
-
* If the endpoint authorization parameter is not set and is not optional, it will throw.
|
|
214
|
-
*
|
|
215
|
-
* @param id name of the service endpoint
|
|
216
|
-
* @param key key to find the endpoint authorization parameter
|
|
217
|
-
* @param optional optional whether the endpoint authorization scheme is optional
|
|
218
|
-
* @returns {string} value of the endpoint authorization parameter value
|
|
219
|
-
*/
|
|
220
|
-
export declare function getEndpointAuthorizationParameter(id: string, key: string, optional: boolean): string | undefined;
|
|
221
|
-
/**
|
|
222
|
-
* Gets the endpoint authorization parameter value for a service endpoint with specified key
|
|
223
|
-
* If the endpoint authorization parameter is not set, it will throw.
|
|
224
|
-
*
|
|
225
|
-
* @param id name of the service endpoint
|
|
226
|
-
* @param key key to find the endpoint authorization parameter
|
|
227
|
-
* @returns {string} value of the endpoint authorization parameter value
|
|
228
|
-
*/
|
|
229
|
-
export declare function getEndpointAuthorizationParameterRequired(id: string, key: string): string;
|
|
230
|
-
/**
|
|
231
|
-
* Interface for EndpointAuthorization
|
|
232
|
-
* Contains a schema and a string/string dictionary of auth data
|
|
233
|
-
*/
|
|
234
|
-
export interface EndpointAuthorization {
|
|
235
|
-
/** dictionary of auth data */
|
|
236
|
-
parameters: {
|
|
237
|
-
[key: string]: string;
|
|
238
|
-
};
|
|
239
|
-
/** auth scheme such as OAuth or username/password etc... */
|
|
240
|
-
scheme: string;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Gets the authorization details for a service endpoint
|
|
244
|
-
* If the authorization was not set and is not optional, it will set the task result to Failed.
|
|
245
|
-
*
|
|
246
|
-
* @param id name of the service endpoint
|
|
247
|
-
* @param optional whether the url is optional
|
|
248
|
-
* @returns string
|
|
249
|
-
*/
|
|
250
|
-
export declare function getEndpointAuthorization(id: string, optional: boolean): EndpointAuthorization | undefined;
|
|
251
|
-
/**
|
|
252
|
-
* Gets the name for a secure file
|
|
253
|
-
*
|
|
254
|
-
* @param id secure file id
|
|
255
|
-
* @returns string
|
|
256
|
-
*/
|
|
257
|
-
export declare function getSecureFileName(id: string): string | undefined;
|
|
258
|
-
/**
|
|
259
|
-
* Gets the secure file ticket that can be used to download the secure file contents
|
|
260
|
-
*
|
|
261
|
-
* @param id name of the secure file
|
|
262
|
-
* @returns {string} secure file ticket
|
|
263
|
-
*/
|
|
264
|
-
export declare function getSecureFileTicket(id: string): string | undefined;
|
|
265
|
-
/**
|
|
266
|
-
* Gets a variable value that is set by previous step from the same wrapper task.
|
|
267
|
-
* Requires a 2.115.0 agent or higher.
|
|
268
|
-
*
|
|
269
|
-
* @param name name of the variable to get
|
|
270
|
-
* @returns string
|
|
271
|
-
*/
|
|
272
|
-
export declare function getTaskVariable(name: string): string | undefined;
|
|
273
|
-
/**
|
|
274
|
-
* Sets a task variable which will only be available to subsequent steps belong to the same wrapper task.
|
|
275
|
-
* Requires a 2.115.0 agent or higher.
|
|
276
|
-
*
|
|
277
|
-
* @param name name of the variable to set
|
|
278
|
-
* @param val value to set
|
|
279
|
-
* @param secret whether variable is secret. optional, defaults to false
|
|
280
|
-
* @returns void
|
|
281
|
-
*/
|
|
282
|
-
export declare function setTaskVariable(name: string, val: string, secret?: boolean): void;
|
|
283
|
-
export declare const command: typeof im._command;
|
|
284
|
-
export declare const warning: typeof im._warning;
|
|
285
|
-
export declare const error: typeof im._error;
|
|
286
|
-
export declare const debug: typeof im._debug;
|
|
287
|
-
export interface FsStats extends fs.Stats {
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Get's stat on a path.
|
|
291
|
-
* Useful for checking whether a file or directory. Also getting created, modified and accessed time.
|
|
292
|
-
* see [fs.stat](https://nodejs.org/api/fs.html#fs_class_fs_stats)
|
|
293
|
-
*
|
|
294
|
-
* @param path path to check
|
|
295
|
-
* @returns fsStat
|
|
296
|
-
*/
|
|
297
|
-
export declare function stats(path: string): FsStats;
|
|
298
|
-
export declare const exist: typeof im._exist;
|
|
299
|
-
export declare function writeFile(file: string, data: string | Buffer, options?: BufferEncoding | fs.WriteFileOptions): void;
|
|
300
|
-
/**
|
|
301
|
-
* @deprecated Use `getPlatform`
|
|
302
|
-
* Useful for determining the host operating system.
|
|
303
|
-
* see [os.type](https://nodejs.org/api/os.html#os_os_type)
|
|
304
|
-
*
|
|
305
|
-
* @return the name of the operating system
|
|
306
|
-
*/
|
|
307
|
-
export declare function osType(): string;
|
|
308
|
-
/**
|
|
309
|
-
* Determine the operating system the build agent is running on.
|
|
310
|
-
* @returns {Platform}
|
|
311
|
-
* @throws {Error} Platform is not supported by our agent
|
|
312
|
-
*/
|
|
313
|
-
export declare function getPlatform(): Platform;
|
|
314
|
-
/**
|
|
315
|
-
* Returns the process's current working directory.
|
|
316
|
-
* see [process.cwd](https://nodejs.org/api/process.html#process_process_cwd)
|
|
317
|
-
*
|
|
318
|
-
* @return the path to the current working directory of the process
|
|
319
|
-
*/
|
|
320
|
-
export declare function cwd(): string;
|
|
321
|
-
export declare const checkPath: typeof im._checkPath;
|
|
322
|
-
/**
|
|
323
|
-
* Change working directory.
|
|
324
|
-
*
|
|
325
|
-
* @param path new working directory path
|
|
326
|
-
* @returns void
|
|
327
|
-
*/
|
|
328
|
-
export declare function cd(path: string): void;
|
|
329
|
-
/**
|
|
330
|
-
* Change working directory and push it on the stack
|
|
331
|
-
*
|
|
332
|
-
* @param path new working directory path
|
|
333
|
-
* @returns void
|
|
334
|
-
*/
|
|
335
|
-
export declare function pushd(path: string): void;
|
|
336
|
-
/**
|
|
337
|
-
* Change working directory back to previously pushed directory
|
|
338
|
-
*
|
|
339
|
-
* @returns void
|
|
340
|
-
*/
|
|
341
|
-
export declare function popd(): void;
|
|
342
|
-
/**
|
|
343
|
-
* Make a directory. Creates the full path with folders in between
|
|
344
|
-
* Will throw if it fails
|
|
345
|
-
*
|
|
346
|
-
* @param p path to create
|
|
347
|
-
* @returns void
|
|
348
|
-
*/
|
|
349
|
-
export declare function mkdirP(p: string): void;
|
|
350
|
-
/**
|
|
351
|
-
* Resolves a sequence of paths or path segments into an absolute path.
|
|
352
|
-
* Calls node.js path.resolve()
|
|
353
|
-
* Allows L0 testing with consistent path formats on Mac/Linux and Windows in the mock implementation
|
|
354
|
-
* @param pathSegments
|
|
355
|
-
* @returns {string}
|
|
356
|
-
*/
|
|
357
|
-
export declare function resolve(...pathSegments: any[]): string;
|
|
358
|
-
export declare const which: typeof im._which;
|
|
359
|
-
/**
|
|
360
|
-
* Returns array of files in the given path, or in current directory if no path provided. See shelljs.ls
|
|
361
|
-
* @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)
|
|
362
|
-
* @param {string[]} paths Paths to search.
|
|
363
|
-
* @return {string[]} An array of files in the given path(s).
|
|
364
|
-
*/
|
|
365
|
-
export declare function ls(options: string, paths: string[]): string[];
|
|
366
|
-
/**
|
|
367
|
-
* Copies a file or folder.
|
|
368
|
-
*
|
|
369
|
-
* @param source source path
|
|
370
|
-
* @param dest destination path
|
|
371
|
-
* @param options string -r, -f or -rf for recursive and force
|
|
372
|
-
* @param continueOnError optional. whether to continue on error
|
|
373
|
-
* @param retryCount optional. Retry count to copy the file. It might help to resolve intermittent issues e.g. with UNC target paths on a remote host.
|
|
374
|
-
*/
|
|
375
|
-
export declare function cp(source: string, dest: string, options?: string, continueOnError?: boolean, retryCount?: number): void;
|
|
376
|
-
/**
|
|
377
|
-
* Moves a path.
|
|
378
|
-
*
|
|
379
|
-
* @param source source path
|
|
380
|
-
* @param dest destination path
|
|
381
|
-
* @param options string -f or -n for force and no clobber
|
|
382
|
-
* @param continueOnError optional. whether to continue on error
|
|
383
|
-
*/
|
|
384
|
-
export declare function mv(source: string, dest: string, options?: string, continueOnError?: boolean): void;
|
|
385
|
-
/**
|
|
386
|
-
* Interface for FindOptions
|
|
387
|
-
* Contains properties to control whether to follow symlinks
|
|
388
|
-
*/
|
|
389
|
-
export interface FindOptions {
|
|
390
|
-
/**
|
|
391
|
-
* When true, broken symbolic link will not cause an error.
|
|
392
|
-
*/
|
|
393
|
-
allowBrokenSymbolicLinks: boolean;
|
|
394
|
-
/**
|
|
395
|
-
* Equivalent to the -H command line option. Indicates whether to traverse descendants if
|
|
396
|
-
* the specified path is a symbolic link directory. Does not cause nested symbolic link
|
|
397
|
-
* directories to be traversed.
|
|
398
|
-
*/
|
|
399
|
-
followSpecifiedSymbolicLink: boolean;
|
|
400
|
-
/**
|
|
401
|
-
* Equivalent to the -L command line option. Indicates whether to traverse descendants of
|
|
402
|
-
* symbolic link directories.
|
|
403
|
-
*/
|
|
404
|
-
followSymbolicLinks: boolean;
|
|
405
|
-
/**
|
|
406
|
-
* When true, missing files will not cause an error and will be skipped.
|
|
407
|
-
*/
|
|
408
|
-
skipMissingFiles?: boolean;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Interface for RetryOptions
|
|
412
|
-
*
|
|
413
|
-
* Contains "continueOnError" and "retryCount" options.
|
|
414
|
-
*/
|
|
415
|
-
export interface RetryOptions {
|
|
416
|
-
/**
|
|
417
|
-
* If true, code still continues to execute when all retries failed.
|
|
418
|
-
*/
|
|
419
|
-
continueOnError: boolean;
|
|
420
|
-
/**
|
|
421
|
-
* Number of retries.
|
|
422
|
-
*/
|
|
423
|
-
retryCount: number;
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Tries to execute a function a specified number of times.
|
|
427
|
-
*
|
|
428
|
-
* @param func a function to be executed.
|
|
429
|
-
* @param args executed function arguments array.
|
|
430
|
-
* @param retryOptions optional. Defaults to { continueOnError: false, retryCount: 0 }.
|
|
431
|
-
* @returns the same as the usual function.
|
|
432
|
-
*/
|
|
433
|
-
export declare function retry(func: Function, args: any[], retryOptions?: RetryOptions): any;
|
|
434
|
-
/**
|
|
435
|
-
* Recursively finds all paths a given path. Returns an array of paths.
|
|
436
|
-
*
|
|
437
|
-
* @param findPath path to search
|
|
438
|
-
* @param options optional. defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files.
|
|
439
|
-
* @returns string[]
|
|
440
|
-
*/
|
|
441
|
-
export declare function find(findPath: string, options?: FindOptions): string[];
|
|
442
|
-
/**
|
|
443
|
-
* Prefer tl.find() and tl.match() instead. This function is for backward compatibility
|
|
444
|
-
* when porting tasks to Node from the PowerShell or PowerShell3 execution handler.
|
|
445
|
-
*
|
|
446
|
-
* @param rootDirectory path to root unrooted patterns with
|
|
447
|
-
* @param pattern include and exclude patterns
|
|
448
|
-
* @param includeFiles whether to include files in the result. defaults to true when includeFiles and includeDirectories are both false
|
|
449
|
-
* @param includeDirectories whether to include directories in the result
|
|
450
|
-
* @returns string[]
|
|
451
|
-
*/
|
|
452
|
-
export declare function legacyFindFiles(rootDirectory: string, pattern: string, includeFiles?: boolean, includeDirectories?: boolean): string[];
|
|
453
|
-
/**
|
|
454
|
-
* Remove a path recursively with force
|
|
455
|
-
*
|
|
456
|
-
* @param inputPath path to remove
|
|
457
|
-
* @throws when the file or directory exists but could not be deleted.
|
|
458
|
-
*/
|
|
459
|
-
export declare function rmRF(inputPath: string): void;
|
|
460
|
-
/**
|
|
461
|
-
* Exec a tool. Convenience wrapper over ToolRunner to exec with args in one call.
|
|
462
|
-
* Output will be streamed to the live console.
|
|
463
|
-
* Returns promise with return code
|
|
464
|
-
*
|
|
465
|
-
* @param tool path to tool to exec
|
|
466
|
-
* @param args an arg string or array of args
|
|
467
|
-
* @param options optional exec options. See IExecOptions
|
|
468
|
-
* @returns number
|
|
469
|
-
*/
|
|
470
|
-
export declare function exec(tool: string, args: any, options?: trm.IExecOptions): Q.Promise<number>;
|
|
471
|
-
/**
|
|
472
|
-
* Exec a tool synchronously. Convenience wrapper over ToolRunner to execSync with args in one call.
|
|
473
|
-
* Output will be *not* be streamed to the live console. It will be returned after execution is complete.
|
|
474
|
-
* Appropriate for short running tools
|
|
475
|
-
* Returns IExecResult with output and return code
|
|
476
|
-
*
|
|
477
|
-
* @param tool path to tool to exec
|
|
478
|
-
* @param args an arg string or array of args
|
|
479
|
-
* @param options optional exec options. See IExecSyncOptions
|
|
480
|
-
* @returns IExecSyncResult
|
|
481
|
-
*/
|
|
482
|
-
export declare function execSync(tool: string, args: string | string[], options?: trm.IExecSyncOptions): trm.IExecSyncResult;
|
|
483
|
-
/**
|
|
484
|
-
* Convenience factory to create a ToolRunner.
|
|
485
|
-
*
|
|
486
|
-
* @param tool path to tool to exec
|
|
487
|
-
* @returns ToolRunner
|
|
488
|
-
*/
|
|
489
|
-
export declare function tool(tool: string): trm.ToolRunner;
|
|
490
|
-
export interface MatchOptions {
|
|
491
|
-
debug?: boolean;
|
|
492
|
-
nobrace?: boolean;
|
|
493
|
-
noglobstar?: boolean;
|
|
494
|
-
dot?: boolean;
|
|
495
|
-
noext?: boolean;
|
|
496
|
-
nocase?: boolean;
|
|
497
|
-
nonull?: boolean;
|
|
498
|
-
matchBase?: boolean;
|
|
499
|
-
nocomment?: boolean;
|
|
500
|
-
nonegate?: boolean;
|
|
501
|
-
flipNegate?: boolean;
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* Applies glob patterns to a list of paths. Supports interleaved exclude patterns.
|
|
505
|
-
*
|
|
506
|
-
* @param list array of paths
|
|
507
|
-
* @param patterns patterns to apply. supports interleaved exclude patterns.
|
|
508
|
-
* @param patternRoot optional. default root to apply to unrooted patterns. not applied to basename-only patterns when matchBase:true.
|
|
509
|
-
* @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }.
|
|
510
|
-
*/
|
|
511
|
-
export declare function match(list: string[], patterns: string[] | string, patternRoot?: string, options?: MatchOptions): string[];
|
|
512
|
-
/**
|
|
513
|
-
* Filter to apply glob patterns
|
|
514
|
-
*
|
|
515
|
-
* @param pattern pattern to apply
|
|
516
|
-
* @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }.
|
|
517
|
-
*/
|
|
518
|
-
export declare function filter(pattern: string, options?: MatchOptions): (element: string, indexed: number, array: string[]) => boolean;
|
|
519
|
-
/**
|
|
520
|
-
* Determines the find root from a list of patterns. Performs the find and then applies the glob patterns.
|
|
521
|
-
* Supports interleaved exclude patterns. Unrooted patterns are rooted using defaultRoot, unless
|
|
522
|
-
* matchOptions.matchBase is specified and the pattern is a basename only. For matchBase cases, the
|
|
523
|
-
* defaultRoot is used as the find root.
|
|
524
|
-
*
|
|
525
|
-
* @param defaultRoot default path to root unrooted patterns. falls back to System.DefaultWorkingDirectory or process.cwd().
|
|
526
|
-
* @param patterns pattern or array of patterns to apply
|
|
527
|
-
* @param findOptions defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files.
|
|
528
|
-
* @param matchOptions defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }
|
|
529
|
-
*/
|
|
530
|
-
export declare function findMatch(defaultRoot: string, patterns: string[] | string, findOptions?: FindOptions, matchOptions?: MatchOptions): string[];
|
|
531
|
-
export interface ProxyConfiguration {
|
|
532
|
-
proxyUrl: string;
|
|
533
|
-
/**
|
|
534
|
-
* Proxy URI formated as: protocol://username:password@hostname:port
|
|
535
|
-
*
|
|
536
|
-
* For tools that require setting proxy configuration in the single environment variable
|
|
537
|
-
*/
|
|
538
|
-
proxyFormattedUrl: string;
|
|
539
|
-
proxyUsername?: string;
|
|
540
|
-
proxyPassword?: string;
|
|
541
|
-
proxyBypassHosts?: string[];
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Gets http proxy configuration used by Build/Release agent
|
|
545
|
-
*
|
|
546
|
-
* @return ProxyConfiguration
|
|
547
|
-
*/
|
|
548
|
-
export declare function getHttpProxyConfiguration(requestUrl?: string): ProxyConfiguration | null;
|
|
549
|
-
export interface CertConfiguration {
|
|
550
|
-
caFile?: string;
|
|
551
|
-
certFile?: string;
|
|
552
|
-
keyFile?: string;
|
|
553
|
-
certArchiveFile?: string;
|
|
554
|
-
passphrase?: string;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Gets http certificate configuration used by Build/Release agent
|
|
558
|
-
*
|
|
559
|
-
* @return CertConfiguration
|
|
560
|
-
*/
|
|
561
|
-
export declare function getHttpCertConfiguration(): CertConfiguration | null;
|
|
562
|
-
export declare class TestPublisher {
|
|
563
|
-
testRunner: string;
|
|
564
|
-
constructor(testRunner: string);
|
|
565
|
-
publish(resultFiles?: string | string[], mergeResults?: string, platform?: string, config?: string, runTitle?: string, publishRunAttachments?: string, testRunSystem?: string): void;
|
|
566
|
-
}
|
|
567
|
-
export declare class CodeCoveragePublisher {
|
|
568
|
-
constructor();
|
|
569
|
-
publish(codeCoverageTool?: string, summaryFileLocation?: string, reportDirectory?: string, additionalCodeCoverageFiles?: string | string[]): void;
|
|
570
|
-
}
|
|
571
|
-
export declare class CodeCoverageEnabler {
|
|
572
|
-
private buildTool;
|
|
573
|
-
private ccTool;
|
|
574
|
-
constructor(buildTool: string, ccTool: string);
|
|
575
|
-
enableCodeCoverage(buildProps: {
|
|
576
|
-
[key: string]: string;
|
|
577
|
-
}): void;
|
|
578
|
-
}
|
|
579
|
-
/**
|
|
580
|
-
* Upload user interested file as additional log information
|
|
581
|
-
* to the current timeline record.
|
|
582
|
-
*
|
|
583
|
-
* The file shall be available for download along with task logs.
|
|
584
|
-
*
|
|
585
|
-
* @param path Path to the file that should be uploaded.
|
|
586
|
-
* @returns void
|
|
587
|
-
*/
|
|
588
|
-
export declare function uploadFile(path: string): void;
|
|
589
|
-
/**
|
|
590
|
-
* Instruction for the agent to update the PATH environment variable.
|
|
591
|
-
* The specified directory is prepended to the PATH.
|
|
592
|
-
* The updated environment variable will be reflected in subsequent tasks.
|
|
593
|
-
*
|
|
594
|
-
* @param path Local directory path.
|
|
595
|
-
* @returns void
|
|
596
|
-
*/
|
|
597
|
-
export declare function prependPath(path: string): void;
|
|
598
|
-
/**
|
|
599
|
-
* Upload and attach summary markdown to current timeline record.
|
|
600
|
-
* This summary shall be added to the build/release summary and
|
|
601
|
-
* not available for download with logs.
|
|
602
|
-
*
|
|
603
|
-
* @param path Local directory path.
|
|
604
|
-
* @returns void
|
|
605
|
-
*/
|
|
606
|
-
export declare function uploadSummary(path: string): void;
|
|
607
|
-
/**
|
|
608
|
-
* Upload and attach attachment to current timeline record.
|
|
609
|
-
* These files are not available for download with logs.
|
|
610
|
-
* These can only be referred to by extensions using the type or name values.
|
|
611
|
-
*
|
|
612
|
-
* @param type Attachment type.
|
|
613
|
-
* @param name Attachment name.
|
|
614
|
-
* @param path Attachment path.
|
|
615
|
-
* @returns void
|
|
616
|
-
*/
|
|
617
|
-
export declare function addAttachment(type: string, name: string, path: string): void;
|
|
618
|
-
/**
|
|
619
|
-
* Set an endpoint field with given value.
|
|
620
|
-
* Value updated will be retained in the endpoint for
|
|
621
|
-
* the subsequent tasks that execute within the same job.
|
|
622
|
-
*
|
|
623
|
-
* @param id Endpoint id.
|
|
624
|
-
* @param field FieldType enum of AuthParameter, DataParameter or Url.
|
|
625
|
-
* @param key Key.
|
|
626
|
-
* @param value Value for key or url.
|
|
627
|
-
* @returns void
|
|
628
|
-
*/
|
|
629
|
-
export declare function setEndpoint(id: string, field: FieldType, key: string, value: string): void;
|
|
630
|
-
/**
|
|
631
|
-
* Set progress and current operation for current task.
|
|
632
|
-
*
|
|
633
|
-
* @param percent Percentage of completion.
|
|
634
|
-
* @param currentOperation Current pperation.
|
|
635
|
-
* @returns void
|
|
636
|
-
*/
|
|
637
|
-
export declare function setProgress(percent: number, currentOperation: string): void;
|
|
638
|
-
/**
|
|
639
|
-
* Indicates whether to write the logging command directly to the host or to the output pipeline.
|
|
640
|
-
*
|
|
641
|
-
* @param id Timeline record Guid.
|
|
642
|
-
* @param parentId Parent timeline record Guid.
|
|
643
|
-
* @param recordType Record type.
|
|
644
|
-
* @param recordName Record name.
|
|
645
|
-
* @param order Order of timeline record.
|
|
646
|
-
* @param startTime Start time.
|
|
647
|
-
* @param finishTime End time.
|
|
648
|
-
* @param progress Percentage of completion.
|
|
649
|
-
* @param state TaskState enum of Unknown, Initialized, InProgress or Completed.
|
|
650
|
-
* @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped.
|
|
651
|
-
* @param message current operation
|
|
652
|
-
* @returns void
|
|
653
|
-
*/
|
|
654
|
-
export declare function logDetail(id: string, message: string, parentId?: string, recordType?: string, recordName?: string, order?: number, startTime?: string, finishTime?: string, progress?: number, state?: TaskState, result?: TaskResult): void;
|
|
655
|
-
/**
|
|
656
|
-
* Log error or warning issue to timeline record of current task.
|
|
657
|
-
*
|
|
658
|
-
* @param type IssueType enum of Error or Warning.
|
|
659
|
-
* @param sourcePath Source file location.
|
|
660
|
-
* @param lineNumber Line number.
|
|
661
|
-
* @param columnNumber Column number.
|
|
662
|
-
* @param code Error or warning code.
|
|
663
|
-
* @param message Error or warning message.
|
|
664
|
-
* @returns void
|
|
665
|
-
*/
|
|
666
|
-
export declare function logIssue(type: IssueType, message: string, sourcePath?: string, lineNumber?: number, columnNumber?: number, errorCode?: string): void;
|
|
667
|
-
/**
|
|
668
|
-
* Upload user interested file as additional log information
|
|
669
|
-
* to the current timeline record.
|
|
670
|
-
*
|
|
671
|
-
* The file shall be available for download along with task logs.
|
|
672
|
-
*
|
|
673
|
-
* @param containerFolder Folder that the file will upload to, folder will be created if needed.
|
|
674
|
-
* @param path Path to the file that should be uploaded.
|
|
675
|
-
* @param name Artifact name.
|
|
676
|
-
* @returns void
|
|
677
|
-
*/
|
|
678
|
-
export declare function uploadArtifact(containerFolder: string, path: string, name?: string): void;
|
|
679
|
-
/**
|
|
680
|
-
* Create an artifact link, artifact location is required to be
|
|
681
|
-
* a file container path, VC path or UNC share path.
|
|
682
|
-
*
|
|
683
|
-
* The file shall be available for download along with task logs.
|
|
684
|
-
*
|
|
685
|
-
* @param name Artifact name.
|
|
686
|
-
* @param path Path to the file that should be associated.
|
|
687
|
-
* @param artifactType ArtifactType enum of Container, FilePath, VersionControl, GitRef or TfvcLabel.
|
|
688
|
-
* @returns void
|
|
689
|
-
*/
|
|
690
|
-
export declare function associateArtifact(name: string, path: string, artifactType: ArtifactType): void;
|
|
691
|
-
/**
|
|
692
|
-
* Upload user interested log to build’s container “logs\tool” folder.
|
|
693
|
-
*
|
|
694
|
-
* @param path Path to the file that should be uploaded.
|
|
695
|
-
* @returns void
|
|
696
|
-
*/
|
|
697
|
-
export declare function uploadBuildLog(path: string): void;
|
|
698
|
-
/**
|
|
699
|
-
* Update build number for current build.
|
|
700
|
-
*
|
|
701
|
-
* @param value Value to be assigned as the build number.
|
|
702
|
-
* @returns void
|
|
703
|
-
*/
|
|
704
|
-
export declare function updateBuildNumber(value: string): void;
|
|
705
|
-
/**
|
|
706
|
-
* Add a tag for current build.
|
|
707
|
-
*
|
|
708
|
-
* @param value Tag value.
|
|
709
|
-
* @returns void
|
|
710
|
-
*/
|
|
711
|
-
export declare function addBuildTag(value: string): void;
|
|
712
|
-
/**
|
|
713
|
-
* Update release name for current release.
|
|
714
|
-
*
|
|
715
|
-
* @param value Value to be assigned as the release name.
|
|
716
|
-
* @returns void
|
|
717
|
-
*/
|
|
718
|
-
export declare function updateReleaseName(name: string): void;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Q = require('q');
|
|
3
|
+
import fs = require('fs');
|
|
4
|
+
import im = require('./internal');
|
|
5
|
+
import trm = require('./toolrunner');
|
|
6
|
+
export declare enum TaskResult {
|
|
7
|
+
Succeeded = 0,
|
|
8
|
+
SucceededWithIssues = 1,
|
|
9
|
+
Failed = 2,
|
|
10
|
+
Cancelled = 3,
|
|
11
|
+
Skipped = 4
|
|
12
|
+
}
|
|
13
|
+
export declare enum TaskState {
|
|
14
|
+
Unknown = 0,
|
|
15
|
+
Initialized = 1,
|
|
16
|
+
InProgress = 2,
|
|
17
|
+
Completed = 3
|
|
18
|
+
}
|
|
19
|
+
export declare enum IssueType {
|
|
20
|
+
Error = 0,
|
|
21
|
+
Warning = 1
|
|
22
|
+
}
|
|
23
|
+
export declare enum ArtifactType {
|
|
24
|
+
Container = 0,
|
|
25
|
+
FilePath = 1,
|
|
26
|
+
VersionControl = 2,
|
|
27
|
+
GitRef = 3,
|
|
28
|
+
TfvcLabel = 4
|
|
29
|
+
}
|
|
30
|
+
export declare enum FieldType {
|
|
31
|
+
AuthParameter = 0,
|
|
32
|
+
DataParameter = 1,
|
|
33
|
+
Url = 2
|
|
34
|
+
}
|
|
35
|
+
/** Platforms supported by our build agent */
|
|
36
|
+
export declare enum Platform {
|
|
37
|
+
Windows = 0,
|
|
38
|
+
MacOS = 1,
|
|
39
|
+
Linux = 2
|
|
40
|
+
}
|
|
41
|
+
export declare const setStdStream: typeof im._setStdStream;
|
|
42
|
+
export declare const setErrStream: typeof im._setErrStream;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the result of the task.
|
|
45
|
+
* Execution will continue.
|
|
46
|
+
* If not set, task will be Succeeded.
|
|
47
|
+
* If multiple calls are made to setResult the most pessimistic call wins (Failed) regardless of the order of calls.
|
|
48
|
+
*
|
|
49
|
+
* @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped.
|
|
50
|
+
* @param message A message which will be logged as an error issue if the result is Failed.
|
|
51
|
+
* @param done Optional. Instructs the agent the task is done. This is helpful when child processes
|
|
52
|
+
* may still be running and prevent node from fully exiting. This argument is supported
|
|
53
|
+
* from agent version 2.142.0 or higher (otherwise will no-op).
|
|
54
|
+
* @returns void
|
|
55
|
+
*/
|
|
56
|
+
export declare function setResult(result: TaskResult, message: string, done?: boolean): void;
|
|
57
|
+
export declare const setResourcePath: typeof im._setResourcePath;
|
|
58
|
+
export declare const loc: typeof im._loc;
|
|
59
|
+
export declare const getVariable: typeof im._getVariable;
|
|
60
|
+
/**
|
|
61
|
+
* Asserts the agent version is at least the specified minimum.
|
|
62
|
+
*
|
|
63
|
+
* @param minimum minimum version version - must be 2.104.1 or higher
|
|
64
|
+
*/
|
|
65
|
+
export declare function assertAgent(minimum: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Gets a snapshot of the current state of all job variables available to the task.
|
|
68
|
+
* Requires a 2.104.1 agent or higher for full functionality.
|
|
69
|
+
*
|
|
70
|
+
* Limitations on an agent prior to 2.104.1:
|
|
71
|
+
* 1) The return value does not include all public variables. Only public variables
|
|
72
|
+
* that have been added using setVariable are returned.
|
|
73
|
+
* 2) The name returned for each secret variable is the formatted environment variable
|
|
74
|
+
* name, not the actual variable name (unless it was set explicitly at runtime using
|
|
75
|
+
* setVariable).
|
|
76
|
+
*
|
|
77
|
+
* @returns VariableInfo[]
|
|
78
|
+
*/
|
|
79
|
+
export declare function getVariables(): VariableInfo[];
|
|
80
|
+
/**
|
|
81
|
+
* Sets a variable which will be available to subsequent tasks as well.
|
|
82
|
+
*
|
|
83
|
+
* @param name name of the variable to set
|
|
84
|
+
* @param val value to set
|
|
85
|
+
* @param secret whether variable is secret. Multi-line secrets are not allowed. Optional, defaults to false
|
|
86
|
+
* @param isOutput whether variable is an output variable. Optional, defaults to false
|
|
87
|
+
* @returns void
|
|
88
|
+
*/
|
|
89
|
+
export declare function setVariable(name: string, val: string, secret?: boolean, isOutput?: boolean): void;
|
|
90
|
+
/**
|
|
91
|
+
* Registers a value with the logger, so the value will be masked from the logs. Multi-line secrets are not allowed.
|
|
92
|
+
*
|
|
93
|
+
* @param val value to register
|
|
94
|
+
*/
|
|
95
|
+
export declare function setSecret(val: string): void;
|
|
96
|
+
/** Snapshot of a variable at the time when getVariables was called. */
|
|
97
|
+
export interface VariableInfo {
|
|
98
|
+
name: string;
|
|
99
|
+
value: string;
|
|
100
|
+
secret: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Gets the value of an input.
|
|
104
|
+
* If required is true and the value is not set, it will throw.
|
|
105
|
+
*
|
|
106
|
+
* @param name name of the input to get
|
|
107
|
+
* @param required whether input is required. optional, defaults to false
|
|
108
|
+
* @returns string
|
|
109
|
+
*/
|
|
110
|
+
export declare function getInput(name: string, required?: boolean): string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the value of an input.
|
|
113
|
+
* If the value is not set, it will throw.
|
|
114
|
+
*
|
|
115
|
+
* @param name name of the input to get
|
|
116
|
+
* @returns string
|
|
117
|
+
*/
|
|
118
|
+
export declare function getInputRequired(name: string): string;
|
|
119
|
+
/**
|
|
120
|
+
* Gets the value of an input and converts to a bool. Convenience.
|
|
121
|
+
* If required is true and the value is not set, it will throw.
|
|
122
|
+
* If required is false and the value is not set, returns false.
|
|
123
|
+
*
|
|
124
|
+
* @param name name of the bool input to get
|
|
125
|
+
* @param required whether input is required. optional, defaults to false
|
|
126
|
+
* @returns boolean
|
|
127
|
+
*/
|
|
128
|
+
export declare function getBoolInput(name: string, required?: boolean): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Gets the value of an input and splits the value using a delimiter (space, comma, etc).
|
|
131
|
+
* Empty values are removed. This function is useful for splitting an input containing a simple
|
|
132
|
+
* list of items - such as build targets.
|
|
133
|
+
* IMPORTANT: Do not use this function for splitting additional args! Instead use argString(), which
|
|
134
|
+
* follows normal argument splitting rules and handles values encapsulated by quotes.
|
|
135
|
+
* If required is true and the value is not set, it will throw.
|
|
136
|
+
*
|
|
137
|
+
* @param name name of the input to get
|
|
138
|
+
* @param delim delimiter to split on
|
|
139
|
+
* @param required whether input is required. optional, defaults to false
|
|
140
|
+
* @returns string[]
|
|
141
|
+
*/
|
|
142
|
+
export declare function getDelimitedInput(name: string, delim: string | RegExp, required?: boolean): string[];
|
|
143
|
+
/**
|
|
144
|
+
* Checks whether a path inputs value was supplied by the user
|
|
145
|
+
* File paths are relative with a picker, so an empty path is the root of the repo.
|
|
146
|
+
* Useful if you need to condition work (like append an arg) if a value was supplied
|
|
147
|
+
*
|
|
148
|
+
* @param name name of the path input to check
|
|
149
|
+
* @returns boolean
|
|
150
|
+
*/
|
|
151
|
+
export declare function filePathSupplied(name: string): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Gets the value of a path input
|
|
154
|
+
* It will be quoted for you if it isn't already and contains spaces
|
|
155
|
+
* If required is true and the value is not set, it will throw.
|
|
156
|
+
* If check is true and the path does not exist, it will throw.
|
|
157
|
+
*
|
|
158
|
+
* @param name name of the input to get
|
|
159
|
+
* @param required whether input is required. optional, defaults to false
|
|
160
|
+
* @param check whether path is checked. optional, defaults to false
|
|
161
|
+
* @returns string
|
|
162
|
+
*/
|
|
163
|
+
export declare function getPathInput(name: string, required?: boolean, check?: boolean): string | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Gets the value of a path input
|
|
166
|
+
* It will be quoted for you if it isn't already and contains spaces
|
|
167
|
+
* If the value is not set, it will throw.
|
|
168
|
+
* If check is true and the path does not exist, it will throw.
|
|
169
|
+
*
|
|
170
|
+
* @param name name of the input to get
|
|
171
|
+
* @param check whether path is checked. optional, defaults to false
|
|
172
|
+
* @returns string
|
|
173
|
+
*/
|
|
174
|
+
export declare function getPathInputRequired(name: string, check?: boolean): string;
|
|
175
|
+
/**
|
|
176
|
+
* Gets the url for a service endpoint
|
|
177
|
+
* If the url was not set and is not optional, it will throw.
|
|
178
|
+
*
|
|
179
|
+
* @param id name of the service endpoint
|
|
180
|
+
* @param optional whether the url is optional
|
|
181
|
+
* @returns string
|
|
182
|
+
*/
|
|
183
|
+
export declare function getEndpointUrl(id: string, optional: boolean): string | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Gets the url for a service endpoint
|
|
186
|
+
* If the url was not set, it will throw.
|
|
187
|
+
*
|
|
188
|
+
* @param id name of the service endpoint
|
|
189
|
+
* @returns string
|
|
190
|
+
*/
|
|
191
|
+
export declare function getEndpointUrlRequired(id: string): string;
|
|
192
|
+
export declare function getEndpointDataParameter(id: string, key: string, optional: boolean): string | undefined;
|
|
193
|
+
export declare function getEndpointDataParameterRequired(id: string, key: string): string;
|
|
194
|
+
/**
|
|
195
|
+
* Gets the endpoint authorization scheme for a service endpoint
|
|
196
|
+
* If the endpoint authorization scheme is not set and is not optional, it will throw.
|
|
197
|
+
*
|
|
198
|
+
* @param id name of the service endpoint
|
|
199
|
+
* @param optional whether the endpoint authorization scheme is optional
|
|
200
|
+
* @returns {string} value of the endpoint authorization scheme
|
|
201
|
+
*/
|
|
202
|
+
export declare function getEndpointAuthorizationScheme(id: string, optional: boolean): string | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Gets the endpoint authorization scheme for a service endpoint
|
|
205
|
+
* If the endpoint authorization scheme is not set, it will throw.
|
|
206
|
+
*
|
|
207
|
+
* @param id name of the service endpoint
|
|
208
|
+
* @returns {string} value of the endpoint authorization scheme
|
|
209
|
+
*/
|
|
210
|
+
export declare function getEndpointAuthorizationSchemeRequired(id: string): string;
|
|
211
|
+
/**
|
|
212
|
+
* Gets the endpoint authorization parameter value for a service endpoint with specified key
|
|
213
|
+
* If the endpoint authorization parameter is not set and is not optional, it will throw.
|
|
214
|
+
*
|
|
215
|
+
* @param id name of the service endpoint
|
|
216
|
+
* @param key key to find the endpoint authorization parameter
|
|
217
|
+
* @param optional optional whether the endpoint authorization scheme is optional
|
|
218
|
+
* @returns {string} value of the endpoint authorization parameter value
|
|
219
|
+
*/
|
|
220
|
+
export declare function getEndpointAuthorizationParameter(id: string, key: string, optional: boolean): string | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Gets the endpoint authorization parameter value for a service endpoint with specified key
|
|
223
|
+
* If the endpoint authorization parameter is not set, it will throw.
|
|
224
|
+
*
|
|
225
|
+
* @param id name of the service endpoint
|
|
226
|
+
* @param key key to find the endpoint authorization parameter
|
|
227
|
+
* @returns {string} value of the endpoint authorization parameter value
|
|
228
|
+
*/
|
|
229
|
+
export declare function getEndpointAuthorizationParameterRequired(id: string, key: string): string;
|
|
230
|
+
/**
|
|
231
|
+
* Interface for EndpointAuthorization
|
|
232
|
+
* Contains a schema and a string/string dictionary of auth data
|
|
233
|
+
*/
|
|
234
|
+
export interface EndpointAuthorization {
|
|
235
|
+
/** dictionary of auth data */
|
|
236
|
+
parameters: {
|
|
237
|
+
[key: string]: string;
|
|
238
|
+
};
|
|
239
|
+
/** auth scheme such as OAuth or username/password etc... */
|
|
240
|
+
scheme: string;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Gets the authorization details for a service endpoint
|
|
244
|
+
* If the authorization was not set and is not optional, it will set the task result to Failed.
|
|
245
|
+
*
|
|
246
|
+
* @param id name of the service endpoint
|
|
247
|
+
* @param optional whether the url is optional
|
|
248
|
+
* @returns string
|
|
249
|
+
*/
|
|
250
|
+
export declare function getEndpointAuthorization(id: string, optional: boolean): EndpointAuthorization | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* Gets the name for a secure file
|
|
253
|
+
*
|
|
254
|
+
* @param id secure file id
|
|
255
|
+
* @returns string
|
|
256
|
+
*/
|
|
257
|
+
export declare function getSecureFileName(id: string): string | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Gets the secure file ticket that can be used to download the secure file contents
|
|
260
|
+
*
|
|
261
|
+
* @param id name of the secure file
|
|
262
|
+
* @returns {string} secure file ticket
|
|
263
|
+
*/
|
|
264
|
+
export declare function getSecureFileTicket(id: string): string | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Gets a variable value that is set by previous step from the same wrapper task.
|
|
267
|
+
* Requires a 2.115.0 agent or higher.
|
|
268
|
+
*
|
|
269
|
+
* @param name name of the variable to get
|
|
270
|
+
* @returns string
|
|
271
|
+
*/
|
|
272
|
+
export declare function getTaskVariable(name: string): string | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Sets a task variable which will only be available to subsequent steps belong to the same wrapper task.
|
|
275
|
+
* Requires a 2.115.0 agent or higher.
|
|
276
|
+
*
|
|
277
|
+
* @param name name of the variable to set
|
|
278
|
+
* @param val value to set
|
|
279
|
+
* @param secret whether variable is secret. optional, defaults to false
|
|
280
|
+
* @returns void
|
|
281
|
+
*/
|
|
282
|
+
export declare function setTaskVariable(name: string, val: string, secret?: boolean): void;
|
|
283
|
+
export declare const command: typeof im._command;
|
|
284
|
+
export declare const warning: typeof im._warning;
|
|
285
|
+
export declare const error: typeof im._error;
|
|
286
|
+
export declare const debug: typeof im._debug;
|
|
287
|
+
export interface FsStats extends fs.Stats {
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Get's stat on a path.
|
|
291
|
+
* Useful for checking whether a file or directory. Also getting created, modified and accessed time.
|
|
292
|
+
* see [fs.stat](https://nodejs.org/api/fs.html#fs_class_fs_stats)
|
|
293
|
+
*
|
|
294
|
+
* @param path path to check
|
|
295
|
+
* @returns fsStat
|
|
296
|
+
*/
|
|
297
|
+
export declare function stats(path: string): FsStats;
|
|
298
|
+
export declare const exist: typeof im._exist;
|
|
299
|
+
export declare function writeFile(file: string, data: string | Buffer, options?: BufferEncoding | fs.WriteFileOptions): void;
|
|
300
|
+
/**
|
|
301
|
+
* @deprecated Use `getPlatform`
|
|
302
|
+
* Useful for determining the host operating system.
|
|
303
|
+
* see [os.type](https://nodejs.org/api/os.html#os_os_type)
|
|
304
|
+
*
|
|
305
|
+
* @return the name of the operating system
|
|
306
|
+
*/
|
|
307
|
+
export declare function osType(): string;
|
|
308
|
+
/**
|
|
309
|
+
* Determine the operating system the build agent is running on.
|
|
310
|
+
* @returns {Platform}
|
|
311
|
+
* @throws {Error} Platform is not supported by our agent
|
|
312
|
+
*/
|
|
313
|
+
export declare function getPlatform(): Platform;
|
|
314
|
+
/**
|
|
315
|
+
* Returns the process's current working directory.
|
|
316
|
+
* see [process.cwd](https://nodejs.org/api/process.html#process_process_cwd)
|
|
317
|
+
*
|
|
318
|
+
* @return the path to the current working directory of the process
|
|
319
|
+
*/
|
|
320
|
+
export declare function cwd(): string;
|
|
321
|
+
export declare const checkPath: typeof im._checkPath;
|
|
322
|
+
/**
|
|
323
|
+
* Change working directory.
|
|
324
|
+
*
|
|
325
|
+
* @param path new working directory path
|
|
326
|
+
* @returns void
|
|
327
|
+
*/
|
|
328
|
+
export declare function cd(path: string): void;
|
|
329
|
+
/**
|
|
330
|
+
* Change working directory and push it on the stack
|
|
331
|
+
*
|
|
332
|
+
* @param path new working directory path
|
|
333
|
+
* @returns void
|
|
334
|
+
*/
|
|
335
|
+
export declare function pushd(path: string): void;
|
|
336
|
+
/**
|
|
337
|
+
* Change working directory back to previously pushed directory
|
|
338
|
+
*
|
|
339
|
+
* @returns void
|
|
340
|
+
*/
|
|
341
|
+
export declare function popd(): void;
|
|
342
|
+
/**
|
|
343
|
+
* Make a directory. Creates the full path with folders in between
|
|
344
|
+
* Will throw if it fails
|
|
345
|
+
*
|
|
346
|
+
* @param p path to create
|
|
347
|
+
* @returns void
|
|
348
|
+
*/
|
|
349
|
+
export declare function mkdirP(p: string): void;
|
|
350
|
+
/**
|
|
351
|
+
* Resolves a sequence of paths or path segments into an absolute path.
|
|
352
|
+
* Calls node.js path.resolve()
|
|
353
|
+
* Allows L0 testing with consistent path formats on Mac/Linux and Windows in the mock implementation
|
|
354
|
+
* @param pathSegments
|
|
355
|
+
* @returns {string}
|
|
356
|
+
*/
|
|
357
|
+
export declare function resolve(...pathSegments: any[]): string;
|
|
358
|
+
export declare const which: typeof im._which;
|
|
359
|
+
/**
|
|
360
|
+
* Returns array of files in the given path, or in current directory if no path provided. See shelljs.ls
|
|
361
|
+
* @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)
|
|
362
|
+
* @param {string[]} paths Paths to search.
|
|
363
|
+
* @return {string[]} An array of files in the given path(s).
|
|
364
|
+
*/
|
|
365
|
+
export declare function ls(options: string, paths: string[]): string[];
|
|
366
|
+
/**
|
|
367
|
+
* Copies a file or folder.
|
|
368
|
+
*
|
|
369
|
+
* @param source source path
|
|
370
|
+
* @param dest destination path
|
|
371
|
+
* @param options string -r, -f or -rf for recursive and force
|
|
372
|
+
* @param continueOnError optional. whether to continue on error
|
|
373
|
+
* @param retryCount optional. Retry count to copy the file. It might help to resolve intermittent issues e.g. with UNC target paths on a remote host.
|
|
374
|
+
*/
|
|
375
|
+
export declare function cp(source: string, dest: string, options?: string, continueOnError?: boolean, retryCount?: number): void;
|
|
376
|
+
/**
|
|
377
|
+
* Moves a path.
|
|
378
|
+
*
|
|
379
|
+
* @param source source path
|
|
380
|
+
* @param dest destination path
|
|
381
|
+
* @param options string -f or -n for force and no clobber
|
|
382
|
+
* @param continueOnError optional. whether to continue on error
|
|
383
|
+
*/
|
|
384
|
+
export declare function mv(source: string, dest: string, options?: string, continueOnError?: boolean): void;
|
|
385
|
+
/**
|
|
386
|
+
* Interface for FindOptions
|
|
387
|
+
* Contains properties to control whether to follow symlinks
|
|
388
|
+
*/
|
|
389
|
+
export interface FindOptions {
|
|
390
|
+
/**
|
|
391
|
+
* When true, broken symbolic link will not cause an error.
|
|
392
|
+
*/
|
|
393
|
+
allowBrokenSymbolicLinks: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* Equivalent to the -H command line option. Indicates whether to traverse descendants if
|
|
396
|
+
* the specified path is a symbolic link directory. Does not cause nested symbolic link
|
|
397
|
+
* directories to be traversed.
|
|
398
|
+
*/
|
|
399
|
+
followSpecifiedSymbolicLink: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* Equivalent to the -L command line option. Indicates whether to traverse descendants of
|
|
402
|
+
* symbolic link directories.
|
|
403
|
+
*/
|
|
404
|
+
followSymbolicLinks: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* When true, missing files will not cause an error and will be skipped.
|
|
407
|
+
*/
|
|
408
|
+
skipMissingFiles?: boolean;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Interface for RetryOptions
|
|
412
|
+
*
|
|
413
|
+
* Contains "continueOnError" and "retryCount" options.
|
|
414
|
+
*/
|
|
415
|
+
export interface RetryOptions {
|
|
416
|
+
/**
|
|
417
|
+
* If true, code still continues to execute when all retries failed.
|
|
418
|
+
*/
|
|
419
|
+
continueOnError: boolean;
|
|
420
|
+
/**
|
|
421
|
+
* Number of retries.
|
|
422
|
+
*/
|
|
423
|
+
retryCount: number;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Tries to execute a function a specified number of times.
|
|
427
|
+
*
|
|
428
|
+
* @param func a function to be executed.
|
|
429
|
+
* @param args executed function arguments array.
|
|
430
|
+
* @param retryOptions optional. Defaults to { continueOnError: false, retryCount: 0 }.
|
|
431
|
+
* @returns the same as the usual function.
|
|
432
|
+
*/
|
|
433
|
+
export declare function retry(func: Function, args: any[], retryOptions?: RetryOptions): any;
|
|
434
|
+
/**
|
|
435
|
+
* Recursively finds all paths a given path. Returns an array of paths.
|
|
436
|
+
*
|
|
437
|
+
* @param findPath path to search
|
|
438
|
+
* @param options optional. defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files.
|
|
439
|
+
* @returns string[]
|
|
440
|
+
*/
|
|
441
|
+
export declare function find(findPath: string, options?: FindOptions): string[];
|
|
442
|
+
/**
|
|
443
|
+
* Prefer tl.find() and tl.match() instead. This function is for backward compatibility
|
|
444
|
+
* when porting tasks to Node from the PowerShell or PowerShell3 execution handler.
|
|
445
|
+
*
|
|
446
|
+
* @param rootDirectory path to root unrooted patterns with
|
|
447
|
+
* @param pattern include and exclude patterns
|
|
448
|
+
* @param includeFiles whether to include files in the result. defaults to true when includeFiles and includeDirectories are both false
|
|
449
|
+
* @param includeDirectories whether to include directories in the result
|
|
450
|
+
* @returns string[]
|
|
451
|
+
*/
|
|
452
|
+
export declare function legacyFindFiles(rootDirectory: string, pattern: string, includeFiles?: boolean, includeDirectories?: boolean): string[];
|
|
453
|
+
/**
|
|
454
|
+
* Remove a path recursively with force
|
|
455
|
+
*
|
|
456
|
+
* @param inputPath path to remove
|
|
457
|
+
* @throws when the file or directory exists but could not be deleted.
|
|
458
|
+
*/
|
|
459
|
+
export declare function rmRF(inputPath: string): void;
|
|
460
|
+
/**
|
|
461
|
+
* Exec a tool. Convenience wrapper over ToolRunner to exec with args in one call.
|
|
462
|
+
* Output will be streamed to the live console.
|
|
463
|
+
* Returns promise with return code
|
|
464
|
+
*
|
|
465
|
+
* @param tool path to tool to exec
|
|
466
|
+
* @param args an arg string or array of args
|
|
467
|
+
* @param options optional exec options. See IExecOptions
|
|
468
|
+
* @returns number
|
|
469
|
+
*/
|
|
470
|
+
export declare function exec(tool: string, args: any, options?: trm.IExecOptions): Q.Promise<number>;
|
|
471
|
+
/**
|
|
472
|
+
* Exec a tool synchronously. Convenience wrapper over ToolRunner to execSync with args in one call.
|
|
473
|
+
* Output will be *not* be streamed to the live console. It will be returned after execution is complete.
|
|
474
|
+
* Appropriate for short running tools
|
|
475
|
+
* Returns IExecResult with output and return code
|
|
476
|
+
*
|
|
477
|
+
* @param tool path to tool to exec
|
|
478
|
+
* @param args an arg string or array of args
|
|
479
|
+
* @param options optional exec options. See IExecSyncOptions
|
|
480
|
+
* @returns IExecSyncResult
|
|
481
|
+
*/
|
|
482
|
+
export declare function execSync(tool: string, args: string | string[], options?: trm.IExecSyncOptions): trm.IExecSyncResult;
|
|
483
|
+
/**
|
|
484
|
+
* Convenience factory to create a ToolRunner.
|
|
485
|
+
*
|
|
486
|
+
* @param tool path to tool to exec
|
|
487
|
+
* @returns ToolRunner
|
|
488
|
+
*/
|
|
489
|
+
export declare function tool(tool: string): trm.ToolRunner;
|
|
490
|
+
export interface MatchOptions {
|
|
491
|
+
debug?: boolean;
|
|
492
|
+
nobrace?: boolean;
|
|
493
|
+
noglobstar?: boolean;
|
|
494
|
+
dot?: boolean;
|
|
495
|
+
noext?: boolean;
|
|
496
|
+
nocase?: boolean;
|
|
497
|
+
nonull?: boolean;
|
|
498
|
+
matchBase?: boolean;
|
|
499
|
+
nocomment?: boolean;
|
|
500
|
+
nonegate?: boolean;
|
|
501
|
+
flipNegate?: boolean;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Applies glob patterns to a list of paths. Supports interleaved exclude patterns.
|
|
505
|
+
*
|
|
506
|
+
* @param list array of paths
|
|
507
|
+
* @param patterns patterns to apply. supports interleaved exclude patterns.
|
|
508
|
+
* @param patternRoot optional. default root to apply to unrooted patterns. not applied to basename-only patterns when matchBase:true.
|
|
509
|
+
* @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }.
|
|
510
|
+
*/
|
|
511
|
+
export declare function match(list: string[], patterns: string[] | string, patternRoot?: string, options?: MatchOptions): string[];
|
|
512
|
+
/**
|
|
513
|
+
* Filter to apply glob patterns
|
|
514
|
+
*
|
|
515
|
+
* @param pattern pattern to apply
|
|
516
|
+
* @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }.
|
|
517
|
+
*/
|
|
518
|
+
export declare function filter(pattern: string, options?: MatchOptions): (element: string, indexed: number, array: string[]) => boolean;
|
|
519
|
+
/**
|
|
520
|
+
* Determines the find root from a list of patterns. Performs the find and then applies the glob patterns.
|
|
521
|
+
* Supports interleaved exclude patterns. Unrooted patterns are rooted using defaultRoot, unless
|
|
522
|
+
* matchOptions.matchBase is specified and the pattern is a basename only. For matchBase cases, the
|
|
523
|
+
* defaultRoot is used as the find root.
|
|
524
|
+
*
|
|
525
|
+
* @param defaultRoot default path to root unrooted patterns. falls back to System.DefaultWorkingDirectory or process.cwd().
|
|
526
|
+
* @param patterns pattern or array of patterns to apply
|
|
527
|
+
* @param findOptions defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files.
|
|
528
|
+
* @param matchOptions defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }
|
|
529
|
+
*/
|
|
530
|
+
export declare function findMatch(defaultRoot: string, patterns: string[] | string, findOptions?: FindOptions, matchOptions?: MatchOptions): string[];
|
|
531
|
+
export interface ProxyConfiguration {
|
|
532
|
+
proxyUrl: string;
|
|
533
|
+
/**
|
|
534
|
+
* Proxy URI formated as: protocol://username:password@hostname:port
|
|
535
|
+
*
|
|
536
|
+
* For tools that require setting proxy configuration in the single environment variable
|
|
537
|
+
*/
|
|
538
|
+
proxyFormattedUrl: string;
|
|
539
|
+
proxyUsername?: string;
|
|
540
|
+
proxyPassword?: string;
|
|
541
|
+
proxyBypassHosts?: string[];
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Gets http proxy configuration used by Build/Release agent
|
|
545
|
+
*
|
|
546
|
+
* @return ProxyConfiguration
|
|
547
|
+
*/
|
|
548
|
+
export declare function getHttpProxyConfiguration(requestUrl?: string): ProxyConfiguration | null;
|
|
549
|
+
export interface CertConfiguration {
|
|
550
|
+
caFile?: string;
|
|
551
|
+
certFile?: string;
|
|
552
|
+
keyFile?: string;
|
|
553
|
+
certArchiveFile?: string;
|
|
554
|
+
passphrase?: string;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Gets http certificate configuration used by Build/Release agent
|
|
558
|
+
*
|
|
559
|
+
* @return CertConfiguration
|
|
560
|
+
*/
|
|
561
|
+
export declare function getHttpCertConfiguration(): CertConfiguration | null;
|
|
562
|
+
export declare class TestPublisher {
|
|
563
|
+
testRunner: string;
|
|
564
|
+
constructor(testRunner: string);
|
|
565
|
+
publish(resultFiles?: string | string[], mergeResults?: string, platform?: string, config?: string, runTitle?: string, publishRunAttachments?: string, testRunSystem?: string): void;
|
|
566
|
+
}
|
|
567
|
+
export declare class CodeCoveragePublisher {
|
|
568
|
+
constructor();
|
|
569
|
+
publish(codeCoverageTool?: string, summaryFileLocation?: string, reportDirectory?: string, additionalCodeCoverageFiles?: string | string[]): void;
|
|
570
|
+
}
|
|
571
|
+
export declare class CodeCoverageEnabler {
|
|
572
|
+
private buildTool;
|
|
573
|
+
private ccTool;
|
|
574
|
+
constructor(buildTool: string, ccTool: string);
|
|
575
|
+
enableCodeCoverage(buildProps: {
|
|
576
|
+
[key: string]: string;
|
|
577
|
+
}): void;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Upload user interested file as additional log information
|
|
581
|
+
* to the current timeline record.
|
|
582
|
+
*
|
|
583
|
+
* The file shall be available for download along with task logs.
|
|
584
|
+
*
|
|
585
|
+
* @param path Path to the file that should be uploaded.
|
|
586
|
+
* @returns void
|
|
587
|
+
*/
|
|
588
|
+
export declare function uploadFile(path: string): void;
|
|
589
|
+
/**
|
|
590
|
+
* Instruction for the agent to update the PATH environment variable.
|
|
591
|
+
* The specified directory is prepended to the PATH.
|
|
592
|
+
* The updated environment variable will be reflected in subsequent tasks.
|
|
593
|
+
*
|
|
594
|
+
* @param path Local directory path.
|
|
595
|
+
* @returns void
|
|
596
|
+
*/
|
|
597
|
+
export declare function prependPath(path: string): void;
|
|
598
|
+
/**
|
|
599
|
+
* Upload and attach summary markdown to current timeline record.
|
|
600
|
+
* This summary shall be added to the build/release summary and
|
|
601
|
+
* not available for download with logs.
|
|
602
|
+
*
|
|
603
|
+
* @param path Local directory path.
|
|
604
|
+
* @returns void
|
|
605
|
+
*/
|
|
606
|
+
export declare function uploadSummary(path: string): void;
|
|
607
|
+
/**
|
|
608
|
+
* Upload and attach attachment to current timeline record.
|
|
609
|
+
* These files are not available for download with logs.
|
|
610
|
+
* These can only be referred to by extensions using the type or name values.
|
|
611
|
+
*
|
|
612
|
+
* @param type Attachment type.
|
|
613
|
+
* @param name Attachment name.
|
|
614
|
+
* @param path Attachment path.
|
|
615
|
+
* @returns void
|
|
616
|
+
*/
|
|
617
|
+
export declare function addAttachment(type: string, name: string, path: string): void;
|
|
618
|
+
/**
|
|
619
|
+
* Set an endpoint field with given value.
|
|
620
|
+
* Value updated will be retained in the endpoint for
|
|
621
|
+
* the subsequent tasks that execute within the same job.
|
|
622
|
+
*
|
|
623
|
+
* @param id Endpoint id.
|
|
624
|
+
* @param field FieldType enum of AuthParameter, DataParameter or Url.
|
|
625
|
+
* @param key Key.
|
|
626
|
+
* @param value Value for key or url.
|
|
627
|
+
* @returns void
|
|
628
|
+
*/
|
|
629
|
+
export declare function setEndpoint(id: string, field: FieldType, key: string, value: string): void;
|
|
630
|
+
/**
|
|
631
|
+
* Set progress and current operation for current task.
|
|
632
|
+
*
|
|
633
|
+
* @param percent Percentage of completion.
|
|
634
|
+
* @param currentOperation Current pperation.
|
|
635
|
+
* @returns void
|
|
636
|
+
*/
|
|
637
|
+
export declare function setProgress(percent: number, currentOperation: string): void;
|
|
638
|
+
/**
|
|
639
|
+
* Indicates whether to write the logging command directly to the host or to the output pipeline.
|
|
640
|
+
*
|
|
641
|
+
* @param id Timeline record Guid.
|
|
642
|
+
* @param parentId Parent timeline record Guid.
|
|
643
|
+
* @param recordType Record type.
|
|
644
|
+
* @param recordName Record name.
|
|
645
|
+
* @param order Order of timeline record.
|
|
646
|
+
* @param startTime Start time.
|
|
647
|
+
* @param finishTime End time.
|
|
648
|
+
* @param progress Percentage of completion.
|
|
649
|
+
* @param state TaskState enum of Unknown, Initialized, InProgress or Completed.
|
|
650
|
+
* @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped.
|
|
651
|
+
* @param message current operation
|
|
652
|
+
* @returns void
|
|
653
|
+
*/
|
|
654
|
+
export declare function logDetail(id: string, message: string, parentId?: string, recordType?: string, recordName?: string, order?: number, startTime?: string, finishTime?: string, progress?: number, state?: TaskState, result?: TaskResult): void;
|
|
655
|
+
/**
|
|
656
|
+
* Log error or warning issue to timeline record of current task.
|
|
657
|
+
*
|
|
658
|
+
* @param type IssueType enum of Error or Warning.
|
|
659
|
+
* @param sourcePath Source file location.
|
|
660
|
+
* @param lineNumber Line number.
|
|
661
|
+
* @param columnNumber Column number.
|
|
662
|
+
* @param code Error or warning code.
|
|
663
|
+
* @param message Error or warning message.
|
|
664
|
+
* @returns void
|
|
665
|
+
*/
|
|
666
|
+
export declare function logIssue(type: IssueType, message: string, sourcePath?: string, lineNumber?: number, columnNumber?: number, errorCode?: string): void;
|
|
667
|
+
/**
|
|
668
|
+
* Upload user interested file as additional log information
|
|
669
|
+
* to the current timeline record.
|
|
670
|
+
*
|
|
671
|
+
* The file shall be available for download along with task logs.
|
|
672
|
+
*
|
|
673
|
+
* @param containerFolder Folder that the file will upload to, folder will be created if needed.
|
|
674
|
+
* @param path Path to the file that should be uploaded.
|
|
675
|
+
* @param name Artifact name.
|
|
676
|
+
* @returns void
|
|
677
|
+
*/
|
|
678
|
+
export declare function uploadArtifact(containerFolder: string, path: string, name?: string): void;
|
|
679
|
+
/**
|
|
680
|
+
* Create an artifact link, artifact location is required to be
|
|
681
|
+
* a file container path, VC path or UNC share path.
|
|
682
|
+
*
|
|
683
|
+
* The file shall be available for download along with task logs.
|
|
684
|
+
*
|
|
685
|
+
* @param name Artifact name.
|
|
686
|
+
* @param path Path to the file that should be associated.
|
|
687
|
+
* @param artifactType ArtifactType enum of Container, FilePath, VersionControl, GitRef or TfvcLabel.
|
|
688
|
+
* @returns void
|
|
689
|
+
*/
|
|
690
|
+
export declare function associateArtifact(name: string, path: string, artifactType: ArtifactType): void;
|
|
691
|
+
/**
|
|
692
|
+
* Upload user interested log to build’s container “logs\tool” folder.
|
|
693
|
+
*
|
|
694
|
+
* @param path Path to the file that should be uploaded.
|
|
695
|
+
* @returns void
|
|
696
|
+
*/
|
|
697
|
+
export declare function uploadBuildLog(path: string): void;
|
|
698
|
+
/**
|
|
699
|
+
* Update build number for current build.
|
|
700
|
+
*
|
|
701
|
+
* @param value Value to be assigned as the build number.
|
|
702
|
+
* @returns void
|
|
703
|
+
*/
|
|
704
|
+
export declare function updateBuildNumber(value: string): void;
|
|
705
|
+
/**
|
|
706
|
+
* Add a tag for current build.
|
|
707
|
+
*
|
|
708
|
+
* @param value Tag value.
|
|
709
|
+
* @returns void
|
|
710
|
+
*/
|
|
711
|
+
export declare function addBuildTag(value: string): void;
|
|
712
|
+
/**
|
|
713
|
+
* Update release name for current release.
|
|
714
|
+
*
|
|
715
|
+
* @param value Value to be assigned as the release name.
|
|
716
|
+
* @returns void
|
|
717
|
+
*/
|
|
718
|
+
export declare function updateReleaseName(name: string): void;
|