-
Notifications
You must be signed in to change notification settings - Fork 871
/
Copy pathConstants.cs
703 lines (663 loc) Β· 36.9 KB
/
Constants.cs
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
30
31
32
33
34
35
36
37
38
39
40
41
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using Agent.Sdk;
using System.Collections.Generic;
namespace Microsoft.VisualStudio.Services.Agent
{
public enum WellKnownDirectory
{
Bin,
Externals,
LegacyPSHost,
Root,
ServerOM,
Tasks,
TaskZips,
Tee,
Temp,
Tf,
Tools,
Update,
Work,
TfLegacy,
ServerOMLegacy,
LegacyPSHostLegacy
}
public enum WellKnownConfigFile
{
Agent,
Credentials,
RSACredentials,
Service,
CredentialStore,
Certificates,
Proxy,
ProxyCredentials,
ProxyBypass,
Autologon,
Options,
SetupInfo,
TaskExceptionList // We need to remove this config file - once Node 6 handler is dropped
}
public static class WellKnownTasks
{
public static class PluginTaskIds
{
// We need have the ID for the checkout task for now since it is not present in the azure-pipelines-tasks repo.
public static readonly Guid CheckoutTask = new Guid("6d15af64-176c-496d-b583-fd2ae21d4df4");
}
public static class MicrosoftExtensionTaskIds
{
public static readonly Guid GooglePlayIncreaseRolloutTask = new Guid("f8c97cf9-4e17-4244-b0fb-f540cea78153");
public static readonly Guid GooglePlayPromoteTask = new Guid("4dae1f76-29d3-482f-97d5-e3189a8347c2");
public static readonly Guid GooglePlayReleaseTask = new Guid("8cf7cac0-620b-11e5-b4cf-8565e60f4d27");
public static readonly Guid GooglePlayStatusUpdateTask = new Guid("92e6c372-4193-44e5-9db7-58d7d253f4d8");
public static readonly Guid AppStorePromoteTask = new Guid("cbbf7f14-c386-4c1f-80a3-fe500e2bd976");
public static readonly Guid AppStoreReleaseTask = new Guid("2e371150-da5e-11e5-83da-0943b1acc572");
public static readonly Guid IpaResignTask = new Guid("cbbf7f14-c386-4c1f-80a3-fe500e2bd977");
// ms.advancedsecurity-tasks
public static readonly Guid AdvancedSecurityPublishTask = new Guid("a95ad3e1-3950-494f-a460-963e3f5f6928");
public static readonly Guid AdvancedSecurityCodeqlAnalyze = new Guid("a9efc1ef-3900-494f-a460-963e3f5f6928");
public static readonly Guid AdvancedSecurityCodeqlAutobuild = new Guid("a63ec2fb-3600-494f-a460-963e3f5f6928");
public static readonly Guid AdvancedSecurityCodeqlInit = new Guid("a34f8529-3300-494f-a460-963e3f5f6928");
public static readonly Guid AdvancedSecurityDependencyScanning = new Guid("f97aace4-962a-441b-9141-b842d806b9c7");
// advancedsecurity.iac-tasks
public static readonly Guid TemplateAnalyzerSarif = new Guid("2ff4011a-8c38-46ae-9654-29d7d45ce875");
public static readonly Guid TerrascanSarif = new Guid("f1af679c-4cbf-4952-98c9-c772c8eb9920");
public static readonly Guid TrivySarif = new Guid("93e29b44-e118-445d-b809-ae3c7907bee7");
}
public static List<Guid> RequiredForTelemetry = new()
{
PluginTaskIds.CheckoutTask,
MicrosoftExtensionTaskIds.GooglePlayIncreaseRolloutTask,
MicrosoftExtensionTaskIds.GooglePlayPromoteTask,
MicrosoftExtensionTaskIds.GooglePlayReleaseTask,
MicrosoftExtensionTaskIds.GooglePlayStatusUpdateTask,
MicrosoftExtensionTaskIds.AppStorePromoteTask,
MicrosoftExtensionTaskIds.AppStoreReleaseTask,
MicrosoftExtensionTaskIds.IpaResignTask,
MicrosoftExtensionTaskIds.AdvancedSecurityPublishTask,
MicrosoftExtensionTaskIds.AdvancedSecurityCodeqlAnalyze,
MicrosoftExtensionTaskIds.AdvancedSecurityCodeqlAutobuild,
MicrosoftExtensionTaskIds.AdvancedSecurityCodeqlInit,
MicrosoftExtensionTaskIds.AdvancedSecurityDependencyScanning,
MicrosoftExtensionTaskIds.TemplateAnalyzerSarif,
MicrosoftExtensionTaskIds.TerrascanSarif,
MicrosoftExtensionTaskIds.TrivySarif
};
}
public static class Constants
{
/// <summary>Name of environment variable holding the path.</summary>
public static string PathVariable
{
get =>
PlatformUtil.RunningOnWindows
? "Path"
: "PATH";
}
public static string TFBuild = "TF_BUILD";
public static string ProcessLookupId = "VSTS_PROCESS_LOOKUP_ID";
public static string PluginTracePrefix = "##[plugin.trace]";
public static readonly int AgentDownloadRetryMaxAttempts = 3;
public const string projectName = "projectName";
public const string CommandCorrelationIdEnvVar = "COMMAND_CORRELATION_ID";
public const string TaskInternalIssueSource = "TaskInternal";
// Environment variable set on hosted Azure Pipelines images to
// store the version of the image
public static readonly string ImageVersionVariable = "ImageVersion";
public static class DefaultContainerMounts
{
public static readonly string Externals = "externals";
public static readonly string Work = "work";
public static readonly string Tasks = "tasks";
public static readonly string Tools = "tools";
}
public static class AsyncExecution
{
public static class Commands
{
public static class Names
{
public static readonly string DetectDockerContainer = "DetectDockerContainer";
public static readonly string GetAzureVMMetada = "GetAzureVMMetada";
public static readonly string WindowsPreinstalledGitTelemetry = "WindowsPreinstalledGitTelemetry";
}
}
}
public static class Agent
{
public static readonly TimeSpan ExitOnUnloadTimeout = TimeSpan.FromSeconds(30);
public static class CommandLine
{
//if you are adding a new arg, please make sure you update the
//validArgs array as well present in the CommandSettings.cs
public static class Args
{
public const string Agent = "agent";
public const string Auth = "auth";
public const string CollectionName = "collectionname";
public const string DeploymentGroupName = "deploymentgroupname";
public const string DeploymentPoolName = "deploymentpoolname";
public const string DeploymentGroupTags = "deploymentgrouptags";
public const string EnvironmentName = "environmentname";
public const string EnvironmentVMResourceTags = "virtualmachineresourcetags";
public const string MachineGroupName = "machinegroupname";
public const string MachineGroupTags = "machinegrouptags";
public const string MonitorSocketAddress = "monitorsocketaddress";
public const string NotificationPipeName = "notificationpipename";
public const string NotificationSocketAddress = "notificationsocketaddress";
public const string Pool = "pool";
public const string ProjectName = "projectname";
public const string ProxyUrl = "proxyurl";
public const string ProxyUserName = "proxyusername";
public const string SslCACert = "sslcacert";
public const string SslClientCert = "sslclientcert";
public const string SslClientCertKey = "sslclientcertkey";
public const string SslClientCertArchive = "sslclientcertarchive";
public const string StartupType = "startuptype";
public const string Url = "url";
public const string UserName = "username";
public const string WindowsLogonAccount = "windowslogonaccount";
public const string Work = "work";
public const string ClientId = "clientid";
public const string TenantId = "tenantid";
// Secret args. Must be added to the "Secrets" getter as well.
public const string Password = "password";
public const string ProxyPassword = "proxypassword";
public const string SslClientCertPassword = "sslclientcertpassword";
public const string Token = "token";
public const string WindowsLogonPassword = "windowslogonpassword";
public const string ClientSecret = "clientsecret";
public static string[] Secrets => new[]
{
Password,
ProxyPassword,
SslClientCertPassword,
Token,
WindowsLogonPassword,
ClientSecret,
};
}
public static class Commands
{
public const string Configure = "configure";
public const string Remove = "remove";
public const string Run = "run";
public const string Warmup = "warmup";
public const string ReAuth = "reauth";
}
//if you are adding a new flag, please make sure you update the
//validFlags array as well present in the CommandSettings.cs
public static class Flags
{
public const string AcceptTeeEula = "acceptteeeula";
public const string AddDeploymentGroupTags = "adddeploymentgrouptags";
public const string AddMachineGroupTags = "addmachinegrouptags";
public const string AddEnvironmentVirtualMachineResourceTags = "addvirtualmachineresourcetags";
public const string AlwaysExtractTask = "alwaysextracttask";
public const string Commit = "commit";
public const string DeploymentGroup = "deploymentgroup";
public const string DeploymentPool = "deploymentpool";
public const string Diagnostics = "diagnostics";
public const string Environment = "environment";
public const string OverwriteAutoLogon = "overwriteautologon";
public const string GitUseSChannel = "gituseschannel";
public const string Help = "help";
public const string DisableLogUploads = "disableloguploads";
public const string ReStreamLogsToFiles = "restreamlogstofiles";
public const string MachineGroup = "machinegroup";
public const string Replace = "replace";
public const string NoRestart = "norestart";
public const string LaunchBrowser = "launchbrowser";
public const string Once = "once";
public const string DebugMode = "debug";
public const string RunAsAutoLogon = "runasautologon";
public const string RunAsService = "runasservice";
public const string PreventServiceStart = "preventservicestart";
public const string SslSkipCertValidation = "sslskipcertvalidation";
public const string Unattended = "unattended";
public const string Version = "version";
public const string EnableServiceSidTypeUnrestricted = "enableservicesidtypeunrestricted";
}
}
public static class ReturnCode
{
public const int Success = 0;
public const int TerminatedError = 1;
public const int RetryableError = 2;
public const int AgentUpdating = 3;
public const int RunOnceAgentUpdating = 4;
}
public static class AgentConfigurationProvider
{
public static readonly string BuildReleasesAgentConfiguration = "BuildReleasesAgentConfiguration";
public static readonly string DeploymentAgentConfiguration = "DeploymentAgentConfiguration";
public static readonly string SharedDeploymentAgentConfiguration = "SharedDeploymentAgentConfiguration";
public static readonly string EnvironmentVMResourceConfiguration = "EnvironmentVMResourceConfiguration";
}
}
public static class Build
{
public static readonly string NoCICheckInComment = "***NO_CI***";
public static class Path
{
public static readonly string ArtifactsDirectory = "a";
public static readonly string BinariesDirectory = "b";
public static readonly string GarbageCollectionDirectory = "GC";
public static readonly string LegacyArtifactsDirectory = "artifacts";
public static readonly string LegacyStagingDirectory = "staging";
public static readonly string SourceRootMappingDirectory = "SourceRootMapping";
public static readonly string SourcesDirectory = "s";
public static readonly string TestResultsDirectory = "TestResults";
public static readonly string TopLevelTrackingConfigFile = "Mappings.json";
public static readonly string TrackingConfigFile = "SourceFolder.json";
}
}
public static class Configuration
{
public static readonly string AAD = "AAD";
public static readonly string PAT = "PAT";
public static readonly string Alternate = "ALT";
public static readonly string Negotiate = "Negotiate";
public static readonly string Integrated = "Integrated";
public static readonly string OAuth = "OAuth";
public static readonly string ServiceIdentity = "ServiceIdentity";
public static readonly string ServicePrincipal = "SP";
}
public static class EndpointData
{
public static readonly string SourcesDirectory = "SourcesDirectory";
public static readonly string SourceVersion = "SourceVersion";
public static readonly string SourceBranch = "SourceBranch";
public static readonly string SourceTfvcShelveset = "SourceTfvcShelveset";
public static readonly string GatedShelvesetName = "GatedShelvesetName";
public static readonly string GatedRunCI = "GatedRunCI";
}
public static class Expressions
{
public static readonly string Always = "always";
public static readonly string Canceled = "canceled";
public static readonly string Failed = "failed";
public static readonly string Succeeded = "succeeded";
public static readonly string SucceededOrFailed = "succeededOrFailed";
public static readonly string Variables = "variables";
}
public static class Path
{
public static readonly string BinDirectory = "bin";
public static readonly string DiagDirectory = "_diag";
public static readonly string ExternalsDirectory = "externals";
public static readonly string LegacyPSHostDirectory = "vstshost";
public static readonly string LegacyPSHostLegacyDirectory = "vstshost-legacy";
public static readonly string ServerOMDirectory = "vstsom";
public static readonly string ServerOMLegacyDirectory = "vstsom-legacy";
public static readonly string TempDirectory = "_temp";
public static readonly string TeeDirectory = "tee";
public static readonly string TfDirectory = "tf";
public static readonly string TfLegacyDirectory = "tf-legacy";
public static readonly string ToolDirectory = "_tool";
public static readonly string TaskJsonFile = "task.json";
public static readonly string TasksDirectory = "_tasks";
public static readonly string TaskZipsDirectory = "_taskzips";
public static readonly string UpdateDirectory = "_update";
public static readonly string WorkDirectory = "_work";
}
public static class Release
{
public static readonly string Map = "Map";
public static class Path
{
public static readonly string ArtifactsDirectory = "a";
public static readonly string CommitsDirectory = "c";
public static readonly string DefinitionMapping = "DefinitionMapping.json";
public static readonly string ReleaseDirectoryPrefix = "r";
public static readonly string ReleaseTempDirectoryPrefix = "t";
public static readonly string RootMappingDirectory = "ReleaseRootMapping";
public static readonly string TrackingConfigFile = "DefinitionMapping.json";
public static readonly string GarbageCollectionDirectory = "GC";
}
}
// Related to definition variables.
public static class Variables
{
public static readonly string MacroPrefix = "$(";
public static readonly string MacroSuffix = ")";
public static class Agent
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string AcceptTeeEula = "agent.acceptteeeula";
public static readonly string BuildDirectory = "agent.builddirectory";
public static readonly string CloudId = "agent.cloudid";
public static readonly string ContainerId = "agent.containerid";
public static readonly string ContainerMapping = "agent.containermapping";
public static readonly string ContainerNetwork = "agent.containernetwork";
public static readonly string Diagnostic = "agent.diagnostic";
public static readonly string FixPossibleGitOutOfMemoryProblem = "FIX_POSSIBLE_GIT_OUT_OF_MEMORY_PROBLEM";
public static readonly string HomeDirectory = "agent.homedirectory";
public static readonly string Id = "agent.id";
public static readonly string IsSelfHosted = "agent.isselfhosted";
public static readonly string GitUseSChannel = "agent.gituseschannel";
public static readonly string JobName = "agent.jobname";
public static readonly string JobStatus = "agent.jobstatus";
public static readonly string MachineName = "agent.machinename";
public static readonly string Name = "agent.name";
public static readonly string OS = "agent.os";
public static readonly string OSArchitecture = "agent.osarchitecture";
public static readonly string OSVersion = "agent.osversion";
public static readonly string ProxyUrl = "agent.proxyurl";
public static readonly string ProxyUsername = "agent.proxyusername";
public static readonly string ProxyPassword = "agent.proxypassword";
public static readonly string ProxyBypassList = "agent.proxybypasslist";
public static readonly string RetainDefaultEncoding = "agent.retainDefaultEncoding";
public static readonly string ReadOnlyVariables = "agent.readOnlyVariables";
public static readonly string RootDirectory = "agent.RootDirectory";
public static readonly string RunMode = "agent.runMode";
public static readonly string ServerOMDirectory = "agent.ServerOMDirectory";
public static readonly string ServicePortPrefix = "agent.services";
public static readonly string SslCAInfo = "agent.cainfo";
public static readonly string SslClientCert = "agent.clientcert";
public static readonly string SslClientCertKey = "agent.clientcertkey";
public static readonly string SslClientCertArchive = "agent.clientcertarchive";
public static readonly string SslClientCertPassword = "agent.clientcertpassword";
public static readonly string SslSkipCertValidation = "agent.skipcertvalidation";
public static readonly string TempDirectory = "agent.TempDirectory";
public static readonly string ToolsDirectory = "agent.ToolsDirectory";
public static readonly string UseGitLongPaths = "USE_GIT_LONG_PATHS";
public static readonly string UseGitSingleThread = "USE_GIT_SINGLE_THREAD";
public static readonly string Version = "agent.version";
public static readonly string WorkFolder = "agent.workfolder";
public static readonly string WorkingDirectory = "agent.WorkingDirectory";
public static readonly string EnableAdditionalMaskingRegexes = "agent.enableadditionalmaskingregexes";
}
public static class Build
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string ArtifactStagingDirectory = "build.artifactstagingdirectory";
public static readonly string BinariesDirectory = "build.binariesdirectory";
public static readonly string Clean = "build.clean";
public static readonly string DefinitionName = "build.definitionname";
public static readonly string GatedRunCI = "build.gated.runci";
public static readonly string GatedShelvesetName = "build.gated.shelvesetname";
public static readonly string Number = "build.buildNumber";
public static readonly string RepoClean = "build.repository.clean";
public static readonly string RepoGitSubmoduleCheckout = "build.repository.git.submodulecheckout";
public static readonly string RepoId = "build.repository.id";
public static readonly string RepoLocalPath = "build.repository.localpath";
public static readonly string PipelineRepoName = "pipeline.repository.name";
public static readonly string RepoName = "build.Repository.name";
public static readonly string RepoProvider = "build.repository.provider";
public static readonly string RepoTfvcWorkspace = "build.repository.tfvc.workspace";
public static readonly string RepoUri = "build.repository.uri";
public static readonly string SourceBranch = "build.sourcebranch";
public static readonly string SourceTfvcShelveset = "build.sourcetfvcshelveset";
public static readonly string SourceVersion = "build.sourceversion";
public static readonly string SourceVersionMessage = "build.sourceVersionMessage";
public static readonly string SourcesDirectory = "build.sourcesdirectory";
public static readonly string StagingDirectory = "build.stagingdirectory";
public static readonly string SyncSources = "build.syncSources";
public static readonly string UseServerWorkspaces = "build.useserverworkspaces";
}
public static class Common
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string TestResultsDirectory = "common.testresultsdirectory";
}
public static class Features
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string BuildDirectoryClean = "agent.clean.buildDirectory";
public static readonly string GitLfsSupport = "agent.source.git.lfs";
public static readonly string GitShallowDepth = "agent.source.git.shallowFetchDepth";
public static readonly string SkipSyncSource = "agent.source.skip";
public static readonly string EnableAdditionalMaskingRegexes = "agent.enableadditionalmaskingregexes";
public static readonly string UseMaskingPerformanceEnhancements = "agent.agentUseMaskingPerformanceEnhancements";
}
public static class Maintenance
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string DeleteWorkingDirectoryDaysThreshold = "maintenance.deleteworkingdirectory.daysthreshold";
public static readonly string JobTimeout = "maintenance.jobtimeoutinminutes";
}
public static class Pipeline
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string Workspace = "pipeline.workspace";
}
public static class Release
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string AgentReleaseDirectory = "agent.releaseDirectory";
public static readonly string ArtifactsDirectory = "system.artifactsDirectory";
public static readonly string AttemptNumber = "release.attemptNumber";
public static readonly string DisableRobocopy = "release.disableRobocopy";
public static readonly string ReleaseDefinitionId = "release.definitionId";
public static readonly string ReleaseDefinitionName = "release.definitionName";
public static readonly string ReleaseDescription = "release.releaseDescription";
public static readonly string ReleaseDownloadBufferSize = "release.artifact.download.buffersize";
public static readonly string ReleaseEnvironmentName = "release.environmentName";
public static readonly string ReleaseEnvironmentUri = "release.environmentUri";
public static readonly string ReleaseId = "release.releaseId";
public static readonly string ReleaseName = "release.releaseName";
public static readonly string ReleaseParallelDownloadLimit = "release.artifact.download.parallellimit";
public static readonly string ReleaseRequestedForId = "release.requestedForId";
public static readonly string ReleaseUri = "release.releaseUri";
public static readonly string ReleaseWebUrl = "release.releaseWebUrl";
public static readonly string RequestorId = "release.requestedFor";
public static readonly string RobocopyMT = "release.robocopyMT";
public static readonly string SkipArtifactsDownload = "release.skipartifactsDownload";
}
public static class System
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string AccessToken = "system.accessToken";
public static readonly string ArtifactsDirectory = "system.artifactsdirectory";
public static readonly string CollectionId = "system.collectionid";
public static readonly string Culture = "system.culture";
public static readonly string Debug = "system.debug";
public static readonly string DefaultWorkingDirectory = "system.defaultworkingdirectory";
public static readonly string DefinitionId = "system.definitionid";
public static readonly string DefinitionName = "system.definitionName";
public static readonly string EnableAccessToken = "system.enableAccessToken";
public static readonly string HostType = "system.hosttype";
public static readonly string IsAzureVM = "system.isazurevm";
public static readonly string IsDockerContainer = "system.isdockercontainer";
public static readonly string JobAttempt = "system.jobAttempt";
public static readonly string JobDisplayName = "system.jobDisplayName";
public static readonly string JobId = "system.jobId";
public static readonly string JobName = "system.jobName";
public static readonly string PhaseAttempt = "system.phaseAttempt";
public static readonly string PhaseDisplayName = "system.phaseDisplayName";
public static readonly string PhaseName = "system.phaseName";
public static readonly string PlanId = "system.planId";
public static readonly string PreferGitFromPath = "system.prefergitfrompath";
public static readonly string PullRequestTargetBranchName = "system.pullrequest.targetbranch";
public static readonly string SelfManageGitCreds = "system.selfmanagegitcreds";
public static readonly string ServerType = "system.servertype";
public static readonly string SourceVersionMessage = "system.sourceVersionMessage";
public static readonly string StageAttempt = "system.stageAttempt";
public static readonly string StageDisplayName = "system.stageDisplayName";
public static readonly string StageName = "system.stageName";
public static readonly string TFServerUrl = "system.TeamFoundationServerUri"; // back compat variable, do not document
public static readonly string TeamProject = "system.teamproject";
public static readonly string TeamProjectId = "system.teamProjectId";
public static readonly string WorkFolder = "system.workfolder";
}
public static class Task
{
//
// Keep alphabetical. If you add or remove a variable here, do the same in ReadOnlyVariables
//
public static readonly string DisplayName = "task.displayname";
/// <summary>
/// Declares requirement to skip translating of strings into checkout tasks.
/// It's required to prevent translating of agent system paths in container jobs.
/// This is for internal agent usage, set up during task execution and is not indented to be used in
/// cross-service communication/obtained by users.
/// </summary>
public static readonly string SkipTranslatorForCheckout = "task.skipTranslatorForCheckout";
/// <summary>
/// Declares requirement to publish telemetry for task or not. This is based on the IsServedOwned field in the TaskStep info
/// which the agent obtains from the execution plan (AgentJobRequestMessage) and also some certain that required for telemetry.
/// The main idea is to avoid publishing telemetry from the customer's tasks that is installed using TFS-CLI tool.
/// </summary>
public static readonly string PublishTelemetry = "task.publishTelemetry";
}
public static List<string> ReadOnlyVariables = new List<string>(){
// Agent variables
Agent.AcceptTeeEula,
Agent.BuildDirectory,
Agent.CloudId,
Agent.ContainerId,
Agent.ContainerMapping,
Agent.ContainerNetwork,
Agent.Diagnostic,
Agent.FixPossibleGitOutOfMemoryProblem,
Agent.GitUseSChannel,
Agent.HomeDirectory,
Agent.Id,
Agent.IsSelfHosted,
Agent.JobName,
Agent.JobStatus,
Agent.MachineName,
Agent.Name,
Agent.OS,
Agent.OSArchitecture,
Agent.OSVersion,
Agent.ProxyBypassList,
Agent.ProxyPassword,
Agent.ProxyUrl,
Agent.ProxyUsername,
Agent.ReadOnlyVariables,
Agent.RetainDefaultEncoding,
Agent.RootDirectory,
Agent.RunMode,
Agent.ServerOMDirectory,
Agent.ServicePortPrefix,
Agent.SslCAInfo,
Agent.SslClientCert,
Agent.SslClientCertArchive,
Agent.SslClientCertKey,
Agent.SslClientCertPassword,
Agent.SslSkipCertValidation,
Agent.TempDirectory,
Agent.ToolsDirectory,
Agent.UseGitLongPaths,
Agent.UseGitSingleThread,
Agent.Version,
Agent.WorkFolder,
Agent.WorkingDirectory,
Agent.EnableAdditionalMaskingRegexes,
// Build variables
Build.ArtifactStagingDirectory,
Build.BinariesDirectory,
Build.Clean,
Build.DefinitionName,
Build.GatedRunCI,
Build.GatedShelvesetName,
Build.Number,
Build.PipelineRepoName,
Build.RepoClean,
Build.RepoGitSubmoduleCheckout,
Build.RepoId,
Build.RepoLocalPath,
Build.RepoName,
Build.RepoProvider,
Build.RepoTfvcWorkspace,
Build.RepoUri,
Build.SourceBranch,
Build.SourceTfvcShelveset,
Build.SourceVersion,
Build.SourceVersionMessage,
Build.SourcesDirectory,
Build.StagingDirectory,
Build.SyncSources,
Build.UseServerWorkspaces,
// Common variables
Common.TestResultsDirectory,
// Feature variables
Features.BuildDirectoryClean,
Features.GitLfsSupport,
Features.GitShallowDepth,
Features.SkipSyncSource,
Features.UseMaskingPerformanceEnhancements,
// Pipeline variables
Pipeline.Workspace,
// Release variables
Release.AgentReleaseDirectory,
Release.ArtifactsDirectory,
Release.AttemptNumber,
Release.DisableRobocopy,
Release.ReleaseDefinitionId,
Release.ReleaseDefinitionName,
Release.ReleaseDescription,
Release.ReleaseDownloadBufferSize,
Release.ReleaseEnvironmentName,
Release.ReleaseEnvironmentUri,
Release.ReleaseId,
Release.ReleaseName,
Release.ReleaseParallelDownloadLimit,
Release.ReleaseRequestedForId,
Release.ReleaseUri,
Release.ReleaseWebUrl,
Release.RequestorId,
Release.RobocopyMT,
Release.SkipArtifactsDownload,
// System variables
System.AccessToken,
System.ArtifactsDirectory,
System.CollectionId,
System.Culture,
System.Debug,
System.DefaultWorkingDirectory,
System.DefinitionId,
System.DefinitionName,
System.EnableAccessToken,
System.HostType,
System.IsAzureVM,
System.IsDockerContainer,
System.JobAttempt,
System.JobDisplayName,
System.JobId,
System.JobName,
System.PhaseAttempt,
System.PhaseDisplayName,
System.PhaseName,
System.PlanId,
System.PreferGitFromPath,
System.PullRequestTargetBranchName,
System.SelfManageGitCreds,
System.ServerType,
System.SourceVersionMessage,
System.StageAttempt,
System.StageDisplayName,
System.StageName,
System.TFServerUrl,
System.TeamProject,
System.TeamProjectId,
System.WorkFolder,
// Task variables
Task.DisplayName,
Task.SkipTranslatorForCheckout,
Task.PublishTelemetry
};
}
}
}