Exemple #1
0
        public static void Configure(CommandLineApplication app)
        {
            app.Command("upgrade", application =>
            {
                _appOptions            = new AppOptionsRaw(application);
                _upgradeCommandOptions = new UpgradeCommandOptionsRaw(application);

                application.OnExecute(async() =>
                {
                    var appConfig     = AppOptions.ValidateAndCreate(_appOptions);
                    var commandConfig = UpgradeCommandOptions.VerifyAndCreateArgs(_upgradeCommandOptions);
                    var command       = new UpgradeCommand();
                    return(await command.RunAsync(appConfig, commandConfig).ConfigureAwait(false));
                });
            });
        }
Exemple #2
0
        internal UpgradeCommandOptions(UpgradeCommandOptionsRaw rawConfig)
        {
            if (!rawConfig.ApplicationName.HasValue())
                throw new ArgumentException("No Application Name specified");
            if (!rawConfig.TargetVersion.HasValue())
                throw new ArgumentException("No Target Version specified");

            ApplicationName = rawConfig.ApplicationName.Value();
            TargetVersion = rawConfig.TargetVersion.Value();
            RollingUpgradeMode = OptionsHelper.GetEnumValueOrDefault(rawConfig.RollingUpgradeMode,
                Constants.RollingUpgradeMode.Monitored);
            ForceRestart = rawConfig.ForceRestart.HasValue();
            FailureAction = OptionsHelper.GetEnumValueOrDefault(rawConfig.FailureAction,
                Constants.FailureAction.Rollback);
            HealthCheckWaitDuration = OptionsHelper.GetIntOrDefaultValue(rawConfig.HealthCheckWaitDuration, 60);
            HealthCheckStableDuration = OptionsHelper.GetIntOrDefaultValue(rawConfig.HealthCheckStableDuration, 60);
            HealthCheckRetryTimeout = OptionsHelper.GetIntOrDefaultValue(rawConfig.HealthCheckRetryTimeout, 60);
        }
Exemple #3
0
 public static UpgradeCommandOptions VerifyAndCreateArgs(UpgradeCommandOptionsRaw rawConfig)
 {
     return new UpgradeCommandOptions(rawConfig);
 }