public void Run(string deployStateId, IDeployTaskStatusManager statusManager, List<IDeployTaskDefinition> taskDefinitionList, DeployComponent component, DeployEnvironmentConfiguration environmentComponent, DeployMachine machine, DeployBuild build, RuntimeSystemSettings runtimeSystemSettings) { int stepCounter = 0; foreach(var taskDefinition in taskDefinitionList) { stepCounter++; statusManager.Info(deployStateId, string.Format("Step {0}: Starting {1}", stepCounter, taskDefinition.TaskDefintionName)); DeployTaskExecutionResult result; //using (var impersontator = BeginImpersonation(deployStateId, statusManager, environmentComponent)) //{ var executor = _deployTaskFactory.CreateTaskExecutor(taskDefinition.GetTaskExecutorType()); result = executor.Execute(deployStateId, statusManager, taskDefinition, component, environmentComponent, machine, build, runtimeSystemSettings); //} switch(result.Status) { case EnumDeployTaskExecutionResultStatus.Success: statusManager.Info(deployStateId, string.Format("Step {0}: End {1}, completed successfully", stepCounter, taskDefinition.TaskDefintionName)); break; case EnumDeployTaskExecutionResultStatus.Error: statusManager.Info(deployStateId, string.Format("Step {0}: End {1}, failed", stepCounter, taskDefinition.TaskDefintionName)); return; //error error eject! //break; case EnumDeployTaskExecutionResultStatus.Warning: statusManager.Info(deployStateId, string.Format("Step {0}: End {1}, completed with warnings", stepCounter, taskDefinition.TaskDefintionName)); break; default: throw new UnknownEnumValueException(result.Status); } } }
public string EvaluateDeployParameter(string parameterName, RuntimeSystemSettings runtimeSettings, DeployMachine machine, DeployComponent component) { if (string.IsNullOrEmpty(parameterName)) { throw new ArgumentNullException("Missing parameterName"); } if (runtimeSettings == null) { throw new ArgumentNullException("Missing runtimeSettings"); } switch (parameterName.ToLower()) { case "directory": return runtimeSettings.GetLocalMachineComponentDirectory(machine.MachineName, component.Id); default: throw new ArgumentException(string.Format("Unrecognized deploy parameter \"{0}\"", parameterName)); } }
public static SqlDeployMachine FromDto(DeployMachine item) { var returnValue = AutoMapper.Mapper.Map(item, new SqlDeployMachine()); if(item.ConfigurationValueList != null) { returnValue.ConfigurationValueListJson = item.ConfigurationValueList.ToJson(); } return returnValue; }
public TaskDefinitionValidationResult ValidateMachineTaskDefinition(IDeployTaskDefinition taskDefinition, DeployEnvironmentConfiguration environmentComponent, DeployMachine machine) { var result = new TaskDefinitionValidationResult(); //Verify Static Values var environmentParmeters = taskDefinition.GetEnvironmentTaskParameterList(); foreach (var p in environmentParmeters) { var item = this.GetValidationResultItem(p, environmentComponent.ConfigurationValueList); result.EnvironmentResultList.Add(item); } var machineParameters = taskDefinition.GetMachineTaskParameterList(); var machineResultList = new List<TaskDefinitionValidationResult.TaskDefinitionValidationResultItem>(); foreach (var p in machineParameters) { var item = this.GetValidationResultItem(p, machine.ConfigurationValueList); machineResultList.Add(item); } result.MachineResultList.Add(machine.Id, machineResultList); result.BuildParameterList.AddRange(taskDefinition.GetBuildTaskParameterList()); result.DeployParameterList.AddRange(taskDefinition.GetDeployTaskParameterList()); return result; }