-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Users/hiyada/war deployment #6579
Conversation
return new Promise<void>((resolve, reject) => setTimeout(resolve, timeoutInSeconds * 1000)); | ||
} | ||
|
||
async function CallDeployedWebApp(webAppName: string): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use await appServiceUtility.pingApplication();
to call the targeted app.
Reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this functuion.
@@ -1,6 +1,7 @@ | |||
import tl = require('vsts-task-lib/task'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump-up task patch version.
return new Promise<boolean>((resolve, reject) => { | ||
// Waiting for war to expand | ||
var sleep = SleepFunction(10); | ||
sleep.then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use await instead of then
var taskParams: TaskParameters = TaskParametersUtility.getParameters(); | ||
var azureEndpoint: AzureEndpoint = await new AzureRMEndpoint(taskParams.connectedServiceName).getEndpoint(); | ||
var virtualApplicationPath: string; | ||
console.log(tl.loc('GotconnectiondetailsforazureRMWebApp0', taskParams.WebAppName)); | ||
if(!taskParams.DeployToSlotFlag) { | ||
if (!taskParams.DeployToSlotFlag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Remove spacing (to maintain consistency)
taskParams.ExcludeFilesFromAppDataFlag, taskParams.TakeAppOfflineFlag, taskParams.VirtualApplication, taskParams.SetParametersFile, | ||
taskParams.AdditionalArguments, isFolderBasedDeployment, taskParams.UseWebDeploy); | ||
// this is being done temporarily, to tackle war files not getting expanded (only for the first deployment to the web app) when done using MSDeploy. | ||
if (webPackage.toString().toLowerCase().endsWith('.war')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a separate file under operationsFolder. (say MSdeployOperations.ts) and place your logic there.
@@ -1,6 +1,7 @@ | |||
import tl = require('vsts-task-lib/task'); | |||
import path = require('path'); | |||
import fs = require('fs'); | |||
import http = require('http'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this module.
async function HasWarExpandedSuccessfully(kuduService, filesBeforeDeployment, webAppName: string, packageName: string): Promise<boolean> { | ||
return new Promise<boolean>((resolve, reject) => { | ||
// Waiting for war to expand | ||
var sleep = SleepFunction(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can import the sleep function from Webclient.ts., I suppose.
sleep.then(() => { | ||
// do a get call on the target web app. | ||
var callWebApp = CallDeployedWebApp(webAppName); | ||
callWebApp.then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use await instead of then/catch.
var callWebApp = CallDeployedWebApp(webAppName); | ||
callWebApp.then(() => { | ||
var filesAfterDeployment = kuduService.listDir('/site/wwwroot/webapps/'); | ||
filesAfterDeployment.then((files) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle exceptions, wherever required.
// do a get call on the target web app. | ||
await appServiceUtility.pingApplication(); | ||
var filesAfterDeployment = await kuduService.listDir('/site/wwwroot/webapps/'); | ||
tl.debug(tl.loc("FileExistingAfterDeployment") + JSON.stringify(filesAfterDeployment)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localization not needed for debug statements.
|
||
// do a get call on the target web app. | ||
await appServiceUtility.pingApplication(); | ||
var filesAfterDeployment = await kuduService.listDir('/site/wwwroot/webapps/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle 404 case (it might return null)
|
||
// Find if directory with same name as war file, existed before deployment | ||
var directoryWithSameNameBeforeDeployment; | ||
filesBeforeDeployment.some(item => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion to initialize & iterate once. and save details of folder only.
* resolving msdeploy for war files * retrying three times for war files while calling the web app in between. * resolving comments * resolving comments * removing duplicate file * initializing variables only once insted of in retry.
* Users/hiyada/war deployment (#6579) * resolving msdeploy for war files * retrying three times for war files while calling the web app in between. * resolving comments * resolving comments * removing duplicate file * initializing variables only once insted of in retry. * bumping up patch version of AzureRmWebAppDeployment task
* resolving msdeploy for war files * retrying three times for war files while calling the web app in between. * resolving comments * resolving comments * removing duplicate file * initializing variables only once insted of in retry.
No description provided.