Changing ZIP Deploy Publish to use the PublishUrl property instead of ScmSiteUrl
This commit is contained in:
Родитель
e9d61a0754
Коммит
02a50562b7
|
@ -43,7 +43,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
|
|||
ZipToPublishPath="$(ZippedPublishContentsPath)"
|
||||
DeploymentUsername="$(UserName)"
|
||||
DeploymentPassword="$(Password)"
|
||||
ScmSiteUrl="$(ScmSiteUrl)" />
|
||||
PublishUrl="$(PublishUrl)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
|
@ -21,31 +21,31 @@ namespace Microsoft.NET.Sdk.Functions.Tasks
|
|||
public string DeploymentPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ScmSiteUrl { get; set; }
|
||||
public string PublishUrl { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
using(DefaultHttpClient client = new DefaultHttpClient())
|
||||
{
|
||||
System.Threading.Tasks.Task<bool> t = ZipDeployAsync(ZipToPublishPath, DeploymentUsername, DeploymentPassword, ScmSiteUrl, client);
|
||||
System.Threading.Tasks.Task<bool> t = ZipDeployAsync(ZipToPublishPath, DeploymentUsername, DeploymentPassword, PublishUrl, client);
|
||||
t.Wait();
|
||||
return t.Result;
|
||||
}
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task<bool> ZipDeployAsync(string zipToPublishPath, string userName, string password, string scmSiteUrl, IHttpClient client)
|
||||
private async System.Threading.Tasks.Task<bool> ZipDeployAsync(string zipToPublishPath, string userName, string password, string publishUrl, IHttpClient client)
|
||||
{
|
||||
if (!File.Exists(ZipToPublishPath) || client == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!scmSiteUrl.EndsWith("/"))
|
||||
if (!publishUrl.EndsWith("/"))
|
||||
{
|
||||
scmSiteUrl += "/";
|
||||
publishUrl += "/";
|
||||
}
|
||||
|
||||
string zipDeployPublishUrl = scmSiteUrl + "api/zipdeploy";
|
||||
string zipDeployPublishUrl = publishUrl + "api/zipdeploy";
|
||||
|
||||
Log.LogMessage(MessageImportance.High, String.Format(Resources.PublishingZipViaZipDeploy, zipToPublishPath, zipDeployPublishUrl));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче