Skip to content

Commit 7684368

Browse files
author
himanshu yadav
authored
improving success criteria for war package deployment . (#7063) (#7066) (#7119)
1 parent 73ffd39 commit 7684368

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Tasks/AzureRmWebAppDeployment/operations/WarDeploymentUtilities.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var msDeploy = require('webdeployment-common/deployusingmsdeploy.js');
1010

1111
export async function DeployWar(webPackage, taskParams: TaskParameters, msDeployPublishingProfile, kuduService: Kudu, appServiceUtility: AzureAppServiceUtility): Promise<void> {
1212
// get list of files before deploying to the web app.
13+
await appServiceUtility.pingApplication();
1314
var listOfFilesBeforeDeployment: any = await kuduService.listDir('/site/wwwroot/webapps/');
1415
tl.debug("Listing file structure of webapps folder before deployment starts => " + JSON.stringify(listOfFilesBeforeDeployment));
1516

@@ -64,6 +65,6 @@ export async function HasWarExpandedSuccessfully(kuduService: Kudu, directoryWit
6465

6566
// Verify if the content of that war file has successfully expanded. This is can be concluded if
6667
// directory with same name as war file exists after deployment and if it existed before deployment, then the directory should contain content of new war file
67-
// which can be concluded if the modified time of the directory has changed.
68-
return filesAfterDeployment.some(item => { return item.name == warFileName && item.mime == "inode/directory" && (!directoryWithSameNameBeforeDeployment || item.mtime != directoryWithSameNameBeforeDeployment.mtime) });
68+
// which can be concluded if the modified time of the directory has changed. We have however observerd some minor milliseconds change in the modified time even when deployment is not successfull, only for the first time. Hence we are introducing a check that the time change should be more than 0.5 second or 500 milliseconds.
69+
return filesAfterDeployment.some(item => { return item.name == warFileName && item.mime == "inode/directory" && (!directoryWithSameNameBeforeDeployment || (item.mtime != directoryWithSameNameBeforeDeployment.mtime && (new Date(item.mtime).getTime() - new Date(directoryWithSameNameBeforeDeployment.mtime).getTime() > 500))) });
6970
}

Tasks/AzureRmWebAppDeployment/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 3,
1818
"Minor": 3,
19-
"Patch": 46
19+
"Patch": 47
2020
},
2121
"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.",
2222
"minimumAgentVersion": "2.104.1",

Tasks/AzureRmWebAppDeployment/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 3,
1818
"Minor": 3,
19-
"Patch": 46
19+
"Patch": 47
2020
},
2121
"releaseNotes": "ms-resource:loc.releaseNotes",
2222
"minimumAgentVersion": "2.104.1",

0 commit comments

Comments
 (0)