public static DeploymentBaseOptions GetDestinationOptions(WebDeploySettings settings)
        {
            var options = new DeploymentBaseOptions();

            options.AuthenticationType = "basic";
            options.ComputerName       = settings.PublishUrl;
            options.UserName           = settings.Username;
            options.Password           = settings.Password;
            options.RetryAttempts      = settings.RetryAttempts ?? default;
            options.RetryInterval      = settings.RetryInterval ?? default;
            return(options);
        }
        public static DeploymentSyncOptions GetSyncOptions(WebDeploySettings settings)
        {
            var options = new DeploymentSyncOptions();

            options.DoNotDelete = settings.EnableDoNotDeleteRule ?? false;
            options.WhatIf      = settings.ShowWhatIf ?? false;
            if (settings.EnableAppOfflineRule ?? false)
            {
                var appOfflineRule = GetRuleByName("AppOffline");
                options.Rules.Add(appOfflineRule);
            }

            // TODO MORE RULES
            return(options);
        }
示例#3
0
 private static void AppendCustomParameters(WebDeploySettings settings, DeploymentObject deploymentObject)
 {
     if (settings.Parameters != null)
     {
         foreach (var kv in settings.Parameters)
         {
             if (deploymentObject.SyncParameters.Contains(kv.Key))
             {
                 deploymentObject.SyncParameters[kv.Key].Value = kv.Value;
             }
             else
             {
                 deploymentObject.SyncParameters.Add(new DeploymentSyncParameter(kv.Key, kv.Key, "", "")
                 {
                     Value = kv.Value
                 });
             }
         }
     }
 }
示例#4
0
 public static WebDeploySettings ResetWrapAppOffline(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.WrapAppOffline = null;
     return(toolSettings);
 }
示例#5
0
 public static WebDeploySettings DisableWrapAppOffline(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.WrapAppOffline = false;
     return(toolSettings);
 }
示例#6
0
 public static WebDeploySettings ToggleEnableAppOfflineRule(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.EnableAppOfflineRule = !toolSettings.EnableAppOfflineRule;
     return(toolSettings);
 }
示例#7
0
 public static WebDeploySettings ResetShowWhatIf(this WebDeploySettings toolSettings)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.ShowWhatIf = null;
     return(toolSettings);
 }
示例#8
0
 public static WebDeploySettings ClearParameters(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ParametersInternal.Clear();
     return(toolSettings);
 }
示例#9
0
 public static WebDeploySettings RemoveParameter(this WebDeploySettings toolSettings, string parameterKey)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ParametersInternal.Remove(parameterKey);
     return(toolSettings);
 }
示例#10
0
 public static WebDeploySettings ResetSourcePath(this WebDeploySettings toolSettings)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.SourcePath = null;
     return(toolSettings);
 }
示例#11
0
 public static WebDeploySettings ResetAppOfflineHtmlTemplate(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.AppOfflineHtmlTemplate = null;
     return(toolSettings);
 }
示例#12
0
 public static WebDeploySettings ResetSiteName(this WebDeploySettings toolSettings)
 {
     toolSettings          = toolSettings.NewInstance();
     toolSettings.SiteName = null;
     return(toolSettings);
 }
示例#13
0
 public static WebDeploySettings SetSourcePath(this WebDeploySettings toolSettings, string sourcePath)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.SourcePath = sourcePath;
     return(toolSettings);
 }
示例#14
0
 public static WebDeploySettings SetSiteName(this WebDeploySettings toolSettings, string siteName)
 {
     toolSettings          = toolSettings.NewInstance();
     toolSettings.SiteName = siteName;
     return(toolSettings);
 }
示例#15
0
 public static WebDeploySettings ToggleShowWhatIf(this WebDeploySettings toolSettings)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.ShowWhatIf = !toolSettings.ShowWhatIf;
     return(toolSettings);
 }
示例#16
0
 public static WebDeploySettings DisableShowWhatIf(this WebDeploySettings toolSettings)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.ShowWhatIf = false;
     return(toolSettings);
 }
示例#17
0
 public static WebDeploySettings ToggleWrapAppOffline(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.WrapAppOffline = !toolSettings.WrapAppOffline;
     return(toolSettings);
 }
示例#18
0
 public static WebDeploySettings SetRetryAttempts(this WebDeploySettings toolSettings, int?retryAttempts)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RetryAttempts = retryAttempts;
     return(toolSettings);
 }
示例#19
0
 public static WebDeploySettings SetAppOfflineHtmlTemplate(this WebDeploySettings toolSettings, string appOfflineHtmlTemplate)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.AppOfflineHtmlTemplate = appOfflineHtmlTemplate;
     return(toolSettings);
 }
示例#20
0
 public static WebDeploySettings ResetRetryAttempts(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RetryAttempts = null;
     return(toolSettings);
 }
示例#21
0
 public static WebDeploySettings SetParameters(this WebDeploySettings toolSettings, IDictionary <string, string> parameters)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ParametersInternal = parameters.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase);
     return(toolSettings);
 }
示例#22
0
 public static WebDeploySettings SetRetryInterval(this WebDeploySettings toolSettings, int?retryInterval)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RetryInterval = retryInterval;
     return(toolSettings);
 }
示例#23
0
 public static WebDeploySettings AddParameter(this WebDeploySettings toolSettings, string parameterKey, string parameterValue)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ParametersInternal.Add(parameterKey, parameterValue);
     return(toolSettings);
 }
示例#24
0
 public AppOfflineWrapper(WebDeploySettings settings)
 {
     _settings = settings;
     CreateAppOffline();
 }
示例#25
0
 public static WebDeploySettings SetParameter(this WebDeploySettings toolSettings, string parameterKey, string parameterValue)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ParametersInternal[parameterKey] = parameterValue;
     return(toolSettings);
 }
示例#26
0
 public static WebDeploySettings ResetEnableAppOfflineRule(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.EnableAppOfflineRule = null;
     return(toolSettings);
 }
示例#27
0
 public static WebDeploySettings ResetRetryInterval(this WebDeploySettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RetryInterval = null;
     return(toolSettings);
 }
示例#28
0
 public static WebDeploySettings SetShowWhatIf(this WebDeploySettings toolSettings, bool?showWhatIf)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.ShowWhatIf = showWhatIf;
     return(toolSettings);
 }
示例#29
0
 public static WebDeploySettings SetWrapAppOffline(this WebDeploySettings toolSettings, bool?wrapAppOffline)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.WrapAppOffline = wrapAppOffline;
     return(toolSettings);
 }
示例#30
0
 public static WebDeploySettings SetEnableAppOfflineRule(this WebDeploySettings toolSettings, bool?enableAppOfflineRule)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.EnableAppOfflineRule = enableAppOfflineRule;
     return(toolSettings);
 }