Skip to content

Commit

Permalink
Update defaults for clean
Browse files Browse the repository at this point in the history
  • Loading branch information
shrishrirang committed Sep 8, 2020
1 parent 4ddc443 commit 168ee47
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Kudu.Services/Deployment/PushDeploymentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public async Task<IActionResult> OneDeploy(
DoFullBuildByDefault = false,
Message = Constants.OneDeploy,
WatchedFileEnabled = false,
CleanupTargetDirectory = clean.GetValueOrDefault(false),
RestartAllowed = restart.GetValueOrDefault(true),
};

Expand All @@ -320,6 +321,9 @@ public async Task<IActionResult> OneDeploy(

deploymentInfo.TargetRootPath = Path.Combine(_environment.WebRootPath, path);
deploymentInfo.Fetch = LocalZipHandler;

// Legacy war deployment is equivalent to wardeploy
// So always do clean deploy.
deploymentInfo.CleanupTargetDirectory = true;
artifactType = ArtifactType.Zip;
}
Expand Down Expand Up @@ -357,13 +361,11 @@ public async Task<IActionResult> OneDeploy(

deploymentInfo.TargetRootPath = OneDeployHelper.GetLibsDirectoryAbsolutePath(_environment);
OneDeployHelper.SetTargetSubDirectoyAndFileNameFromPath(deploymentInfo, path);
deploymentInfo.CleanupTargetDirectory = clean.GetValueOrDefault(false);
break;

case ArtifactType.Startup:
deploymentInfo.TargetRootPath = OneDeployHelper.GetScriptsDirectoryAbsolutePath(_environment);
OneDeployHelper.SetTargetSubDirectoyAndFileNameFromPath(deploymentInfo, OneDeployHelper.GetStartupFileName());
deploymentInfo.CleanupTargetDirectory = clean.GetValueOrDefault(false);
break;

case ArtifactType.Script:
Expand All @@ -374,7 +376,6 @@ public async Task<IActionResult> OneDeploy(

deploymentInfo.TargetRootPath = OneDeployHelper.GetScriptsDirectoryAbsolutePath(_environment);
OneDeployHelper.SetTargetSubDirectoyAndFileNameFromPath(deploymentInfo, path);
deploymentInfo.CleanupTargetDirectory = clean.GetValueOrDefault(false);

break;

Expand All @@ -385,13 +386,14 @@ public async Task<IActionResult> OneDeploy(
}

OneDeployHelper.SetTargetSubDirectoyAndFileNameFromPath(deploymentInfo, path);
deploymentInfo.CleanupTargetDirectory = clean.GetValueOrDefault(false);

break;

case ArtifactType.Zip:
deploymentInfo.Fetch = LocalZipHandler;
deploymentInfo.TargetSubDirectoryRelativePath = path;

// Deployments for type=zip default to clean=true
deploymentInfo.CleanupTargetDirectory = clean.GetValueOrDefault(true);

break;
Expand Down

0 comments on commit 168ee47

Please sign in to comment.