大声道撒旦
This commit is contained in:
parent
52bc47cc2d
commit
8900cddf8c
@ -65,12 +65,6 @@ public class JenkinsBaseBuildVariables {
|
||||
)
|
||||
private String jobId;
|
||||
|
||||
@SchemaProperty(
|
||||
title = "构建产物路径",
|
||||
description = "构建产物路径",
|
||||
order = 5
|
||||
)
|
||||
private String artifactPath;
|
||||
|
||||
|
||||
@SchemaProperty(
|
||||
|
||||
@ -21,12 +21,8 @@ import org.hibernate.annotations.Type;
|
||||
@Table(name = "deploy_app_config")
|
||||
public class DeployAppConfig extends Entity<Long> {
|
||||
|
||||
|
||||
@Column(name = "environment_id", nullable = false)
|
||||
private Long environmentId;
|
||||
|
||||
@Column(name = "application_id", nullable = false)
|
||||
private Long applicationId;
|
||||
@Column(name = "branch", nullable = false)
|
||||
private String branch;
|
||||
|
||||
@Column(name = "build_type", nullable = false)
|
||||
@Enumerated(EnumType.STRING)
|
||||
@ -36,9 +32,6 @@ public class DeployAppConfig extends Entity<Long> {
|
||||
@Enumerated(EnumType.STRING)
|
||||
private DevelopmentLanguageTypeEnum languageType;
|
||||
|
||||
@Column(name = "workflow_definition_id", nullable = false)
|
||||
private Long workflowDefinitionId;
|
||||
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "form_variables_schema", columnDefinition = "text")
|
||||
private JsonNode formVariablesSchema;
|
||||
@ -47,6 +40,15 @@ public class DeployAppConfig extends Entity<Long> {
|
||||
@Column(name = "build_variables", columnDefinition = "text", nullable = false)
|
||||
private JsonNode buildVariables;
|
||||
|
||||
@Column(name = "environment_id", nullable = false)
|
||||
private Long environmentId;
|
||||
|
||||
@Column(name = "application_id", nullable = false)
|
||||
private Long applicationId;
|
||||
|
||||
@Column(name = "workflow_definition_id", nullable = false)
|
||||
private Long workflowDefinitionId;
|
||||
|
||||
@Column(name = "enabled", nullable = false)
|
||||
private Boolean enabled;
|
||||
}
|
||||
|
||||
@ -22,12 +22,15 @@ public class RepositoryProjectQuery extends BaseQuery {
|
||||
@QueryField(field = "visibility")
|
||||
private String visibility;
|
||||
|
||||
@QueryField(field = "groupId")
|
||||
private Long groupId;
|
||||
|
||||
@QueryField(field = "externalSystemId")
|
||||
private Long externalSystemId;
|
||||
|
||||
@QueryField(field = "projectId")
|
||||
private Long projectId;
|
||||
|
||||
@QueryField(field = "repoGroupId")
|
||||
private Long repoGroupId;
|
||||
|
||||
@QueryField(field = "repoProjectId")
|
||||
private Long repoProjectId;
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Git仓库组Repository
|
||||
@ -37,4 +38,6 @@ public interface IRepositoryGroupRepository extends IBaseRepository<RepositoryGr
|
||||
void deleteByExternalSystemId(Long externalSystemId);
|
||||
|
||||
List<RepositoryGroup> findByExternalSystemIdAndDeletedFalse(Long externalSystemId);
|
||||
|
||||
Optional<RepositoryGroup> findByRepoGroupId(Long repoGroupId);
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.qqchen.deploy.backend.deploy.entity.RepositoryProject;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface IRepositoryProjectRepository extends IBaseRepository<RepositoryProject, Long> {
|
||||
@ -31,4 +32,6 @@ public interface IRepositoryProjectRepository extends IBaseRepository<Repository
|
||||
void deleteByExternalSystemId(Long externalSystemId);
|
||||
|
||||
List<RepositoryProject> findByExternalSystemIdAndDeletedFalse(Long externalSystemId);
|
||||
|
||||
Optional<RepositoryProject> findByRepoProjectId(Long repoProjectId);
|
||||
}
|
||||
@ -70,11 +70,11 @@ public class ApplicationServiceImpl extends BaseServiceImpl<Application, Applica
|
||||
projectGroupOptional.ifPresent(projectGroup -> application.setProjectGroup(projectGroupConverter.toDto(projectGroup)));
|
||||
|
||||
// 查询并设置代码仓库组信息
|
||||
Optional<RepositoryGroup> repositoryGroupOptional = repositoryGroupRepository.findById(application.getRepoGroupId());
|
||||
Optional<RepositoryGroup> repositoryGroupOptional = repositoryGroupRepository.findByRepoGroupId(application.getRepoGroupId());
|
||||
repositoryGroupOptional.ifPresent(repositoryGroup -> application.setRepositoryGroup(repositoryGroupConverter.toDto(repositoryGroup)));
|
||||
|
||||
// 查询并设置代码仓库项目信息
|
||||
Optional<RepositoryProject> repositoryProjectOptional = repositoryProjectRepository.findById(application.getRepoProjectId());
|
||||
Optional<RepositoryProject> repositoryProjectOptional = repositoryProjectRepository.findByRepoProjectId(application.getRepoProjectId());
|
||||
repositoryProjectOptional.ifPresent(repositoryProject -> application.setRepositoryProject(repositoryProjectConverter.toDto(repositoryProject)));
|
||||
|
||||
// 查询并设置外部系统信息
|
||||
|
||||
@ -152,7 +152,6 @@ public class DeployAppConfigServiceImpl extends BaseServiceImpl<DeployAppConfig,
|
||||
request.setBusinessKey(environment.getEnvCode() + "_" + application.getAppCode() + "_" + System.currentTimeMillis() / 1000);
|
||||
request.setVariables(objectMapper.convertValue(dto.getBuildVariables(), new TypeReference<>() {
|
||||
}));
|
||||
|
||||
WorkflowInstanceDTO workflowInstanceDTO = workflowInstanceService.startWorkflow(request);
|
||||
buildAndSaveDeployLog(dto, environment, application, workflowInstanceDTO);
|
||||
}
|
||||
|
||||
@ -544,14 +544,13 @@ CREATE TABLE deploy_application
|
||||
app_code VARCHAR(50) NOT NULL COMMENT '应用编码',
|
||||
app_name VARCHAR(100) NOT NULL COMMENT '应用名称',
|
||||
app_desc VARCHAR(255) NULL COMMENT '应用描述',
|
||||
repo_url VARCHAR(255) NULL COMMENT '代码仓库地址',
|
||||
language VARCHAR(50) NULL COMMENT '开发语言:JAVA、PYTHON、NODEJS',
|
||||
enabled BIT NOT NULL DEFAULT 1 COMMENT '是否启用(0:禁用,1:启用)',
|
||||
sort INT NOT NULL DEFAULT 0 COMMENT '排序号',
|
||||
repo_group_id BIGINT NOT NULL COMMENT '代码仓库项目ID',
|
||||
repo_project_id BIGINT NOT NULL COMMENT '代码仓库项目ID',
|
||||
project_group_id BIGINT NOT NULL COMMENT '所属项目组ID',
|
||||
external_system_id BIGINT NOT NULL COMMENT '外部系统ID',
|
||||
enabled BIT NOT NULL DEFAULT 1 COMMENT '是否启用(0:禁用,1:启用)',
|
||||
sort INT NOT NULL DEFAULT 0 COMMENT '排序号',
|
||||
-- 基础字段
|
||||
create_by VARCHAR(100) NULL COMMENT '创建人',
|
||||
create_time DATETIME(6) NULL COMMENT '创建时间',
|
||||
@ -641,7 +640,29 @@ CREATE TABLE deploy_log
|
||||
update_time DATETIME(6) NULL COMMENT '更新时间',
|
||||
version INT NOT NULL DEFAULT 1 COMMENT '版本号',
|
||||
deleted BIT NOT NULL DEFAULT 0 COMMENT '是否删除:0-未删除,1-已删除'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_unicode_ci COMMENT ='部署日志表';
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='部署日志表';
|
||||
|
||||
|
||||
CREATE TABLE deploy_app_config
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
|
||||
|
||||
build_type VARCHAR(50) NOT NULL,
|
||||
build_variables TEXT NOT NULL,
|
||||
form_variables_schema TEXT NULL,
|
||||
language_type VARCHAR(50) NOT NULL,
|
||||
workflow_definition_id BIGINT NOT NULL,
|
||||
branch VARCHAR(50) NOT NULL,
|
||||
|
||||
environment_id BIGINT NOT NULL,
|
||||
application_id BIGINT NOT NULL,
|
||||
enabled BIT NOT NULL,
|
||||
|
||||
create_by VARCHAR(100) NULL COMMENT '创建人',
|
||||
create_time DATETIME(6) NULL COMMENT '创建时间',
|
||||
update_by VARCHAR(100) NULL COMMENT '更新人',
|
||||
update_time DATETIME(6) NULL COMMENT '更新时间',
|
||||
version INT NOT NULL DEFAULT 1 COMMENT '版本号',
|
||||
deleted BIT NOT NULL DEFAULT 0 COMMENT '是否删除:0-未删除,1-已删除'
|
||||
);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user