-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathtask.json
120 lines (120 loc) · 8.34 KB
/
task.json
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
{
"id": "8ce97e91-56cc-4743-bfab-9a9315be5f27",
"name": "FileTransform",
"friendlyName": "File transform",
"description": "Replace tokens with variable values in XML or JSON configuration files",
"author": "Microsoft Corporation",
"helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/file-transform",
"helpMarkDown": "File transformation and variable substitution task: Update tokens in your XML based configuration files and then replaces those tokens with variable values. <br/>Currently only XML, JSON file formats are supported for variable substitution. </br> [Learn more about this task](https://aka.ms/AA5xp1v)",
"category": "Utility",
"visibility": [
"Build",
"Release"
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"version": {
"Major": 2,
"Minor": 249,
"Patch": 0
},
"releaseNotes": "More optimized task fields that allow users to enable any/all of the transformation (XML), variable substitution (JSON and XML) features in a single task instance.</br>Task fails when any of the configured transformation/substitution is NOT applied or when the task is no-op.",
"instanceNameFormat": "File Transform: $(Package)",
"groups": [
{
"name": "VariableSubstitution",
"displayName": "Variable Substitution",
"isExpanded": true
}
],
"inputs": [
{
"name": "folderPath",
"type": "filePath",
"label": "Package or folder",
"defaultValue": "$(System.DefaultWorkingDirectory)/**/*.zip",
"required": true,
"helpMarkDown": "File path to the package or a folder.<br />Variables ( [Build](https://docs.microsoft.com/vsts/pipelines/build/variables) | [Release](https://docs.microsoft.com/vsts/pipelines/release/variables#default-variables)), wildcards are supported. <br/> For example, $(System.DefaultWorkingDirectory)/\\*\\*/\\*.zip."
},
{
"name": "enableXmlTransform",
"type": "boolean",
"label": "XML transformation",
"required": false,
"defaultValue": true,
"helpMarkDown": "Config transforms will be run prior to the Variable Substitution.<br/>XML transformations are supported only for Windows platform."
},
{
"name": "xmlTransformationRules",
"type": "multiLine",
"label": "XML Transformation rules",
"defaultValue": "-transform **\\*.Release.config -xml **\\*.config",
"required": false,
"helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile> -xml <pathToSourceConfigurationFile>",
"visibleRule": "enableXmlTransform == true"
},
{
"name": "jsonTargetFiles",
"type": "multiLine",
"label": "JSON target files",
"required": false,
"defaultValue": "",
"groupName": "VariableSubstitution",
"helpMarkDown": "Provide new line separated list of files to substitute the variable values. Files names are to be provided relative to the root folder. <br/> <br/> For example, to replace the value of ‘ConnectionString’ in the sample below, you need to define a variable as ‘Data.DefaultConnection.ConnectionString’ in the build or release pipeline (or release pipeline's environment). <br/> {<br/> \"Data\": {<br/> \"DefaultConnection\": {<br/> \"ConnectionString\": \"Server=(localdb)\\SQLEXPRESS;Database=MyDB;Trusted_Connection=True\"<br/> }<br/> }<br/> } <br/> Variable Substitution is run after configuration transforms. </br> </br> Note: Only custom variables defined in build/release pipelines are used in substitution. Default/system defined pipeline variables are excluded. <br/>Note: If same variables are defined in the release pipeline and in the stage, then the stage variables will supersede the release pipeline variables. "
},
{
"name": "xmlTargetFiles",
"type": "multiLine",
"label": "XML target files",
"required": false,
"defaultValue": "",
"groupName": "VariableSubstitution",
"helpMarkDown": "Provide new line separated list of files to substitute the variable values. Files names are to be provided relative to the root folder. <br/>For XML, Variables defined in the build or release pipelines will be matched against the 'key' or 'name' entries in the appSettings, applicationSettings, and connectionStrings sections of any config file and parameters.xml. <br/> Variable Substitution is run after configuration transforms. </br> Note: Only custom variables defined in build/release pipelines are used in substitution. Default/system defined pipeline variables are excluded. <br/>Note: If same variables are defined in the release pipeline and in the stage, then the stage variables will supersede the release pipeline variables."
}
],
"execution": {
"Node10": {
"target": "filetransform.js",
"argumentFormat": ""
},
"Node16": {
"target": "filetransform.js",
"argumentFormat": ""
}
},
"messages": {
"JSONvariablesubstitutionappliedsuccessfully": "JSON variable substitution applied successfully.",
"FailedToApplyJSONvariablesubstitution": "Failed to apply JSON variable substitution.",
"FailedToApplyJSONvariablesubstitutionReason1": "Failed to apply JSON variable substitution. Changes are already present in the package.",
"XMLvariablesubstitutionappliedsuccessfully": "XML variable substitution applied successfully.",
"FailedToApplyXMLvariablesubstitution": "Failed to apply XML variable substitution.",
"FailedToApplyXMLvariablesubstitutionReason1": "Failed to apply XML variable substitution. Changes are already present in the package.",
"XDTTransformationsappliedsuccessfully": "XML Transformations applied successfully",
"CannotPerformXdtTransformationOnNonWindowsPlatform": "Cannot perform XML transformations on a non-Windows platform.",
"XdtTransformationErrorWhileTransforming": "XML transformation error while transforming %s using %s.",
"JSONParseError": "Unable to parse JSON file: %s. Error: %s",
"NOJSONfilematchedwithspecificpattern": "NO JSON file matched with specific pattern: %s.",
"FailedToApplySpecialTransformation": "Unable to apply transformation for the given package.",
"FailedToApplySpecialTransformationReason1": "Unable to apply transformation for the given package. Changes are already present in the package.",
"FailedToApplyTransformation": "Unable to apply transformation for the given package. Verify the following.",
"MissingArgumentsforXMLTransformation": "Incomplete or missing arguments. Expected format -transform <transform file> -xml <source file> -result <destinamtion file>. Transformation and source file are mandatory inputs.",
"SubstitutingValueonKey": "Substituting value on key: %s",
"SubstitutingValueonKeyWithNumber": "Substituting value on key %s with (number) value: %s",
"SubstitutingValueonKeyWithBoolean": "Substituting value on key %s with (boolean) value: %s",
"SubstitutingValueonKeyWithObject": "Substituting value on key %s with (object) value: %s",
"SubstitutingValueonKeyWithString": "Substituting value on key %s with (string) value: %s",
"JSONvariableSubstitution": "Applying JSON variable substitution for %s",
"ApplyingXDTtransformation": "Applying XDT Transformation from transformation file %s -> source file %s ",
"SubstitutionForXmlNode": "Processing substitution for xml node : %s",
"UpdatingKeyWithTokenValue": "Updating value for key= %s with token value: %s",
"SubstitutingConnectionStringValue": "Substituting connectionString value for connectionString = %s with token value: %s ",
"VariableSubstitutionInitiated": "Initiated variable substitution in config file : %s",
"ConfigFileUpdated": "Config file : %s updated.",
"SkippedUpdatingFile": "Skipped Updating file: %s",
"FailedToApplyTransformationReason1": "1. Whether the Transformation is already applied for the MSBuild generated package during build. If yes, remove the <DependentUpon> tag for each config in the csproj file and rebuild. ",
"FailedToApplyTransformationReason2": "2. Ensure that the config file and transformation files are present in the same folder inside the package.",
"FileTranformationNotEnabled": "File Tranformation is not enabled. Please provide one of the following : XML Tranformation rules or JSON/XML target files for variable substitution."
}
}