public override Command Create() { Command command = new Command("environment") { _idOption, _devEnvironmentOption, }; command.Description = CLITextResources.EnvironmentCommandDescription; command.Handler = CommandHandler .Create <string, bool>((id, dev) => { _consoleProcessMessages.StartProcessMessage("environment", id); ProjectConfigItem existProjectConfig = _projectConfigsAPI.GetProjectConfigById(id); if (existProjectConfig == null) { _consoleProcessMessages.SetErrorInstruction(CLITextResources.IdNotExistCommandError.Replace("[Id]", id), NotificationErrorType.Error); } else { existProjectConfig.DevEnvironment = dev; _consoleProcessMessages.StartSpiiner(); ProcessResults processResults = _projectConfigsAPI.UpdateProjectConfig(existProjectConfig, _consoleProcessMessages.OnNotificationStateChanged); _consoleProcessMessages.StopSpinner(); _consoleProcessMessages.ProcessComplete(processResults); } }); return(command); }
public static ProcessResults UpdateProjectConfig(ProjectConfigItem projectConfig, Action <ProcessTrace, StepNotificationState> onNotificationStateChanged) { lock (_processSyncLock) { return(_projectConfigsAPI.UpdateProjectConfig(projectConfig, onNotificationStateChanged)); } }
public override Command Create() { Command command = new Command("config") { _idOption, _descriptionOption, _dbTypeOption, _serverInstanceOption, _dataBaseNameOption, _dbUsernameOption, _dbPasswordOption, _backupFolderPathOption, _scriptsBaseFolderPathOption, _deployArtifactFolderPathOption, _deliveryArtifactFolderPathOption, }; command.Description = CLITextResources.ConfigCommandDescription; command.Handler = CommandHandler .Create((ProjectConfigItem projectConfig) => { _consoleProcessMessages.StartProcessMessage("config", projectConfig.Id); ProjectConfigItem existProjectConfig = _projectConfigsAPI.GetProjectConfigById(projectConfig.Id); if (existProjectConfig == null) { _consoleProcessMessages.SetErrorInstruction(CLITextResources.IdNotExistCommandError.Replace("[Id]", projectConfig.Id), NotificationErrorType.Error); } else { OverrideProjectConfigProperties(existProjectConfig, projectConfig); _consoleProcessMessages.StartSpiiner(); ProcessResults processResults = _projectConfigsAPI.UpdateProjectConfig(existProjectConfig, _consoleProcessMessages.OnNotificationStateChanged); _consoleProcessMessages.StopSpinner(); _consoleProcessMessages.ProcessComplete(processResults); } }); Command changeIdCommand = _changeIdCommandFactory.Create(); command.Add(changeIdCommand); Command environmentCommand = _environmentCommandFactory.Create(); command.Add(environmentCommand); return(command); }