Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Transform bug fix to compute multiple transform rules #10007

Merged
merged 7 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tasks/AzureMysqlDeploymentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 17
"Patch": 18
},
"demands": [],
"minimumAgentVersion": "1.100.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureMysqlDeploymentV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 16
"Patch": 18
},
"demands": [],
"minimumAgentVersion": "1.100.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeploymentV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 4,
"Patch": 23
"Patch": 24
},
"releaseNotes": "What's new in Version 3.0: <br/>&nbsp;&nbsp;Supports File Transformations (XDT) <br/>&nbsp;&nbsp;Supports Variable Substitutions(XML, JSON) <br/>Click [here](https://aka.ms/azurermwebdeployreadme) for more information.",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeploymentV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 4,
"Patch": 23
"Patch": 24
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeploymentV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 3,
"Patch": 22
"Patch": 23
},
"releaseNotes": "What's new in version 4.*<br />Supports Zip Deploy, Run From Package, War Deploy [Details here](https://aka.ms/appServiceDeploymentMethods)<br />Supports App Service Environments<br />Improved UI for discovering different App service types supported by the task<br/>Run From Package is the preferred deployment method, which makes files in wwwroot folder read-only<br/>Click [here](https://aka.ms/azurermwebdeployreadme) for more information.",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeploymentV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 3,
"Patch": 22
"Patch": 23
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"minimumAgentVersion": "2.104.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ export function advancedFileTransformations(isFolderBasedDeployment: boolean, ta
throw Error(tl.loc("CannotPerformXdtTransformationOnNonWindowsPlatform"));
}
else {
if(transformationRules.length > 0) {
var isTransformationApplied: boolean = true;
let isTransformationApplied: boolean = true;
if(transformationRules.length > 0) {
transformationRules.forEach(function(rule) {
var args = ParameterParser.parse(rule);
if(Object.keys(args).length < 2 || !args["transform"] || !args["xml"]) {
tl.error(tl.loc("MissingArgumentsforXMLTransformation"));
}
else if(Object.keys(args).length > 2) {
isTransformationApplied = isTransformationApplied && xdtTransformationUtility.specialXdtTransformation(folderPath, args["transform"].value, args["xml"].value, args["result"].value);
isTransformationApplied = xdtTransformationUtility.specialXdtTransformation(folderPath, args["transform"].value, args["xml"].value, args["result"].value) && isTransformationApplied;
}
else {
isTransformationApplied = isTransformationApplied && xdtTransformationUtility.specialXdtTransformation(folderPath, args["transform"].value, args["xml"].value);
isTransformationApplied = xdtTransformationUtility.specialXdtTransformation(folderPath, args["transform"].value, args["xml"].value) && isTransformationApplied;
}
});
}
Expand All @@ -75,7 +75,7 @@ export function advancedFileTransformations(isFolderBasedDeployment: boolean, ta
if(environmentName && environmentName.toLowerCase() != 'release') {
transformConfigs.push(environmentName + ".config");
}
var isTransformationApplied: boolean = xdtTransformationUtility.basicXdtTransformation(folderPath, transformConfigs);
isTransformationApplied = xdtTransformationUtility.basicXdtTransformation(folderPath, transformConfigs);
}

if(isTransformationApplied) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"loc.input.label.enableXmlTransform": "XML transformation",
"loc.input.help.enableXmlTransform": "Config transforms will be run prior to the Variable Substitution.<br/>XML transformations are supported only for Windows platform.",
"loc.input.label.xmlTransformationRules": "Transformation rules",
"loc.input.help.xmlTransformationRules": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <path to the transform file> -xml <path to the source configuration file>",
"loc.input.help.xmlTransformationRules": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile> -xml <pathToSourceConfigurationFile>",
"loc.input.label.fileType": "File format",
"loc.input.help.fileType": "Provide file format on which substitution has to be perfformed<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. Variable Substitution is run after config transforms.<br/>To substitute JSON variables that are nested or hierarchical, specify them using JSONPath expressions. <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/>&nbsp;&nbsp;\"Data\": {<br/>&nbsp;&nbsp;&nbsp;&nbsp;\"DefaultConnection\": {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"ConnectionString\": \"Server=(localdb)\\SQLEXPRESS;Database=MyDB;Trusted_Connection=True\"<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;}<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.",
"loc.input.label.targetFiles": "Target files",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/FileTransformV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"label": "Transformation rules",
"defaultValue": "-transform **\\*.Release.config -xml **\\*.config\n-transform **\\*.$(Release.EnvironmentName).config -xml **\\*.config",
"required": false,
"helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <path to the transform file> -xml <path to the source configuration file>",
"helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile> -xml <pathToSourceConfigurationFile>",
"visibleRule": "enableXmlTransform == true"
},
{
Expand Down
2 changes: 1 addition & 1 deletion Tasks/IISWebAppDeploymentOnMachineGroupV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 51
"Patch": 52
},
"demands": [],
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/IISWebAppDeploymentOnMachineGroupV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 51
"Patch": 52
},
"demands": [],
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/MysqlDeploymentOnMachineGroupV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"demands": [],
"minimumAgentVersion": "1.100.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/MysqlDeploymentOnMachineGroupV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"demands": [],
"minimumAgentVersion": "1.100.0",
Expand Down