コード例 #1
0
        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);
        }
コード例 #2
0
        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
ファイル: WebDeployTasks.cs プロジェクト: hbre/Nuke.WebDeploy
 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);
 }