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

adding run from zip deployment info for onedeploy #220

Open
wants to merge 1 commit into
base: feature/k8se
Choose a base branch
from
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());
}
}
}
}