Skip to content
Open
Changes from all 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
22 changes: 22 additions & 0 deletions Kudu.Services/Deployment/PushDeploymentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ public async Task<IActionResult> OneDeploy(
break;

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

Expand Down Expand Up @@ -873,5 +874,26 @@ private ObjectResult StatusCode400(string message)
{
return StatusCode(StatusCodes.Status400BadRequest, message);
}

private void SetRunFromZipDeploymentInfo(ArtifactDeploymentInfo deploymentInfo)
{
if (deploymentInfo == null
|| _settings == null)
{
return;
}

if (_settings.RunFromLocalZip())
{
// This is used if the deployment is Run-From-Zip
// the name of the deployed file in D:\home\data\SitePackages\{name}.zip is the
// timestamp in the format yyyMMddHHmmss.
deploymentInfo.ArtifactFileName = $"{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.zip";

// This is also for Run-From-Zip where we need to extract the triggers
// for post deployment sync triggers.
deploymentInfo.SyncFunctionsTriggersPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
}
}
}
}