public override DeployActionUnitResponse ExecuteDeploy( ProjectState projectState, ActionExecution sourceActionExecution, List <DeployActionUnit> currentExecutionDeployActions) { try { var createrepositoryFolderStructureDependency = GetDependencyFromSameSource <CreateDomainRepositoryFolderStructure> (sourceActionExecution, currentExecutionDeployActions); var pathParameter = DeployResponseParametersDefinitions.MicroServices.CreateRepositoryFolderStructure.Source; var sourcePath = createrepositoryFolderStructureDependency.ResponseParameters[pathParameter] as string; var settingDotnet = GetSetting(projectState, Definitions.SettingsDefinitions.DotNetExePath); DotnetService.Initialize(settingDotnet); var projectName = $"{projectState.NameSpace}.{projectState.Name}.Domain"; var solutionFileName = GetSolutionFileName(projectName); var solutionFilePath = FileService.ConcatDirectoryAndFileOrFolder(sourcePath, solutionFileName); var existsSolution = FileService.ExistsFile(solutionFilePath); if (!existsSolution) { DotnetService.CreateSolutionFile(sourcePath, solutionFileName); } return(new DeployActionUnitResponse() .Ok(GetParameters(sourcePath, solutionFileName, solutionFilePath))); } catch (Exception ex) { return(new DeployActionUnitResponse() .Error(ex)); } }
public override DeployActionUnitResponse ExecuteCheck( ProjectState projectState, ActionExecution sourceActionExecution, List <DeployActionUnit> currentExecutionDeployActions) { try { var createrepositoryFolderStructureDependency = GetDependencyFromSameSource <CreateRepositoryFolderStructure> (sourceActionExecution, currentExecutionDeployActions); var pathParameter = DeployResponseParametersDefinitions.MicroServices.CreateRepositoryFolderStructure.Source; var sourcePath = createrepositoryFolderStructureDependency.ResponseParameters[pathParameter] as string; var githubDependency = GetDependencyFromSameSource <CreateGithubRepository> (sourceActionExecution, currentExecutionDeployActions); var repoNameParameter = DeployResponseParametersDefinitions.MicroServices.CreateGithubRepository.Name; var repoName = githubDependency.ResponseParameters[repoNameParameter] as string; var settingDotnet = GetSetting(projectState, Definitions.SettingsDefinitions.DotNetExePath); DotnetService.Initialize(settingDotnet); var solutionFile = GetSolutionFileName(repoName); var solutionFilePath = FileService.ConcatDirectoryAndFileOrFolder(sourcePath, solutionFile); var existsSolution = FileService.ExistsFile(solutionFilePath); if (!existsSolution) { return(new DeployActionUnitResponse() .Ok(DeployActionUnitResponse.DeployActionResponseType.NotCompletedJob)); } return(new DeployActionUnitResponse() .Ok(GetParameters(sourcePath, solutionFile, solutionFilePath), DeployActionUnitResponse.DeployActionResponseType.AlreadyCompletedJob)); } catch (Exception ex) { return(new DeployActionUnitResponse() .Error(ex)); } }