public override bool Execute() { if (String.IsNullOrEmpty(PublishIntermediateOutputPath)) { Log.LogError(Resources.KUDUDEPLOY_DeployOutputPathEmpty); return(false); } KuduConnectionInfo connectionInfo = GetConnectionInfo(); if (String.IsNullOrEmpty(connectionInfo.UserName) || String.IsNullOrEmpty(connectionInfo.Password) || String.IsNullOrEmpty(connectionInfo.DestinationUrl)) { Log.LogError(Resources.KUDUDEPLOY_ConnectionInfoMissing); return(false); } bool publishStatus = DeployFiles(connectionInfo); if (publishStatus) { Log.LogMessage(Microsoft.Build.Framework.MessageImportance.High, Resources.KUDUDEPLOY_PublishSucceeded); } else { Log.LogError(Resources.KUDUDEPLOY_PublishFailed); } return(publishStatus); }
internal bool DeployZipFile(KuduConnectionInfo connectionInfo) { bool success; KuduZipDeploy zipDeploy = new KuduZipDeploy(connectionInfo, Log); string zipFileFullPath = CreateZipFile(PublishIntermediateOutputPath); Task <bool> zipTask = zipDeploy.DeployAsync(zipFileFullPath); try { success = zipTask.Wait(TimeoutMilliseconds); if (!success) { Log.LogError(String.Format(Resources.KUDUDEPLOY_AzurePublishErrorReason, Resources.KUDUDEPLOY_OperationTimeout)); } } catch (AggregateException ae) { Log.LogError(String.Format(Resources.KUDUDEPLOY_AzurePublishErrorReason, ae.Flatten().Message)); success = false; } // Clean up the resources. DeleteTempZipFile(zipFileFullPath); return(success && zipTask.Result); }
internal bool DeployFiles(KuduConnectionInfo connectionInfo) { KuduVfsDeploy fileDeploy = new KuduVfsDeploy(connectionInfo, Log); bool success; if (!DeployIndividualFiles) { success = DeployZipFile(connectionInfo); return(success); } // Deploy the files. Task deployTask = fileDeploy.DeployAsync(PublishIntermediateOutputPath); try { success = deployTask.Wait(TimeoutMilliseconds); if (!success) { Log.LogError(String.Format(Resources.KUDUDEPLOY_AzurePublishErrorReason, Resources.KUDUDEPLOY_OperationTimeout)); } } catch (AggregateException ae) { Log.LogError(String.Format(Resources.KUDUDEPLOY_AzurePublishErrorReason, ae.Flatten().Message)); success = false; } return(success); }
internal KuduConnectionInfo GetConnectionInfo() { KuduConnectionInfo connectionInfo = new KuduConnectionInfo(); connectionInfo.DestinationUrl = PublishUrl; connectionInfo.UserName = UserName; connectionInfo.Password = Password; connectionInfo.SiteName = PublishSiteName; return(connectionInfo); }
public KuduVfsDeploy(KuduConnectionInfo connectionInfo, TaskLoggingHelper logger) : base(connectionInfo, logger) { _logger = logger; _postTasks = new List <System.Threading.Tasks.Task>(); }
internal KuduConnect(KuduConnectionInfo connectionInfo, TaskLoggingHelper logger) { _connectionInfo = connectionInfo; }
public KuduZipDeploy(KuduConnectionInfo connectionInfo, TaskLoggingHelper logger) : base(connectionInfo, logger) { _logger = logger; }