コード例 #1
0
        public override DeployActionUnitResponse ExecuteDeploy(
            ProjectState projectState,
            ActionExecution sourceActionExecution,
            List <DeployActionUnit> currentExecutionDeployActions)
        {
            try
            {
                var createDomainProject = GetDependencyFromSameSource <CreateDomainProject>
                                              (sourceActionExecution, currentExecutionDeployActions);
                var createDomainSolution = GetDependencyFromSameSource <CreateDomainSolutionFile>
                                               (sourceActionExecution, currentExecutionDeployActions);

                var domainSolutionFolderParameter = DeployResponseParametersDefinitions.Project.CreateDomainSolutionFile.Path;
                var domainSolutionNameParameter   = DeployResponseParametersDefinitions.Project.CreateDomainSolutionFile.SolutionFileName;
                var domainSolutionFolder          = createDomainSolution.ResponseParameters[domainSolutionFolderParameter] as string;
                var domainSolutionName            = createDomainSolution.ResponseParameters[domainSolutionNameParameter] as string;

                var projectPathParameter = DeployResponseParametersDefinitions.Project.CreateDomainProject.ProjectFilePath;
                var projectPath          = createDomainProject.ResponseParameters[projectPathParameter] as string;

                var relativePath = projectPath.Replace(domainSolutionFolder, "").Substring(1);

                DotnetService.AddProjectToSolutionFile(domainSolutionFolder, domainSolutionName, relativePath);
                return(new DeployActionUnitResponse()
                       .Ok(GetParameters(domainSolutionFolder, domainSolutionName, relativePath), DeployActionUnitResponse.DeployActionResponseType.AlreadyCompletedJob));
            }
            catch (Exception ex)
            {
                return(new DeployActionUnitResponse()
                       .Error(ex));
            }
        }
コード例 #2
0
 public MainViewModel()
 {
     _dotnetService = new DotnetService();
     _dbService     = new DbService(AppConfig.DefaultDatabase, AppConfig.DefaultConnectionString);
     _needDotnet    = _dotnetService.NeedInstall(AppConfig.DotnetCoreSdkVersion);
     _needDb        = _dbService.NeedInstall();
 }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        private ActionManager GetActionManager()
        {
            IGithubClientService githubClientService = new GithubClientService();
            IProcessService      processService      = new ProcessService();
            IGitClientService    gitClientService    = new GitClientService(processService);
            IDotnetService       dotnetService       = new DotnetService(processService);
            IDDService           dDService           = new DDService(processService);

            var actionManager = new ActionManager(_cryptoService);

            actionManager.RegisterAction(new InitializeProject(
                                             _fileService,
                                             githubClientService,
                                             gitClientService,
                                             dotnetService,
                                             dDService));
            actionManager.RegisterAction(new AddDomain());
            actionManager.RegisterAction(new DeleteDomain());
            actionManager.RegisterAction(new DeleteSchema());
            actionManager.RegisterAction(new AddSchema());
            actionManager.RegisterAction(new ModifySchema());
            actionManager.RegisterAction(new AddSchemaProperty());
            actionManager.RegisterAction(new AddAzurePipelinesSetting(_cryptoService));
            actionManager.RegisterAction(new DeleteAzurePipelinesSetting());
            actionManager.RegisterAction(new AddGithubSetting(_cryptoService));
            actionManager.RegisterAction(new DeleteGithubSetting());
            actionManager.RegisterAction(new AddSchemaIntersection());
            actionManager.RegisterAction(new AddUseCase());
            actionManager.RegisterAction(new DeleteUseCase());
            //actionManager.RegisterAction(new AddSchemaToDomain());
            //actionManager.RegisterAction(new AddDomainInMicroService(_fileService, dotnetService));
            //actionManager.RegisterAction(new AddMicroService(_fileService, githubClientService, gitClientService, dotnetService));
            actionManager.RegisterAction(new AddEnvironment());
            actionManager.RegisterAction(new DeleteEnvironment());
            actionManager.RegisterAction(new AddSetting());
            actionManager.RegisterAction(new AddSchemaView());

            return(actionManager);
        }
コード例 #5
0
        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));
            }
        }