删除代码,修改配置文件
This commit is contained in:
parent
5ae719b1f3
commit
a80a0a9dba
333
.idea/compiler.xml
generated
333
.idea/compiler.xml
generated
@ -18,35 +18,319 @@
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-protection" />
|
||||
<module name="spring-boot-starter-monitor" />
|
||||
<module name="module-system-biz" />
|
||||
<module name="module-ci-process-biz" />
|
||||
<module name="module-system-api" />
|
||||
<module name="spring-boot-starter-mq" />
|
||||
<module name="spring-boot-starter-mongo" />
|
||||
<module name="commons" />
|
||||
<module name="spring-boot-starter-plugin" />
|
||||
<module name="module-ci-engine" />
|
||||
<module name="module-ci-execute" />
|
||||
<module name="ops-server" />
|
||||
<module name="spring-boot-starter-biz-data-permission" />
|
||||
<module name="spring-boot-starter-mybatis" />
|
||||
<module name="module-ci-process-api" />
|
||||
<module name="module-infra-api" />
|
||||
<module name="spring-boot-starter-test" />
|
||||
<module name="spring-boot-starter-websocket" />
|
||||
<module name="spring-boot-starter-biz-ip" />
|
||||
<module name="module-infra-biz" />
|
||||
<module name="module-ci-commons" />
|
||||
<module name="spring-boot-starter-job" />
|
||||
<module name="spring-boot-starter-web" />
|
||||
<module name="module-ci-plugin" />
|
||||
<module name="spring-boot-starter-excel" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for commons" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="commons" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-biz-data-permission" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-biz-data-permission" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-biz-ip" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-biz-ip" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-biz-tenant" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-biz-tenant" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-excel" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-excel" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-job" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-job" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-mongo" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-mongo" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-monitor" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-monitor" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-mq" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-mq" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-mybatis" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-mybatis" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-plugin" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-plugin" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-protection" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-protection" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-redis" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-redis" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-security" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-security" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-test" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-test" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-web" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-web" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for spring-boot-starter-websocket" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="spring-boot-starter-websocket" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-ci-process-biz" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
</processorPath>
|
||||
<module name="module-ci-process-biz" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-infra-api" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="module-infra-api" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-infra-biz" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="module-infra-biz" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-system-api" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="module-system-api" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-system-biz" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
</processorPath>
|
||||
<module name="module-system-biz" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for ops-server" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="ops-server" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-ci-repository" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="module-ci-repository" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-ci-commons" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="module-ci-commons" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for module-ci-execute" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/3.3.4/spring-boot-configuration-processor-3.3.4.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.6.2/mapstruct-processor-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.6.2/mapstruct-1.6.2.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="module-ci-execute" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="module-ci-common-pipeline" target="17" />
|
||||
@ -55,9 +339,9 @@
|
||||
<module name="module-ci-event" target="17" />
|
||||
<module name="module-ci-log" target="17" />
|
||||
<module name="module-ci-market" target="17" />
|
||||
<module name="module-ci-process-api" target="17" />
|
||||
<module name="module-ci-project" target="17" />
|
||||
<module name="module-ci-quality" target="17" />
|
||||
<module name="module-ci-repository" target="17" />
|
||||
<module name="module-ci-store-api" target="17" />
|
||||
<module name="module-ci-ticket" target="17" />
|
||||
<module name="module-ci-worker" target="17" />
|
||||
@ -76,6 +360,7 @@
|
||||
<module name="module-ci-plugin" options="-parameters" />
|
||||
<module name="module-ci-process-api" options="-parameters" />
|
||||
<module name="module-ci-process-biz" options="-parameters" />
|
||||
<module name="module-ci-repository" options="-parameters" />
|
||||
<module name="module-infra-api" options="-parameters" />
|
||||
<module name="module-infra-biz" options="-parameters" />
|
||||
<module name="module-system-api" options="-parameters" />
|
||||
|
126
dependencies/.flattened-pom.xml
vendored
126
dependencies/.flattened-pom.xml
vendored
@ -13,7 +13,6 @@
|
||||
<podam.version>8.0.0.RELEASE</podam.version>
|
||||
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
|
||||
<opengauss.jdbc.version>5.1.0</opengauss.jdbc.version>
|
||||
<okhttp.version>4.12.0</okhttp.version>
|
||||
<mapstruct.version>1.6.2</mapstruct.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<sqlite.version>3.47.1.0</sqlite.version>
|
||||
@ -23,6 +22,7 @@
|
||||
<json.version>20250107</json.version>
|
||||
<kingbase.jdbc.version>8.6.0</kingbase.jdbc.version>
|
||||
<commons-compress.version>1.27.1</commons-compress.version>
|
||||
<rocketmq-spring.version>2.3.1</rocketmq-spring.version>
|
||||
<ip2region.version>2.7.0</ip2region.version>
|
||||
<dynamic-datasource.version>4.3.1</dynamic-datasource.version>
|
||||
<redisson.version>3.36.0</redisson.version>
|
||||
@ -35,8 +35,9 @@
|
||||
<version-number.version>1.12</version-number.version>
|
||||
<lock4j.version>2.2.7</lock4j.version>
|
||||
<commons-io.version>2.17.0</commons-io.version>
|
||||
<logback-core.version>1.5.8</logback-core.version>
|
||||
<apk-parser.version>2.6.10</apk-parser.version>
|
||||
<ognl.version>3.2.1</ognl.version>
|
||||
<ognl.version>3.4.7</ognl.version>
|
||||
<hutool-6.version>6.0.0-M16</hutool-6.version>
|
||||
<resilience4j-circuitbreaker.version>2.3.0</resilience4j-circuitbreaker.version>
|
||||
<jsoup.version>1.18.1</jsoup.version>
|
||||
@ -45,6 +46,7 @@
|
||||
<lombok.version>1.18.34</lombok.version>
|
||||
<skywalking.version>9.0.0</skywalking.version>
|
||||
<mockito-inline.version>5.2.0</mockito-inline.version>
|
||||
<logback-classic.version>1.5.8</logback-classic.version>
|
||||
<commons-exec.version>1.4.0</commons-exec.version>
|
||||
<velocity.version>2.4</velocity.version>
|
||||
<reflections.version>0.10.2</reflections.version>
|
||||
@ -52,8 +54,8 @@
|
||||
<anwena.version>2.0.8.3</anwena.version>
|
||||
<pf4j.version>3.12.1</pf4j.version>
|
||||
<logback.version>1.2.13</logback.version>
|
||||
<winrm4j.version>0.12.0</winrm4j.version>
|
||||
<mybatis-plus-join.version>1.4.13</mybatis-plus-join.version>
|
||||
<docker-java.version>3.2.13</docker-java.version>
|
||||
<hutool-5.version>5.8.32</hutool-5.version>
|
||||
<revision>2.0.0-jdk17</revision>
|
||||
<jsch.version>0.1.55</jsch.version>
|
||||
@ -135,6 +137,11 @@
|
||||
<artifactId>spring-boot-starter-mq</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>${rocketmq-spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mybatis</artifactId>
|
||||
@ -197,17 +204,62 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<artifactId>module-ci-environment</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-biz</artifactId>
|
||||
<artifactId>module-ci-event</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<artifactId>module-ci-log</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-market</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-project</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-quality</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-ticket</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-repository</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-worker</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-dispatch-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-store-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-execute</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -359,21 +411,6 @@
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-oauth2-jose</artifactId>
|
||||
<version>6.3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-oauth2-client</artifactId>
|
||||
<version>6.3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-oauth2-resource-server</artifactId>
|
||||
<version>6.3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
@ -526,9 +563,9 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.pf4j</groupId>
|
||||
<artifactId>pf4j-spring</artifactId>
|
||||
<version>${pf4j-spring.version}</version>
|
||||
<groupId>io.cloudsoft.windows</groupId>
|
||||
<artifactId>winrm4j</artifactId>
|
||||
<version>${winrm4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
@ -570,37 +607,6 @@
|
||||
<artifactId>bcprov-jdk18on</artifactId>
|
||||
<version>${bcprov-jdk18on.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>${docker-java.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java-transport-httpclient5</artifactId>
|
||||
<version>${docker-java.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jvnet.winp</groupId>
|
||||
<artifactId>winp</artifactId>
|
||||
@ -626,6 +632,16 @@
|
||||
<artifactId>apk-parser</artifactId>
|
||||
<version>${apk-parser.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>${logback-core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback-classic.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
|
33
dependencies/pom.xml
vendored
33
dependencies/pom.xml
vendored
@ -89,7 +89,8 @@
|
||||
<logback-classic.version>1.5.8</logback-classic.version>
|
||||
<caffeine.version>2.9.3</caffeine.version>
|
||||
<resilience4j-circuitbreaker.version>2.3.0</resilience4j-circuitbreaker.version>
|
||||
<!-- <winrm4j.version>0.12.3</winrm4j.version>-->
|
||||
<winrm4j.version>0.12.0</winrm4j.version>
|
||||
<ognl.version>3.4.7</ognl.version>
|
||||
|
||||
</properties>
|
||||
|
||||
@ -223,7 +224,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<artifactId>module-ci-commons</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
@ -251,12 +252,6 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-project</artifactId>
|
||||
@ -299,6 +294,12 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-execute</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!---->
|
||||
<dependency>
|
||||
<groupId>io.github.mouzt</groupId>
|
||||
@ -647,7 +648,7 @@
|
||||
<dependency>
|
||||
<groupId>io.cloudsoft.windows</groupId>
|
||||
<artifactId>winrm4j</artifactId>
|
||||
<version>0.12.0</version> <!-- 最新稳定版 -->
|
||||
<version>${winrm4j.version}</version> <!-- 最新稳定版 -->
|
||||
</dependency>
|
||||
|
||||
<!--数据库驱动-->
|
||||
@ -714,6 +715,7 @@
|
||||
<version>${reflections.version}</version>
|
||||
<!-- <version>请替换为实际版本号</version>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-exec</artifactId>
|
||||
@ -727,40 +729,45 @@
|
||||
<version>${dd-plist.version}</version>
|
||||
<!-- <version></version>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.dongliu</groupId>
|
||||
<artifactId>apk-parser</artifactId>
|
||||
<version>${apk-parser.version}</version>
|
||||
<!-- <version></version>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>${logback-core.version}</version>
|
||||
<!-- <version>1</version>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback-classic.version}</version>
|
||||
<!-- <version></version>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>${caffeine.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.resilience4j</groupId>
|
||||
<artifactId>resilience4j-circuitbreaker</artifactId>
|
||||
<version>${resilience4j-circuitbreaker.version}</version>
|
||||
</dependency>
|
||||
<!-- devops ci- worker end-->
|
||||
<!-- ssh相关依赖-->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.cloudsoft.windows</groupId>
|
||||
<artifactId>winrm4j</artifactId>
|
||||
<version>0.12.3</version>
|
||||
<groupId>ognl</groupId>
|
||||
<artifactId>ognl</artifactId>
|
||||
<version>${ognl.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cd.casic.plugin.dataobject.dto;
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cd.casic.framework.commons.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cd.casic.plugin.dataobject.dto;
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cd.casic.framework.commons.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -9,16 +9,24 @@
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<version>${revision}</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<version>${revision}</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<artifactId>module-ci-commons</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-system-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
57
modules/module-ci-execute/pom.xml
Normal file
57
modules/module-ci-execute/pom.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>module-ci-execute</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>${revision}</version>
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.2.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java-transport-httpclient5</artifactId>
|
||||
<version>3.2.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>5.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.core5</groupId>
|
||||
<artifactId>httpcore5</artifactId>
|
||||
<version>5.3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.17.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1,6 +1,6 @@
|
||||
package cd.casic.module.execute.docker.dataobject.dto;
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cd.casic.framework.commons.dataobject.BaseDO;
|
||||
import cd.casic.module.execute.docker.dataobject.model.DockerEndpoint;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cd.casic.module.execute.docker.dataobject.dto;
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cd.casic.framework.commons.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
@ -1,7 +0,0 @@
|
||||
package cd.casic.ci.store;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package cd.casic.ci.plugin;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
package cd.casic.module.process.api;
|
@ -16,19 +16,23 @@
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-commons</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-system-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mybatis</artifactId>
|
||||
@ -38,10 +42,7 @@
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ognl</groupId>
|
||||
<artifactId>ognl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-websocket</artifactId>
|
||||
@ -51,26 +52,13 @@
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<!-- ssh 相关依赖,暂时先放在这-->
|
||||
<dependency>
|
||||
<groupId>io.cloudsoft.windows</groupId>
|
||||
<artifactId>winrm4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<artifactId>jsch</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.antherd</groupId>-->
|
||||
<!-- <artifactId>sm-crypto</artifactId>-->
|
||||
<!-- <version>0.3.2</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 上面的依赖与java17有冲突-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk18on</artifactId>
|
||||
<version>1.80</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.hierynomus</groupId>
|
||||
<artifactId>sshj</artifactId>
|
||||
@ -81,11 +69,22 @@
|
||||
<artifactId>expectit-core</artifactId>
|
||||
<version>0.9.0</version>
|
||||
</dependency>
|
||||
<!-- ssh 相关依赖,暂时先放在这-->
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<artifactId>jsch</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.cloudsoft.windows</groupId>
|
||||
<artifactId>winrm4j</artifactId>
|
||||
<version>0.12.0</version> <!-- 最新稳定版 -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ognl</groupId>
|
||||
<artifactId>ognl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
|
@ -5,19 +5,13 @@ import cd.casic.ci.process.engine.enums.ContextStateEnum;
|
||||
import cd.casic.ci.process.engine.manager.RunContextManager;
|
||||
import cd.casic.ci.process.engine.runContext.PipelineRunContext;
|
||||
import cd.casic.ci.process.engine.runContext.SecondStageRunContext;
|
||||
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||
import cd.casic.ci.process.process.dataObject.stage.PipStage;
|
||||
import cd.casic.framework.mq.redis.core.RedisMQTemplate;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@Slf4j
|
||||
@ -30,7 +24,7 @@ public class ParallelDispatcher implements BaseDispatcher{
|
||||
private RedisMQTemplate redisMQTemplate;
|
||||
private ThreadPoolTaskExecutor taskExecutor;
|
||||
|
||||
public ParallelDispatcher(List<PipStage> firstStageList, PipelineRunContext context,RunContextManager contextManager,RedisMQTemplate redisMQTemplate,ThreadPoolTaskExecutor taskExecutor) {
|
||||
public ParallelDispatcher(List<PipStage> firstStageList, PipelineRunContext context, RunContextManager contextManager, RedisMQTemplate redisMQTemplate, ThreadPoolTaskExecutor taskExecutor) {
|
||||
this.firstStageList = firstStageList;
|
||||
this.pipelineRunContext = context;
|
||||
this.stageIndex = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cd.casic.ci.process.snowflake;
|
||||
package cd.casic.ci.process.util.snowflake;
|
||||
|
||||
public class SnowflakeIdWorker {
|
||||
// 开始时间戳 (2020-01-01)
|
@ -1,4 +1,4 @@
|
||||
package cd.casic.ci.process.snowflake;
|
||||
package cd.casic.ci.process.util.snowflake;
|
||||
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import org.springframework.stereotype.Component;
|
@ -1,4 +0,0 @@
|
||||
package cd.casic.module.process.controller.app;
|
||||
|
||||
public class ProcessFlowController {
|
||||
}
|
@ -1 +0,0 @@
|
||||
package cd.casic.module.process.controller;
|
@ -1,27 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.Auth;
|
||||
import cd.casic.module.process.process.setting.dataobject.AuthDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname AuthConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthConvert {
|
||||
AuthConvert INSTANCE = Mappers.getMapper(AuthConvert.class);
|
||||
|
||||
Auth convert(AuthDo authDo);
|
||||
|
||||
AuthDo convertDo(Auth auth);
|
||||
|
||||
List<Auth> convertList(List<AuthDo> authDos);
|
||||
|
||||
List<AuthDo> convertDoList(List<Auth> auths);
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.AuthHost;
|
||||
import cd.casic.module.process.process.setting.dataobject.AuthHostDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname AuthHost
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 15:56
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthHostConvert {
|
||||
AuthHostConvert INSTANCE = Mappers.getMapper(AuthHostConvert.class);
|
||||
|
||||
AuthHostDo convertDo(AuthHost authHost);
|
||||
|
||||
AuthHost convert(AuthHostDo authHostDo);
|
||||
|
||||
List<AuthHost> convertList(List<AuthHostDo> authHostGroupDos);
|
||||
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.AuthHostGroup;
|
||||
import cd.casic.module.process.process.setting.dataobject.AuthHostGroupDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname AuthHostGroupConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 10:58
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthHostGroupConvert {
|
||||
|
||||
AuthHostGroupConvert INSTANCE = Mappers.getMapper(AuthHostGroupConvert.class);
|
||||
|
||||
AuthHostGroupDo convertDo(AuthHostGroup authHostGroup);
|
||||
|
||||
AuthHostGroup convert(AuthHostGroupDo authHostGroupDo);
|
||||
|
||||
List<AuthHostGroup> convertList(List<AuthHostGroupDo> authHostGroupDos);
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.AuthHostGroupDetails;
|
||||
import cd.casic.module.process.process.setting.dataobject.AuthHostGroupDetailsDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname AuthHostGroupDetailsConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 10:09
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthHostGroupDetailsConvert {
|
||||
AuthHostGroupDetailsConvert INSTANCE = Mappers.getMapper(AuthHostGroupDetailsConvert.class);
|
||||
|
||||
AuthHostGroupDetailsDo convertDo(AuthHostGroupDetails authHostGroupDetails);
|
||||
|
||||
AuthHostGroupDetails convert(AuthHostGroupDetailsDo authHostGroupDetailsDo);
|
||||
|
||||
List<AuthHostGroupDetails> convertList(List<AuthHostGroupDetailsDo> list);
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.AuthHostK8s;
|
||||
import cd.casic.module.process.process.setting.dataobject.AuthHostK8sDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname AuthHostK8sConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 14:26
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthHostK8sConvert {
|
||||
AuthHostK8sConvert INSTANCE = Mappers.getMapper(AuthHostK8sConvert.class);
|
||||
|
||||
AuthHostK8s convert(AuthHostK8sDo authHostK8sDo);
|
||||
|
||||
AuthHostK8sDo convertDo(AuthHostK8s authHostK8s);
|
||||
|
||||
List<AuthHostK8s> convertList(List<AuthHostK8sDo> list);
|
||||
|
||||
List<AuthHostK8sDo> convertDoList(List<AuthHostK8s> list);
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.AuthThird;
|
||||
import cd.casic.module.process.process.setting.dataobject.AuthThirdDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname AuthThirdConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:38
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthThirdConvert {
|
||||
|
||||
AuthThirdConvert INSTANCE = Mappers.getMapper(AuthThirdConvert.class);
|
||||
|
||||
AuthThird convert(AuthThirdDo authThirdDo);
|
||||
|
||||
AuthThirdDo convertDo(AuthThird authThird);
|
||||
|
||||
List<AuthThird> convertList(List<AuthThirdDo> authThirdDos);
|
||||
|
||||
List<AuthThirdDo> convertDoList(List<AuthThird> authThirds);
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.Cache;
|
||||
import cd.casic.module.process.process.setting.dataobject.CacheDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname CacheConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:39
|
||||
*/
|
||||
@Mapper
|
||||
public interface CacheConvert {
|
||||
|
||||
CacheConvert INSTANCE = Mappers.getMapper(CacheConvert.class);
|
||||
|
||||
Cache convert(CacheDo cacheDo);
|
||||
|
||||
CacheDo convert(Cache cache);
|
||||
|
||||
List<Cache> convert(List<CacheDo> cacheDos);
|
||||
|
||||
List<CacheDo> convertDoList(List<Cache> caches);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.Env;
|
||||
import cd.casic.module.process.process.setting.dataobject.EnvDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname EnvConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:40
|
||||
*/
|
||||
@Mapper
|
||||
public interface EnvConvert {
|
||||
|
||||
EnvConvert INSTANCE = Mappers.getMapper(EnvConvert.class);
|
||||
|
||||
EnvDo convertDo(Env env);
|
||||
|
||||
Env convert(EnvDo envDo);
|
||||
|
||||
List<Env> convertList(List<EnvDo> envDos);
|
||||
|
||||
List<EnvDo> convertDoList(List<Env> envs);
|
||||
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.Group;
|
||||
import cd.casic.module.process.process.setting.dataobject.GroupDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname Group
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:41
|
||||
*/
|
||||
@Mapper
|
||||
public interface GroupConvert {
|
||||
|
||||
GroupConvert INSTANCE = Mappers.getMapper(GroupConvert.class);
|
||||
|
||||
Group convert(GroupDo groupDo);
|
||||
|
||||
GroupDo convertDo(Group group);
|
||||
|
||||
List<Group> convertList(List<GroupDo> groupDos);
|
||||
|
||||
List<GroupDo> convertDoList(List<Group> groups);
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.setting.Resources;
|
||||
import cd.casic.module.process.process.setting.dataobject.ResourcesDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname ResourcesConvert
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:47
|
||||
*/
|
||||
@Mapper
|
||||
public interface ResourcesConvert {
|
||||
|
||||
ResourcesConvert INSTANCE = Mappers.getMapper(ResourcesConvert.class);
|
||||
|
||||
ResourcesDo convert(Resources resources);
|
||||
|
||||
Resources convert(ResourcesDo resourcesDo);
|
||||
|
||||
List<Resources> convertList(List<ResourcesDo> resourcesDos);
|
||||
|
||||
List<ResourcesDo> convertListDo(List<Resources> resources);
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package cd.casic.module.process.convert.setting;
|
||||
|
||||
import cd.casic.module.process.process.setting.dataobject.ScmDo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname Scm
|
||||
* @Description TODO
|
||||
* @Date 2025/4/24 16:49
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScmConvert {
|
||||
|
||||
ScmConvert INSTANCE = Mappers.getMapper(ScmConvert.class);
|
||||
|
||||
ScmDo convert(ScmDo scmDo);
|
||||
// TODO 同下
|
||||
// ScmDo convertDo(ScmDo scmDo);
|
||||
|
||||
List<ScmDo> convertList(List<ScmDo> scmDos);
|
||||
// TODO 重复了
|
||||
// List<ScmDo> convertDoList(List<ScmDo> scmDos);
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cd.casic.module.process.core.context;
|
||||
|
||||
/**
|
||||
* @ClassName AppHomeContext
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/2 18:25
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class AppHomeContext {
|
||||
private static String appHome;
|
||||
|
||||
public AppHomeContext() {
|
||||
}
|
||||
|
||||
public static String getAppHome() {
|
||||
return appHome;
|
||||
}
|
||||
|
||||
public static void setAppHome(String appHome) {
|
||||
AppHomeContext.appHome = appHome;
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package cd.casic.module.process.core.context;
|
||||
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
public class ApplicationContextContext {
|
||||
private static ConfigurableApplicationContext applicationContext;
|
||||
|
||||
public ApplicationContextContext() {
|
||||
}
|
||||
|
||||
public static ConfigurableApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
public static void setApplicationContext(ConfigurableApplicationContext applicationContext) {
|
||||
ApplicationContextContext.applicationContext = applicationContext;
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cd.casic.module.process.core.context;
|
||||
|
||||
/**
|
||||
* @ClassName LoginContext
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/5 20:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class LoginContext {
|
||||
private static String loginId;
|
||||
|
||||
public LoginContext() {
|
||||
}
|
||||
|
||||
public static String getLoginId() {
|
||||
return loginId;
|
||||
}
|
||||
|
||||
public static void setLoginId(String loginId) {
|
||||
LoginContext.loginId = loginId;
|
||||
}
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
package cd.casic.module.process.core.resolver;
|
||||
|
||||
import cd.casic.module.process.core.context.ApplicationContextContext;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.core.type.ClassMetadata;
|
||||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class AnnotationResourceResolver {
|
||||
private static final PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
private static final SimpleMetadataReaderFactory register = new SimpleMetadataReaderFactory();
|
||||
private static final StandardEnvironment environment = new StandardEnvironment();
|
||||
|
||||
public AnnotationResourceResolver() {
|
||||
}
|
||||
|
||||
public static Set<Class> resolveBeans(String pkgPath, Class<? extends Annotation> annoClazz) {
|
||||
Set<Class> clazzSet = new HashSet();
|
||||
ConfigurableApplicationContext applicationContext = ApplicationContextContext.getApplicationContext();
|
||||
Map<String, Object> beansWithAnnotationMap = applicationContext.getBeansWithAnnotation(annoClazz);
|
||||
Iterator var5 = beansWithAnnotationMap.entrySet().iterator();
|
||||
|
||||
while(var5.hasNext()) {
|
||||
Map.Entry<String, Object> entry = (Map.Entry)var5.next();
|
||||
Object object = entry.getValue();
|
||||
Class clazz = object.getClass();
|
||||
clazzSet.add(clazz);
|
||||
}
|
||||
|
||||
return clazzSet;
|
||||
}
|
||||
|
||||
public static Set<Class> resolve(String pkgPath, Class<? extends Annotation> annoClazz) {
|
||||
Set<Class> paths = new HashSet();
|
||||
|
||||
try {
|
||||
String pathPackage = getResourcePath(pkgPath);
|
||||
Resource[] resources = resolver.getResources(pathPackage);
|
||||
|
||||
for(int i = 0; i < resources.length; ++i) {
|
||||
Resource resource = resources[i];
|
||||
MetadataReader metadataReader = register.getMetadataReader(resource);
|
||||
AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
|
||||
if (annotationMetadata.hasAnnotation(annoClazz.getName())) {
|
||||
ClassMetadata classMetadata = metadataReader.getClassMetadata();
|
||||
String className = classMetadata.getClassName();
|
||||
ClassLoader classLoader = getClassLoader();
|
||||
Class<?> clazz = classLoader.loadClass(className);
|
||||
paths.add(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
} catch (Exception var13) {
|
||||
throw new RuntimeException(var13);
|
||||
}
|
||||
}
|
||||
|
||||
public static Set<Class> resolveFromBeans(String pkgPath, Class<? extends Annotation> annoClazz) {
|
||||
Set<Class> paths = new HashSet();
|
||||
ConfigurableApplicationContext applicationContext = ApplicationContextContext.getApplicationContext();
|
||||
|
||||
try {
|
||||
String pathPackage = getResourcePath(pkgPath);
|
||||
Resource[] resources = resolver.getResources(pathPackage);
|
||||
|
||||
for(int i = 0; i < resources.length; ++i) {
|
||||
Resource resource = resources[i];
|
||||
MetadataReader metadataReader = register.getMetadataReader(resource);
|
||||
AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
|
||||
if (annotationMetadata.hasAnnotation(annoClazz.getName())) {
|
||||
ClassMetadata classMetadata = metadataReader.getClassMetadata();
|
||||
String className = classMetadata.getClassName();
|
||||
ClassLoader classLoader = getClassLoader();
|
||||
Class<?> clazz = classLoader.loadClass(className);
|
||||
|
||||
try {
|
||||
Object bean = applicationContext.getBean(clazz);
|
||||
if (bean == null) {
|
||||
continue;
|
||||
}
|
||||
} catch (BeansException var15) {
|
||||
continue;
|
||||
}
|
||||
|
||||
paths.add(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
} catch (Exception var16) {
|
||||
throw new RuntimeException(var16);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getResourcePath(String packagePath) {
|
||||
if (StringUtils.isEmpty(packagePath)) {
|
||||
return "";
|
||||
} else {
|
||||
String resourcePath = "classpath*:" + ClassUtils.convertClassNameToResourcePath(environment.resolveRequiredPlaceholders(packagePath)) + "/**/*.class";
|
||||
return resourcePath;
|
||||
}
|
||||
}
|
||||
|
||||
static ClassLoader getClassLoader() {
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
if (classLoader == null) {
|
||||
classLoader = ClassLoader.getSystemClassLoader();
|
||||
}
|
||||
|
||||
return classLoader;
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
package cd.casic.module.process.core.util;
|
||||
|
||||
import cd.casic.ci.commons.exception.SystemException;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class BeanUtils {
|
||||
public BeanUtils() {
|
||||
}
|
||||
|
||||
public static PropertyDescriptor getPropertyDescriptor(Class clazz, String propertyName) {
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
Field f = null;
|
||||
|
||||
try {
|
||||
f = clazz.getDeclaredField(propertyName);
|
||||
} catch (NoSuchFieldException var8) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (f == null) {
|
||||
throw new SystemException("propertyName:" + propertyName + " not found.");
|
||||
} else {
|
||||
String var10000 = propertyName.substring(0, 1).toUpperCase();
|
||||
String methodEnd = var10000 + propertyName.substring(1);
|
||||
sb.append("set" + methodEnd);
|
||||
Method setMethod = clazz.getDeclaredMethod(sb.toString(), f.getType());
|
||||
sb.delete(0, sb.length());
|
||||
sb.append("get" + methodEnd);
|
||||
Method getMethod = clazz.getDeclaredMethod(sb.toString());
|
||||
PropertyDescriptor pd = new PropertyDescriptor(propertyName, getMethod, setMethod);
|
||||
return pd;
|
||||
}
|
||||
} catch (Exception var9) {
|
||||
throw new SystemException("系统错误");
|
||||
// throw new SystemException(var9);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* @Classname package-info
|
||||
* @Description TODO
|
||||
* @Date 2025/4/21 23:20
|
||||
* @author by mianbin
|
||||
*/
|
||||
package cd.casic.module.process.dispatch;
|
@ -1,77 +0,0 @@
|
||||
package cd.casic.module.process.engine.execute;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineRunMsg;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstance;
|
||||
|
||||
/**
|
||||
* 流水线运行服务接口
|
||||
*/
|
||||
public interface PipelineExecService {
|
||||
|
||||
/**
|
||||
* 开始构建
|
||||
*
|
||||
* @param runMsg 流水线id
|
||||
* @return 开始构建(true:开始运行 false:正在运行)
|
||||
*/
|
||||
PipelineInstance start(PipelineRunMsg runMsg);
|
||||
|
||||
// /**
|
||||
// * 回滚构建
|
||||
// *
|
||||
// * @param runMsg 流水线id
|
||||
// * @return 开始构建(true:开始运行 false:正在运行)
|
||||
// */
|
||||
// PipelineInstance rollBackStart(PipelineRunMsg runMsg);
|
||||
|
||||
/**
|
||||
* 停止流水线运行
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void stop(String pipelineId);
|
||||
|
||||
/**
|
||||
* 保持运行
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void keepOn(String pipelineId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,368 +0,0 @@
|
||||
package cd.casic.module.process.engine.execute.impl;
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineDetails;
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineRunMsg;
|
||||
import cd.casic.ci.commons.bean.engine.postprocess.Postprocess;
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.definition.Variable;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstance;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstanceQuery;
|
||||
import cd.casic.ci.commons.bean.process.setting.Scm;
|
||||
import cd.casic.ci.commons.bean.process.stage.Stage;
|
||||
import cd.casic.ci.commons.bean.work.agent.model.Agent;
|
||||
import cd.casic.ci.commons.bean.work.agent.AgentMessage;
|
||||
import cd.casic.framework.commons.exception.ServiceException;
|
||||
import cd.casic.framework.commons.exception.enums.GlobalErrorCodeConstants;
|
||||
import cd.casic.module.process.engine.execute.PipelineExecService;
|
||||
|
||||
import cd.casic.module.process.support.postprocess.service.PostprocessExecService;
|
||||
import cd.casic.module.process.engine.task.TasksExecService;
|
||||
import cd.casic.module.process.pipeline.instance.service.PipelineInstanceServiceImpl;
|
||||
import cd.casic.module.process.process.definition.PipelineService;
|
||||
import cd.casic.module.process.support.variable.service.VariableService;
|
||||
import cd.casic.module.process.process.instance.PipelineInstanceService;
|
||||
import cd.casic.module.process.process.setting.ResourcesService;
|
||||
import cd.casic.module.process.process.setting.ScmService;
|
||||
import cd.casic.module.process.process.stage.StageExecService;
|
||||
import cd.casic.module.process.process.stage.StageService;
|
||||
import cd.casic.module.process.support.agent.service.AgentService;
|
||||
import cd.casic.module.process.support.disk.service.DiskService;
|
||||
import cd.casic.module.process.support.version.service.PipelineVersionService;
|
||||
import cd.casic.module.process.support.util.PipelineUtilService;
|
||||
import cd.casic.module.process.support.util.util.PipelineFinal;
|
||||
import cd.casic.module.process.toolkit.join.JoinTemplate;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 流水线运行服务
|
||||
*/
|
||||
@Service
|
||||
// 这个注解含义不明
|
||||
//@Exporter
|
||||
public class PipelineExecServiceImpl implements PipelineExecService {
|
||||
|
||||
@Autowired
|
||||
PipelineService pipelineService;
|
||||
|
||||
@Autowired
|
||||
PostprocessExecService postExecService;
|
||||
|
||||
@Autowired
|
||||
PipelineInstanceService pipelineInstanceService;
|
||||
|
||||
@Autowired
|
||||
TasksExecService tasksExecService;
|
||||
|
||||
@Autowired
|
||||
StageExecService stageExecService;
|
||||
|
||||
@Autowired
|
||||
ResourcesService resourcesService;
|
||||
|
||||
@Autowired
|
||||
PipelineVersionService versionService;
|
||||
|
||||
@Autowired
|
||||
PipelineUtilService utilService;
|
||||
|
||||
@Autowired
|
||||
DiskService diskService;
|
||||
|
||||
@Autowired
|
||||
StageService stageService;
|
||||
|
||||
@Autowired
|
||||
JoinTemplate joinTemplate;
|
||||
|
||||
@Autowired
|
||||
ScmService scmService;
|
||||
|
||||
@Autowired
|
||||
VariableService variableService;
|
||||
|
||||
@Autowired
|
||||
AgentService agentService;
|
||||
|
||||
public final Logger logger = LoggerFactory.getLogger(PipelineExecServiceImpl.class);
|
||||
|
||||
//流水线id:流水线实例id
|
||||
public static final Map<String,String> pipelineIdOrInstanceId = new HashMap<>();
|
||||
|
||||
//流水线id:agent
|
||||
public static final Map<String , Agent> pipelineIdOrAgentId = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
* 流水线开始运行
|
||||
* @param runMsg 流水线id
|
||||
* @return 是否正在运行
|
||||
*/
|
||||
@Override
|
||||
public PipelineInstance start(PipelineRunMsg runMsg) {
|
||||
Agent agent;
|
||||
if (StringUtils.isEmpty(runMsg.getAgentId())){
|
||||
agent = agentService.findDefaultAgent();
|
||||
}else {
|
||||
agent = agentService.findAgent(runMsg.getAgentId());
|
||||
}
|
||||
if (Objects.isNull(agent)){
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(),"无法获取到流水线执行Agent!");
|
||||
}
|
||||
// TODO 需要引入新依赖,是重写还是直接引入
|
||||
// WebSocketSession session = SocketServerHandler.sessionMap.get(agent.getAddress());
|
||||
// if (Objects.isNull(session)){
|
||||
// throw new ApplicationException("流水线Agent断开连接,无法执行。");
|
||||
// }
|
||||
//
|
||||
// // 判断同一任务是否在运行
|
||||
Pipeline pipeline = validExecPipeline(runMsg);
|
||||
// String pipelineId = pipeline.getId();
|
||||
// pipelineIdOrAgentId.put(pipelineId, agent);
|
||||
|
||||
// 判断磁盘空间是否足够
|
||||
diskService.validationStorageSpace();
|
||||
|
||||
// 资源限制
|
||||
resourcesService.judgeResources();
|
||||
|
||||
// 进入执行
|
||||
runMsg.setPipeline(pipeline);
|
||||
runMsg.setAgent(agent);
|
||||
return beginExecPipeline(runMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 放入正在执行的流水线缓存中
|
||||
* @param runMsg 流水线id
|
||||
* @return 流水线信息
|
||||
*/
|
||||
public Pipeline validExecPipeline(PipelineRunMsg runMsg){
|
||||
String pipelineId = runMsg.getPipelineId();
|
||||
|
||||
List<Stage> allMainStage = stageService.findAllMainStage(pipelineId);
|
||||
if (allMainStage.isEmpty()){
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(),"当前流水线不存在可构建任务!");
|
||||
}
|
||||
|
||||
Boolean isVip = versionService.isVip();
|
||||
|
||||
Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
|
||||
int size = pipelineIdOrInstanceId.size();
|
||||
|
||||
// 资源限制放入缓存中等待执行
|
||||
if ((!isVip && size >= 2) || (isVip && size >= 4) ){
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(),"并行任务已满,等待执行!");
|
||||
}
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行流水线
|
||||
* @param runMsg 流水线信息
|
||||
* @return 流水线实例
|
||||
*/
|
||||
public PipelineInstance beginExecPipeline(PipelineRunMsg runMsg){
|
||||
String pipelineId = runMsg.getPipelineId();
|
||||
Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
pipeline.setState(2);
|
||||
pipelineService.updatePipeline(pipeline);
|
||||
runMsg.setPipeline(pipeline);
|
||||
|
||||
logger.info("流水线{}开始运行",pipeline.getName());
|
||||
PipelineInstance pipelineInstance = pipelineInstanceService.initializeInstance(runMsg);
|
||||
// 添加到缓存
|
||||
String instanceId = pipelineInstance.getInstanceId();
|
||||
pipelineInstanceService.instanceRuntime(pipelineInstance.getInstanceId());
|
||||
joinTemplate.joinQuery(pipelineInstance);
|
||||
|
||||
// 运行实例放入内存中
|
||||
pipelineIdOrInstanceId.put(pipelineId, instanceId);
|
||||
|
||||
try {
|
||||
// 创建多阶段运行实例
|
||||
List<Stage> stageList = stageExecService.createStageExecInstance(pipelineId, instanceId);
|
||||
|
||||
List<Postprocess> postprocessList = postExecService.createPipelinePostInstance(pipelineId, instanceId);
|
||||
|
||||
PipelineDetails pipelineDetails = new PipelineDetails();
|
||||
|
||||
// 流水线基本运行信息
|
||||
pipelineDetails.setPipelineId(pipelineId);
|
||||
pipelineDetails.setInstanceId(instanceId);
|
||||
pipelineDetails.setRunWay(runMsg.getRunWay());
|
||||
pipelineDetails.setAgent(runMsg.getAgent());
|
||||
|
||||
// 流水线运行任务
|
||||
pipelineDetails.setStageList(stageList);
|
||||
|
||||
// 流水线后置处理
|
||||
pipelineDetails.setPostprocessList(postprocessList);
|
||||
|
||||
// 数据路径,源码,日志保存
|
||||
String sourceDir = utilService.findPipelineDefaultAddress(pipelineId,1);
|
||||
String logDir = utilService.findPipelineDefaultAddress(pipelineId,2);
|
||||
pipelineDetails.setSourceDir(sourceDir);
|
||||
pipelineDetails.setLogDir(logDir);
|
||||
|
||||
// 环境
|
||||
List<Scm> scmList = scmService.findAllPipelineScm();
|
||||
pipelineDetails.setScmList(scmList);
|
||||
|
||||
// 变量
|
||||
List<Variable> variableList = variableService.findAllVariable(pipelineId);
|
||||
pipelineDetails.setVariableList(variableList);
|
||||
|
||||
AgentMessage agentMessage = new AgentMessage();
|
||||
agentMessage.setType("exec");
|
||||
agentMessage.setMessage(pipelineDetails);
|
||||
agentMessage.setPipelineId(pipelineId);
|
||||
|
||||
Agent agent = pipelineDetails.getAgent();
|
||||
|
||||
String id = agent.getAddress();
|
||||
// TODO 看看是否需要换个实现
|
||||
// WebSocketSession session = SocketServerHandler.sessionMap.get(id);
|
||||
// if (Objects.isNull(session)) {
|
||||
// throw new SystemException("客户端推送消息失败,无法获取客户端连接,客户端信息:"+id);
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// SocketServerHandler.instance().sendHandleMessage(id,agentMessage);
|
||||
// } catch (Exception e) {
|
||||
// throw new SystemException("客户端推送消息失败,错误信息:" + e.getMessage());
|
||||
// }
|
||||
}catch (Exception e){
|
||||
logger.error("流水线执行出错了:{}",e.getMessage() );
|
||||
stop(pipelineId);
|
||||
}
|
||||
return pipelineInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(String pipelineId){
|
||||
Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
|
||||
Agent agent = pipelineIdOrAgentId.get(pipelineId);
|
||||
if (Objects.isNull(agent)){
|
||||
pipeline.setState(1);
|
||||
pipelineService.updatePipeline(pipeline);
|
||||
|
||||
PipelineInstanceQuery pipelineInstanceQuery = new PipelineInstanceQuery();
|
||||
pipelineInstanceQuery.setState(PipelineFinal.RUN_RUN);
|
||||
pipelineInstanceQuery.setPipelineId(pipelineId);
|
||||
List<PipelineInstance> pipelineInstanceList = pipelineInstanceService.findPipelineInstanceList(pipelineInstanceQuery);
|
||||
for (PipelineInstance pipelineInstance : pipelineInstanceList) {
|
||||
String instanceId = pipelineInstance.getInstanceId();
|
||||
pipelineInstance.setRunStatus(PipelineFinal.RUN_HALT);
|
||||
int runtime = pipelineInstanceService.findInstanceRuntime(instanceId);
|
||||
pipelineInstance.setRunTime(runtime);
|
||||
pipelineInstanceService.updateInstance(pipelineInstance);
|
||||
}
|
||||
removeExecCache(pipelineId);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
AgentMessage agentMessage = new AgentMessage();
|
||||
agentMessage.setType("stop");
|
||||
agentMessage.setMessage(pipelineId);
|
||||
agentMessage.setPipelineId(pipelineId);
|
||||
// TODO 先放着
|
||||
// SocketServerHandler.instance().sendHandleMessage(agent.getAddress(),agentMessage);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
// 添加资源配置
|
||||
// resourcesService.instanceResources(integer);
|
||||
|
||||
// 更新流水线状态
|
||||
pipeline.setState(1);
|
||||
pipelineService.updatePipeline(pipeline);
|
||||
|
||||
PipelineInstanceQuery pipelineInstanceQuery = new PipelineInstanceQuery();
|
||||
pipelineInstanceQuery.setState(PipelineFinal.RUN_RUN);
|
||||
pipelineInstanceQuery.setPipelineId(pipelineId);
|
||||
List<PipelineInstance> pipelineInstanceList = pipelineInstanceService.findPipelineInstanceList(pipelineInstanceQuery);
|
||||
for (PipelineInstance pipelineInstance : pipelineInstanceList) {
|
||||
pipelineInstance.setRunStatus(PipelineFinal.RUN_HALT);
|
||||
int runtime = pipelineInstanceService.findInstanceRuntime(pipelineInstance.getInstanceId());
|
||||
pipelineInstance.setRunTime(runtime);
|
||||
pipelineInstanceService.updateInstance(pipelineInstance);
|
||||
}
|
||||
removeExecCache(pipelineId);
|
||||
}
|
||||
|
||||
public void removeExecCache(String pipelineId){
|
||||
String instanceId = pipelineIdOrInstanceId.get(pipelineId);
|
||||
PipelineInstanceServiceImpl.runTimeMap.remove(instanceId);
|
||||
pipelineInstanceService.stopThread(instanceId);
|
||||
pipelineIdOrInstanceId.remove(pipelineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keepOn(String pipelineId){
|
||||
Agent agent = pipelineIdOrAgentId.get(pipelineId);
|
||||
String id = agent.getAddress();
|
||||
AgentMessage agentMessage = new AgentMessage();
|
||||
agentMessage.setType("keepOn");
|
||||
agentMessage.setMessage(pipelineId);
|
||||
agentMessage.setPipelineId(pipelineId);
|
||||
//TODO
|
||||
// WebSocketSession session = SocketServerHandler.sessionMap.get(id);
|
||||
// if (Objects.isNull(session)) {
|
||||
// throw new SystemException("客户端推送消息失败,无法获取客户端连接,客户端信息:"+id);
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// SocketServerHandler.instance().sendHandleMessage(id,agentMessage);
|
||||
// } catch (Exception e) {
|
||||
// throw new SystemException("客户端推送消息失败,错误信息:" + e.getMessage());
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
package cd.casic.module.process.engine.task;
|
||||
|
||||
|
||||
public interface TasksCloneService {
|
||||
|
||||
|
||||
void clonePostTasks(String id, String cloneId);
|
||||
|
||||
void clonePipelineTasks(String id, String cloneId);
|
||||
|
||||
void cloneStageTasks(String id, String cloneId);
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package cd.casic.module.process.engine.task;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.job.Tasks;
|
||||
|
||||
/**
|
||||
* 任务执行服务接口
|
||||
*/
|
||||
public interface TasksExecService {
|
||||
|
||||
|
||||
/**
|
||||
* 创建任务或阶段运行实例
|
||||
*
|
||||
* @param task 任务运行信息
|
||||
* @param id 流水线实例id或阶段实例id或后置处理实例id
|
||||
* @param type 1.实例id 2.阶段id 3.后置处理实例id
|
||||
*/
|
||||
String createTaskExecInstance(Tasks task, String id, int type, String logPath);
|
||||
|
||||
|
||||
/**
|
||||
* 创建部署任务实例
|
||||
*
|
||||
* @param task 任务运行信息
|
||||
* @param taskInstanceId 任务实例id
|
||||
*/
|
||||
void createDeployInstance(Tasks task, String taskInstanceId);
|
||||
|
||||
}
|
@ -1,127 +0,0 @@
|
||||
package cd.casic.module.process.engine.task;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.job.TaskInstance;
|
||||
import cd.casic.ci.commons.bean.engine.job.TaskInstanceQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务执行实例服务接口
|
||||
*/
|
||||
public interface TasksInstanceService {
|
||||
|
||||
/**
|
||||
* 创建任务日志
|
||||
*
|
||||
* @param taskInstance 日志实体
|
||||
* @return 任务日志id
|
||||
*/
|
||||
String createTaskInstance(TaskInstance taskInstance);
|
||||
|
||||
/**
|
||||
* 删除实例下的运行实例
|
||||
*
|
||||
* @param instanceId 历史id
|
||||
*/
|
||||
void deleteAllInstanceInstance(String instanceId);
|
||||
|
||||
|
||||
List<String> findAllInstanceLogs(String instanceId);
|
||||
|
||||
/**
|
||||
* 删除阶段下的运行实例
|
||||
*
|
||||
* @param stageId 阶段id
|
||||
*/
|
||||
void deleteAllStageInstance(String stageId);
|
||||
|
||||
/**
|
||||
* 查询单个任务运行实例
|
||||
*
|
||||
* @param taskInstanceId 任务实例id
|
||||
* @return 任务运行实例
|
||||
*/
|
||||
TaskInstance findOneTaskInstance(String taskInstanceId);
|
||||
|
||||
/**
|
||||
* 更新任务运行实例
|
||||
*
|
||||
* @param taskInstance 任务实例模型
|
||||
*/
|
||||
void updateTaskInstance(TaskInstance taskInstance);
|
||||
|
||||
|
||||
/**
|
||||
* 查询流水线实例下的任务实例
|
||||
*
|
||||
* @param instanceId 实例id
|
||||
* @return 任务运行实例集合
|
||||
*/
|
||||
List<TaskInstance> findAllInstanceInstance(String instanceId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取流水线实例的后置任务信息
|
||||
*
|
||||
* @param instanceId 任务实例id
|
||||
* @return 后置任务信息
|
||||
*/
|
||||
TaskInstance findPostPipelineRunMessage(String instanceId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询阶段下的后置任务实例
|
||||
*
|
||||
* @param id 后置任务阶段id
|
||||
* @return 后置任务实例集合
|
||||
*/
|
||||
List<TaskInstance> findStagePostRunMessage(String id);
|
||||
|
||||
/**
|
||||
* 查询阶段下的任务运行实例
|
||||
*
|
||||
* @param stageId 阶段id
|
||||
* @return 任务运行实例集合
|
||||
*/
|
||||
List<TaskInstance> findAllStageInstance(String stageId);
|
||||
|
||||
/**
|
||||
* 添加任务执行日志
|
||||
*
|
||||
* @param taskId 任务id
|
||||
* @param log 日志
|
||||
*/
|
||||
void writeExecLog(String taskId, String log);
|
||||
|
||||
|
||||
void writeAllExecLog(String taskId, String execLog);
|
||||
|
||||
/**
|
||||
* 获取Command执行结果
|
||||
*
|
||||
* @param process Command执行实例
|
||||
* @param enCode Command编码
|
||||
* @param error Command错误编码
|
||||
* @param taskId 任务id
|
||||
* @return 执行结果 true:执行完成 false:执行失败
|
||||
*/
|
||||
boolean readCommandExecResult(Process process, String enCode, Map<String, String> error, String taskId);
|
||||
|
||||
|
||||
String validStatus(String s, Map<String, String> errors);
|
||||
|
||||
/**
|
||||
* 查询所有任务日志
|
||||
*
|
||||
* @return 任务日志列表
|
||||
*/
|
||||
List<TaskInstance> findAllTaskInstance();
|
||||
|
||||
|
||||
List<TaskInstance> findTaskInstanceList(TaskInstanceQuery query);
|
||||
|
||||
|
||||
List<TaskInstance> findAllInstanceList(List<String> idList);
|
||||
}
|
@ -1,179 +0,0 @@
|
||||
package cd.casic.module.process.engine.task;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.job.Tasks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线流任务服务接口
|
||||
*/
|
||||
public interface TasksService {
|
||||
|
||||
|
||||
/**
|
||||
* 创建任务及详情
|
||||
*
|
||||
* @param tasks 任务详情
|
||||
* @return 任务id
|
||||
*/
|
||||
String createTasksOrTask(Tasks tasks);
|
||||
|
||||
/**
|
||||
* 更新任务信息
|
||||
*
|
||||
* @param tasks 更新内容
|
||||
*/
|
||||
void updateTasksTask(Tasks tasks);
|
||||
|
||||
/**
|
||||
* 更新任务名称
|
||||
*
|
||||
* @param tasks 任务id
|
||||
*/
|
||||
void updateTaskName(Tasks tasks);
|
||||
|
||||
/**
|
||||
* 删除配置及任务
|
||||
*
|
||||
* @param tasksId 配置id
|
||||
*/
|
||||
void deleteTasksOrTask(String tasksId);
|
||||
|
||||
/**
|
||||
* 删除流水线所有配置及任务
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void deleteAllTasksOrTask(String pipelineId, int pipelineType);
|
||||
|
||||
/**
|
||||
* 获取流水线任务
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
* @return 任务列表
|
||||
*/
|
||||
List<Tasks> finAllPipelineTask(String pipelineId);
|
||||
|
||||
/**
|
||||
* 获取阶段任务
|
||||
*
|
||||
* @param stageId 阶段id
|
||||
* @return 任务列表
|
||||
*/
|
||||
List<Tasks> finAllStageTask(String stageId);
|
||||
|
||||
/**
|
||||
* 获取后置任务
|
||||
*
|
||||
* @param postId 阶段id
|
||||
* @return 任务列表
|
||||
*/
|
||||
Tasks findOnePostTask(String postId);
|
||||
|
||||
/**
|
||||
* 获取后置任务及任务详情
|
||||
*
|
||||
* @param postId 阶段id
|
||||
* @return 任务列表
|
||||
*/
|
||||
Tasks findOnePostTaskOrTask(String postId);
|
||||
|
||||
/**
|
||||
* 获取阶段任务及任务详情
|
||||
*
|
||||
* @param stageId 流水线
|
||||
* @return 任务列表
|
||||
*/
|
||||
List<Tasks> finStageTaskOrTask(String stageId);
|
||||
|
||||
/**
|
||||
* 获取阶段任务及任务详情
|
||||
*
|
||||
* @param stageId 流水线
|
||||
* @return 任务列表
|
||||
*/
|
||||
List<Tasks> finStageTaskOrTaskNoAuth(String stageId);
|
||||
|
||||
/**
|
||||
* 效验配置必填字段
|
||||
*
|
||||
* @param tasksList 任务
|
||||
* @return 配置id集合
|
||||
*/
|
||||
List<String> validTasksMustField(List<Tasks> tasksList);
|
||||
|
||||
|
||||
/**
|
||||
* 创建任务模板
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
* @param template 模板
|
||||
*/
|
||||
void createTaskTemplate(String pipelineId, String[] template);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param tasksId 任务id
|
||||
*/
|
||||
void deleteTasks(String tasksId);
|
||||
|
||||
/**
|
||||
* 查询单个任务
|
||||
*
|
||||
* @param tasksId 任务id
|
||||
* @return 任务
|
||||
*/
|
||||
Tasks findOneTasks(String tasksId);
|
||||
|
||||
/**
|
||||
* 查询单个任务及任务详情
|
||||
*
|
||||
* @param tasksId 任务id
|
||||
* @return 任务详细信息
|
||||
*/
|
||||
Tasks findOneTasksOrTask(String tasksId);
|
||||
|
||||
|
||||
/**
|
||||
* 划分任务类型
|
||||
*
|
||||
* @param taskType 任务类型
|
||||
* @return 任务类型
|
||||
*/
|
||||
String findTaskType(String taskType);
|
||||
|
||||
|
||||
String initDifferentTaskName(String taskType);
|
||||
|
||||
|
||||
List<Tasks> findAllTasks();
|
||||
|
||||
List<Tasks> findTasksList(List<String> idList);
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param tasks 任务
|
||||
*/
|
||||
void updateTasks(Tasks tasks);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,61 +0,0 @@
|
||||
package cd.casic.module.process.engine.task.dao;
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.job.TaskInstanceQuery;
|
||||
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cd.casic.module.process.engine.task.dataobject.TaskInstanceDo;
|
||||
import cd.casic.module.process.task.task.entity.TaskInstanceEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname TaskInstanceDao
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 16:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskInstanceDao extends BaseMapperX<TaskInstanceDo> {
|
||||
/**
|
||||
* 创建流水线日志
|
||||
* @param taskInstanceEntity 流水线历史日志
|
||||
* @return 流水线日志id
|
||||
*/
|
||||
public String createInstance(TaskInstanceEntity taskInstanceEntity);
|
||||
|
||||
/**
|
||||
* 删除流水线日志
|
||||
* @param id 流水线日志id
|
||||
*/
|
||||
public void deleteInstance(String id);
|
||||
|
||||
/**
|
||||
* 更新流水线日志
|
||||
* @param taskInstanceEntity 更新后流水线日志信息
|
||||
*/
|
||||
public void updateInstance(TaskInstanceEntity taskInstanceEntity);
|
||||
|
||||
/**
|
||||
* 查询流水线日志
|
||||
* @param id 查询id
|
||||
* @return 流水线日志信息
|
||||
*/
|
||||
public TaskInstanceEntity findOne(String id);
|
||||
|
||||
/**
|
||||
* 查询所有流水线日志
|
||||
* @return 流水线日志列表
|
||||
*/
|
||||
public List<TaskInstanceEntity> findAllInstance();
|
||||
|
||||
public List<TaskInstanceEntity> findStageInstance(String stageId);
|
||||
|
||||
public List<TaskInstanceEntity> findPipelineInstance(String instanceId);
|
||||
public List<TaskInstanceEntity> findTaskInstanceList(TaskInstanceQuery query);
|
||||
|
||||
|
||||
public List<TaskInstanceEntity> findPostInstance(String postprocessId);
|
||||
|
||||
|
||||
public List<TaskInstanceEntity> findAllInstanceList(List<String> idList);
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package cd.casic.module.process.engine.task.dao;
|
||||
|
||||
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname TasksDo
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 17:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface TasksDo extends BaseMapperX<TasksDo> {
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package cd.casic.module.process.engine.task.dataobject;
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 流水线日志
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "pip_task_instance", autoResultMap = true)
|
||||
public class TaskInstanceDo extends BaseDO {
|
||||
|
||||
//日志id
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String instanceId;
|
||||
|
||||
//运行类型
|
||||
private String taskType;
|
||||
|
||||
private int taskSort;
|
||||
|
||||
//运行日志
|
||||
private String logAddress;
|
||||
|
||||
//运行时间
|
||||
private int runTime;
|
||||
|
||||
//运行状态
|
||||
private String runState;
|
||||
|
||||
//阶段id
|
||||
private String stagesId;
|
||||
|
||||
//任务名称
|
||||
private String taskName;
|
||||
|
||||
private String postprocessId;
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package cd.casic.module.process.engine.task.dataobject;
|
||||
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 流水线顺序配置实体
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "pip_task", autoResultMap = true)
|
||||
public class TasksDo extends BaseDO {
|
||||
|
||||
//流水线配置id
|
||||
@TableId
|
||||
private String taskId;
|
||||
|
||||
//流水线
|
||||
private String pipelineId;
|
||||
|
||||
private String stageId;
|
||||
|
||||
private String postprocessId;
|
||||
|
||||
private String taskName;
|
||||
|
||||
//源码类型
|
||||
private String taskType;
|
||||
|
||||
//顺序
|
||||
private int taskSort;
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package cd.casic.module.process.home.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface HomeCountService {
|
||||
|
||||
|
||||
Map<String,Object> findCount();
|
||||
|
||||
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
package cd.casic.module.process.home.service;
|
||||
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流水线首页服务接口
|
||||
*/
|
||||
|
||||
public interface PipelineHomeService {
|
||||
|
||||
/**
|
||||
* 创建日志
|
||||
* @param logType 日志类型 (创建 create,删除 delete,执行 exec,更新 update)
|
||||
* @param map 日志信息
|
||||
*/
|
||||
void log(String logType, Map<String, Object> map);
|
||||
|
||||
|
||||
/**
|
||||
* 配置全局消息
|
||||
* @param templateId 方案id
|
||||
* @param map 信息
|
||||
*/
|
||||
void settingMessage(String templateId, Map<String, Object> map);
|
||||
|
||||
|
||||
/**
|
||||
* 创建消息
|
||||
* @param receiver 接收信息
|
||||
* @param map 信息
|
||||
*/
|
||||
void message(Map<String, Object> map, List<String> receiver);
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
* @param map 短信内容
|
||||
*/
|
||||
void smsMessage(Map<String,Object> map);
|
||||
|
||||
/**
|
||||
* 初始化消息,日志信息
|
||||
* @param pipeline 流水线
|
||||
* @return 信息
|
||||
*/
|
||||
Map<String,Object> initMap(Pipeline pipeline);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,159 +0,0 @@
|
||||
package cd.casic.module.process.home.service.impl;
|
||||
|
||||
|
||||
import cd.casic.module.process.home.service.HomeCountService;
|
||||
import cd.casic.module.process.licence.appauth.service.ApplyAuthService;
|
||||
import cd.casic.module.process.licence.licence.model.Version;
|
||||
import cd.casic.module.process.licence.licence.service.VersionService;
|
||||
import cd.casic.module.process.message.MessageNoticeService;
|
||||
import cd.casic.module.process.message.setting.MessageSendTypeService;
|
||||
import cd.casic.module.process.security.backups.service.BackupsDbService;
|
||||
import cd.casic.module.process.setting.service.*;
|
||||
import cd.casic.module.process.support.util.util.PipelineFinal;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class HomeCountServiceImpl implements HomeCountService {
|
||||
|
||||
|
||||
// @Resource
|
||||
// UserService userService;
|
||||
//
|
||||
// @Resource
|
||||
// OrgaService orgaService;
|
||||
//
|
||||
// @Resource
|
||||
// UserDirService userDirService;
|
||||
//
|
||||
// @Resource
|
||||
// UserGroupService userGroupService;
|
||||
//
|
||||
// @Resource
|
||||
// RoleService roleService;
|
||||
|
||||
@Resource
|
||||
MessageNoticeService noticeService;
|
||||
|
||||
@Resource
|
||||
MessageSendTypeService sendTypeService;
|
||||
|
||||
@Resource
|
||||
VersionService versionService;
|
||||
|
||||
@Resource
|
||||
ApplyAuthService applyAuthService;
|
||||
|
||||
@Resource
|
||||
BackupsDbService backupsDbService;
|
||||
|
||||
@Resource
|
||||
EnvService envService;
|
||||
|
||||
@Resource
|
||||
ScmService scmService;
|
||||
|
||||
@Resource
|
||||
GroupService groupService;
|
||||
|
||||
@Resource
|
||||
AuthService authService;
|
||||
|
||||
@Resource
|
||||
AuthHostService authHostService;
|
||||
|
||||
@Resource
|
||||
AuthThirdService authThirdService;
|
||||
|
||||
@Resource
|
||||
AuthHostGroupService authHostGroupService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> findCount(){
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
// TODO 用户相关先空置
|
||||
// Integer userNumber = userService.findUserNumber();
|
||||
// map.put("userNumber",userNumber);
|
||||
//
|
||||
// Integer orgaNumber = orgaService.findOrgaNumber();
|
||||
// map.put("orgaNumber",orgaNumber);
|
||||
//
|
||||
// Integer userDirNumber = userDirService.findUserDirNumber();
|
||||
// map.put("userDirNumber",userDirNumber);
|
||||
//
|
||||
// Integer userGroupNumber = userGroupService.findUserGroupNumber();
|
||||
// map.put("userGroupNumber",userGroupNumber);
|
||||
//
|
||||
// Integer roleNumber = roleService.findRoleNumber();
|
||||
// map.put("roleNumber",roleNumber);
|
||||
|
||||
Integer noticeNumber = noticeService.findNoticeNumber(PipelineFinal.appName);
|
||||
map.put("noticeNumber",noticeNumber);
|
||||
|
||||
Integer sendTypeNumber = sendTypeService.findSendTypeNumber();
|
||||
map.put("sendTypeNumber",sendTypeNumber);
|
||||
|
||||
Version version = versionService.getVersion();
|
||||
map.put("version",version.getExpired());
|
||||
|
||||
Integer applyAuthNumber = applyAuthService.findApplyAuthNumber();
|
||||
map.put("applyAuthNumber",applyAuthNumber);
|
||||
|
||||
String lastBackupsTime = backupsDbService.findLastBackupsTime();
|
||||
map.put("lastBackupsTime",lastBackupsTime);
|
||||
|
||||
Integer envNumber = envService.findEnvNumber();
|
||||
map.put("envNumber",envNumber);
|
||||
|
||||
Integer scmNumber = scmService.findScmNumber();
|
||||
map.put("scmNumber",scmNumber);
|
||||
|
||||
Integer groupNumber = groupService.findGroupNumber();
|
||||
map.put("groupNumber",groupNumber);
|
||||
|
||||
Integer authNumber = authService.findAuthNumber();
|
||||
map.put("authNumber",authNumber);
|
||||
|
||||
Integer hostNumber = authHostService.findHostNumber();
|
||||
map.put("hostNumber",hostNumber);
|
||||
|
||||
Integer serverNumber = authThirdService.findAuthServerNumber();
|
||||
map.put("serverNumber",serverNumber);
|
||||
|
||||
Integer hostGroupNumber = authHostGroupService.findHostGroupNumber();
|
||||
map.put("hostGroupNumber",hostGroupNumber);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,197 +0,0 @@
|
||||
package cd.casic.module.process.home.service.impl;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.module.process.home.service.PipelineHomeService;
|
||||
import cd.casic.module.process.message.message.SendMessageNoticeService;
|
||||
import cd.casic.module.process.message.message.model.Message;
|
||||
import cd.casic.module.process.message.message.model.MessageReceiver;
|
||||
import cd.casic.module.process.message.message.model.SendMessageNotice;
|
||||
import cd.casic.module.process.message.model.setting.MessageType;
|
||||
import cd.casic.module.process.security.logging.logging.model.Logging;
|
||||
import cd.casic.module.process.security.logging.logging.model.LoggingType;
|
||||
import cd.casic.module.process.security.logging.logging.service.LoggingByTempService;
|
||||
import cd.casic.module.process.support.util.util.PipelineFinal;
|
||||
import cd.casic.module.process.user.user.User;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class PipelineHomeServiceImpl implements PipelineHomeService {
|
||||
// @Resource
|
||||
// UserService userService;
|
||||
|
||||
@Resource
|
||||
LoggingByTempService logService;
|
||||
|
||||
@Resource
|
||||
SendMessageNoticeService dispatchNoticeService;
|
||||
|
||||
@Value("${base.url:null}")
|
||||
String baseUrl;
|
||||
|
||||
String appName = PipelineFinal.appName;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
public final ExecutorService executorService = Executors.newCachedThreadPool();
|
||||
|
||||
/**
|
||||
* 初始化消息,日志信息
|
||||
* @param pipeline 流水线
|
||||
* @return 信息
|
||||
*/
|
||||
@Override
|
||||
public HashMap<String,Object> initMap(Pipeline pipeline){
|
||||
HashMap<String,Object> map = new HashMap<>();
|
||||
// TODO 整合成我们自己的用户体系
|
||||
// String userId = LoginContext.getLoginId();
|
||||
// if (Objects.isNull(userId)){
|
||||
// userId = pipeline.getUser().getId();
|
||||
// }
|
||||
// User user = userService.findOne(userId);
|
||||
// map.put("pipelineId", pipeline.getId());
|
||||
// map.put("pipelineName", pipeline.getName());
|
||||
// map.put("userName", user.getName());
|
||||
// if (user.getNickname() != null){
|
||||
// map.put("userName", user.getNickname());
|
||||
// }
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建日志
|
||||
* @param logType 日志类型
|
||||
* @param map 日志信息
|
||||
*/
|
||||
@Override
|
||||
public void log(String logType, Map<String, Object> map){
|
||||
logger.info("创建日志......");
|
||||
executorService.submit(() -> {
|
||||
try {
|
||||
Logging log = new Logging();
|
||||
|
||||
//消息类型
|
||||
LoggingType opLogType = new LoggingType();
|
||||
opLogType.setId(logType);
|
||||
log.setActionType(opLogType);
|
||||
log.setModule("pipeline");
|
||||
|
||||
// //用户信息
|
||||
// String userId = LoginContext.getLoginId();
|
||||
// User user = userService.findOne(userId);
|
||||
|
||||
String link = (String) map.get("link");
|
||||
String pipelineName = (String) map.get("pipelineName");
|
||||
|
||||
// log.setUser(user);
|
||||
log.setLink(link);
|
||||
log.setAction(pipelineName);
|
||||
log.setBaseUrl(baseUrl);
|
||||
log.setBgroup(appName);
|
||||
log.setData(JSONObject.toJSONString(map));
|
||||
|
||||
logService.createLog(log);
|
||||
}catch (Exception e){
|
||||
logger.error("日志创建失败:{}",e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置全局消息
|
||||
* @param templateId 方案id
|
||||
* @param map 信息
|
||||
*/
|
||||
@Override
|
||||
public void settingMessage(String templateId,Map<String, Object> map){
|
||||
logger.info("发送消息......");
|
||||
executorService.submit(() -> {
|
||||
try {
|
||||
String link = (String) map.get("link");
|
||||
map.put("qywxurl", link);
|
||||
SendMessageNotice dispatchNotice = new SendMessageNotice();
|
||||
dispatchNotice.setId(templateId);
|
||||
String jsonString = JSONObject.toJSONString(map);
|
||||
dispatchNotice.setEmailData(jsonString);
|
||||
dispatchNotice.setDingdingData(jsonString);
|
||||
dispatchNotice.setSiteData(jsonString);
|
||||
dispatchNotice.setQywechatData(jsonString);
|
||||
dispatchNotice.setBaseUrl(baseUrl);
|
||||
String pipelineName = (String) map.get("pipelineName");
|
||||
dispatchNotice.setLink(link);
|
||||
dispatchNotice.setAction(pipelineName);
|
||||
// TODO 替换成系统自带的上下文
|
||||
// dispatchNotice.setSendId(LoginContext.getLoginId());
|
||||
if (!Objects.isNull(map.get("dmMessage")) && (Boolean)map.get("dmMessage")){
|
||||
String pipelineId = (String) map.get("pipelineId");
|
||||
dispatchNotice.setDomainId(pipelineId);
|
||||
dispatchNoticeService.sendDmMessageNotice(dispatchNotice);
|
||||
}else {
|
||||
dispatchNoticeService.sendMessageNotice(dispatchNotice);
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage());
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息(指定类型)
|
||||
* @param receiver 接收信息
|
||||
* @param map 信息
|
||||
*/
|
||||
@Override
|
||||
public void message(Map<String, Object> map, List<String> receiver){
|
||||
logger.info("发送指定类型消息......");
|
||||
Message message = new Message();
|
||||
|
||||
String sendWay = (String)map.get("sendWay");
|
||||
String mesType = (String)map.get("mesType");
|
||||
|
||||
//消息类型
|
||||
MessageType messageType = new MessageType();
|
||||
messageType.setId(mesType);
|
||||
message.setMessageType(messageType);
|
||||
|
||||
//发送方式
|
||||
message.setMessageSendTypeId(sendWay);
|
||||
message.setData(map);
|
||||
message.setBaseUrl(baseUrl);
|
||||
|
||||
List<MessageReceiver> list = new ArrayList<>();
|
||||
for (String s : receiver) {
|
||||
MessageReceiver messageReceiver = new MessageReceiver();
|
||||
messageReceiver.setUserId(s);
|
||||
messageReceiver.setPhone(s);
|
||||
messageReceiver.setEmail(s);
|
||||
list.add(messageReceiver);
|
||||
}
|
||||
message.setMessageReceiverList(list);
|
||||
// message.setSendId(LoginContext.getLoginId());
|
||||
String pipelineName = (String) map.get("pipelineName");
|
||||
message.setAction(pipelineName);
|
||||
dispatchNoticeService.sendMessage(message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
* @param map 短信内容
|
||||
*/
|
||||
@Override
|
||||
public void smsMessage(Map<String,Object> map){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package cd.casic.module.process.licence.appauth.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ApplyAuth {
|
||||
private Integer userNumber;
|
||||
private Integer residueNumber;
|
||||
private Integer allUserNumber;
|
||||
private List<ApplyAuthUser> userList;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package cd.casic.module.process.licence.appauth.model;
|
||||
|
||||
import cd.casic.module.process.user.user.User;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public class ApplyAuthUser {
|
||||
private String id;
|
||||
@NotNull
|
||||
// @Mappings({@Mapping(
|
||||
// source = "user.id",
|
||||
// target = "userId"
|
||||
// )})
|
||||
// @JoinQuery(
|
||||
// key = "id"
|
||||
// )
|
||||
private User user;
|
||||
private Integer type;
|
||||
private String state;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package cd.casic.module.process.licence.appauth.model;
|
||||
|
||||
import cd.casic.ci.commons.order.Order;
|
||||
import cd.casic.ci.commons.order.OrderBuilders;
|
||||
import cd.casic.framework.commons.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class ApplyAuthUserQuery {
|
||||
private String id;
|
||||
private String userId;
|
||||
private String state;
|
||||
private List<Order> orderParams = OrderBuilders.instance().desc("id").get();
|
||||
private PageParam pageParam = new PageParam();
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package cd.casic.module.process.licence.appauth.service;
|
||||
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.process.licence.appauth.model.ApplyAuth;
|
||||
import cd.casic.module.process.licence.appauth.model.ApplyAuthUser;
|
||||
import cd.casic.module.process.licence.appauth.model.ApplyAuthUserQuery;
|
||||
|
||||
public interface ApplyAuthService {
|
||||
ApplyAuth findApplyAuth();
|
||||
|
||||
Integer findApplyAuthNumber();
|
||||
|
||||
void createUserApplyAuth(String var1, String var2);
|
||||
|
||||
void addUserApplyAuth(String var1);
|
||||
|
||||
void deleteUserApplyAuth(String var1);
|
||||
|
||||
String findUserApplyAuth(String var1);
|
||||
|
||||
void removeUserApplyAuth(String var1);
|
||||
|
||||
PageResult<ApplyAuthUser> findApplyAuthPage(ApplyAuthUserQuery var1);
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package cd.casic.module.process.licence.licence.model;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Version {
|
||||
@NotNull
|
||||
private Integer release;
|
||||
@NotNull
|
||||
private Boolean expired;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package cd.casic.module.process.licence.licence.service;
|
||||
|
||||
import cd.casic.module.process.licence.licence.model.Version;
|
||||
|
||||
public interface VersionService {
|
||||
Version getVersion();
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package cd.casic.module.process.message;
|
||||
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.process.message.model.MessageNotice;
|
||||
import cd.casic.module.process.message.model.message.MessageNoticeQuery;
|
||||
import cd.casic.module.process.message.model.message.MessageSync;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MessageNoticeService {
|
||||
String createMessageNotice(@NotNull @Valid MessageNotice var1);
|
||||
|
||||
String cloneMessageNotice(String var1);
|
||||
|
||||
void updateMessageNotice(@NotNull @Valid MessageNotice var1);
|
||||
|
||||
void deleteMessageNotice(@NotNull String var1);
|
||||
|
||||
// @FindOne
|
||||
MessageNotice findOne(@NotNull String var1);
|
||||
|
||||
// @FindList
|
||||
List<MessageNotice> findList(List<String> var1);
|
||||
|
||||
void updateMessageNoticeState(String var1);
|
||||
|
||||
List<MessageNotice> findMessageNoticeList(MessageNoticeQuery var1);
|
||||
|
||||
PageResult<MessageNotice> findMessageNoticePage(MessageNoticeQuery var1);
|
||||
|
||||
void syncMessageNotice(MessageSync var1);
|
||||
|
||||
Integer findNoticeNumber(String var1);
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package cd.casic.module.process.message.message;
|
||||
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.process.message.message.model.MessageDmNotice;
|
||||
import cd.casic.module.process.message.message.model.MessageDmNoticeQuery;
|
||||
import cd.casic.module.process.message.message.model.MessageNoticePatch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MessageDmNoticeService {
|
||||
void initMessageDmNotice(MessageNoticePatch var1);
|
||||
|
||||
String createMessageDmNotice(MessageDmNotice var1);
|
||||
|
||||
void addMessageDmNotice(MessageDmNotice var1);
|
||||
|
||||
void updateMessageDmNotice(MessageDmNotice var1);
|
||||
|
||||
void deleteMessageDmNotice(String var1);
|
||||
|
||||
MessageDmNotice findOneMessageDmNotice(String var1);
|
||||
|
||||
List<MessageDmNotice> findAllMessageDmNotice();
|
||||
|
||||
void updateMessageDmNoticeState(String var1);
|
||||
|
||||
List<MessageDmNotice> findMessageDmNoticeList(List<String> var1);
|
||||
|
||||
List<MessageDmNotice> findMessageDmNoticeList(MessageDmNoticeQuery var1);
|
||||
|
||||
PageResult<MessageDmNotice> findMessageDmNoticePage(MessageDmNoticeQuery var1);
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package cd.casic.module.process.message.message;
|
||||
|
||||
import cd.casic.module.process.message.message.model.Message;
|
||||
import cd.casic.module.process.message.message.model.SendMessageNotice;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public interface SendMessageNoticeService {
|
||||
String sendMessageNotice(@NotNull @Valid SendMessageNotice var1);
|
||||
|
||||
String sendDmMessageNotice(SendMessageNotice var1);
|
||||
|
||||
String sendMessage(Message var1);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package cd.casic.module.process.message.message.model;
|
||||
|
||||
import cd.casic.module.process.message.model.setting.MessageType;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@Data
|
||||
public class Message {
|
||||
private String id;
|
||||
@NotNull
|
||||
// @Mappings({@Mapping(
|
||||
// source = "messageType.id",
|
||||
// target = "messageTypeId"
|
||||
// )})
|
||||
// @JoinQuery(
|
||||
// key = "id"
|
||||
// )
|
||||
private MessageType messageType;
|
||||
@NotNull
|
||||
private String baseUrl;
|
||||
private String messageSendTypeId;
|
||||
private Map<String, Object> data;
|
||||
private List<MessageReceiver> messageReceiverList = new ArrayList();
|
||||
private String link;
|
||||
private String action;
|
||||
private String sendId;
|
||||
private String receiverName;
|
||||
private String receiverAccent;
|
||||
private String sendUserName;
|
||||
private String sendUserAccent;
|
||||
private String otherMessage;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package cd.casic.module.process.message.message.model;
|
||||
|
||||
import cd.casic.module.process.message.model.MessageNotice;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MessageDmNotice {
|
||||
private String id;
|
||||
@NotNull
|
||||
// @Mappings({@Mapping(
|
||||
// source = "messageNotice.id",
|
||||
// target = "messageNoticeId"
|
||||
// )})
|
||||
// @JoinQuery(
|
||||
// key = "id"
|
||||
// )
|
||||
private MessageNotice messageNotice;
|
||||
private String domainId;
|
||||
private String sourceNoticeId;
|
||||
private String messageSendTypeId;
|
||||
private Boolean open;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package cd.casic.module.process.message.message.model;
|
||||
|
||||
import cd.casic.ci.commons.order.Order;
|
||||
import cd.casic.ci.commons.order.OrderBuilders;
|
||||
import cd.casic.framework.commons.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class MessageDmNoticeQuery {
|
||||
private String messageNoticeId;
|
||||
private String domainId;
|
||||
private String sourceNoticeId;
|
||||
private List<Order> orderParams = OrderBuilders.instance().desc("id").get();
|
||||
private PageParam pageParam = new PageParam();
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package cd.casic.module.process.message.message.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class MessageNoticePatch {
|
||||
private String messageNoticeId;
|
||||
private String domainId;
|
||||
private List<String> userGroupList = new ArrayList();
|
||||
private List<String> orgaList = new ArrayList();
|
||||
private List<String> userList = new ArrayList();
|
||||
private List<String> roleList = new ArrayList();
|
||||
private List<String> vRoleList = new ArrayList();
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package cd.casic.module.process.message.message.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MessageReceiver {
|
||||
private String userId;
|
||||
private String phone;
|
||||
private String email;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package cd.casic.module.process.message.message.model;
|
||||
|
||||
import cd.casic.module.process.privilege.vRole.model.VRoleDomain;
|
||||
import cd.casic.module.process.user.user.User;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class SendMessageNotice {
|
||||
private String id;
|
||||
private String siteData;
|
||||
private String emailData;
|
||||
private String qywechatData;
|
||||
private String dingdingData;
|
||||
private String appData;
|
||||
private String domainId;
|
||||
private VRoleDomain vRoleDomain = new VRoleDomain();
|
||||
@NotNull
|
||||
private String baseUrl;
|
||||
private String link;
|
||||
private String action;
|
||||
private String sendId;
|
||||
private List<User> userList;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package cd.casic.module.process.message.model;
|
||||
|
||||
import cd.casic.module.process.message.model.setting.MessageType;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MessageNotice {
|
||||
private String id;
|
||||
@NotNull
|
||||
// @Mappings({@Mapping(
|
||||
// source = "messageType.id",
|
||||
// target = "messageTypeId"
|
||||
// )})
|
||||
// @JoinQuery(
|
||||
// key = "id"
|
||||
// )
|
||||
private MessageType messageType;
|
||||
@NotNull
|
||||
private Integer type;
|
||||
@NotNull
|
||||
private String bgroup;
|
||||
private int scope = 1;
|
||||
@NotNull
|
||||
private String messageSendTypeId;
|
||||
private Boolean open;
|
||||
private List<String> sendTypeList;
|
||||
private List<String> groupList;
|
||||
private List<String> orgaList;
|
||||
private List<String> userList;
|
||||
private List<String> roleList;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package cd.casic.module.process.message.model.message;
|
||||
|
||||
import cd.casic.ci.commons.order.Order;
|
||||
import cd.casic.ci.commons.order.OrderBuilders;
|
||||
import cd.casic.framework.commons.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class MessageNoticeQuery implements Serializable {
|
||||
private String messageTypeId;
|
||||
private String messageSendTypeId;
|
||||
private Integer type;
|
||||
private int scope = 1;
|
||||
private String bgroup;
|
||||
private List<Order> orderParams = OrderBuilders.instance().desc("type").get();
|
||||
private PageParam pageParam = new PageParam();
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package cd.casic.module.process.message.model.message;
|
||||
|
||||
import cd.casic.module.process.message.model.MessageNotice;
|
||||
import cd.casic.module.process.message.model.setting.MessageType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class MessageSync {
|
||||
private String id;
|
||||
private String bGroup;
|
||||
private List<MessageTemplate> messageTemplateList;
|
||||
private List<MessageType> messageTypeList;
|
||||
private List<MessageNotice> messageNoticeList;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package cd.casic.module.process.message.model.message;
|
||||
|
||||
import cd.casic.module.process.message.model.setting.MessageSendType;
|
||||
import cd.casic.module.process.message.model.setting.MessageType;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MessageTemplate {
|
||||
private String id;
|
||||
@NotNull
|
||||
// @Mappings({@Mapping(
|
||||
// source = "msgType.id",
|
||||
// target = "msgTypeId"
|
||||
// )})
|
||||
// @JoinQuery(
|
||||
// key = "id"
|
||||
// )
|
||||
private MessageType msgType;
|
||||
@NotNull
|
||||
// @Mappings({@Mapping(
|
||||
// source = "msgSendType.id",
|
||||
// target = "msgSendTypeId"
|
||||
// )})
|
||||
// @JoinQuery(
|
||||
// key = "id"
|
||||
// )
|
||||
private MessageSendType msgSendType;
|
||||
private String title;
|
||||
private String content;
|
||||
private String link;
|
||||
private String linkParams;
|
||||
private String bgroup;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package cd.casic.module.process.message.model.setting;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public class MessageSendType {
|
||||
@NotNull
|
||||
private String id;
|
||||
@NotNull
|
||||
private String name;
|
||||
private String desc;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package cd.casic.module.process.message.model.setting;
|
||||
|
||||
import cd.casic.ci.commons.order.Order;
|
||||
import cd.casic.ci.commons.order.OrderBuilders;
|
||||
import cd.casic.framework.commons.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class MessageSendTypeQuery {
|
||||
private String name;
|
||||
private List<Order> orderParams = OrderBuilders.instance().asc("name").get();
|
||||
private PageParam pageParam = new PageParam();
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package cd.casic.module.process.message.model.setting;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MessageType {
|
||||
private String id;
|
||||
@NotNull
|
||||
private String name;
|
||||
private String desc;
|
||||
private String bgroup;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package cd.casic.module.process.message.setting;
|
||||
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.process.message.model.setting.MessageSendType;
|
||||
import cd.casic.module.process.message.model.setting.MessageSendTypeQuery;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MessageSendTypeService {
|
||||
String createMessageSendType(@NotNull @Valid MessageSendType var1);
|
||||
|
||||
void updateMessageSendType(@NotNull @Valid MessageSendType var1);
|
||||
|
||||
void deleteMessageSendType(@NotNull String var1);
|
||||
|
||||
// @FindOne
|
||||
MessageSendType findOne(@NotNull String var1);
|
||||
|
||||
// @FindList
|
||||
List<MessageSendType> findList(List<String> var1);
|
||||
|
||||
MessageSendType findMessageSendType(@NotNull String var1);
|
||||
|
||||
// @FindAll
|
||||
List<MessageSendType> findAllMessageSendType();
|
||||
|
||||
List<MessageSendType> findMessageSendTypeList(MessageSendTypeQuery var1);
|
||||
|
||||
PageResult<MessageSendType> findMessageSendTypePage(MessageSendTypeQuery var1);
|
||||
|
||||
Integer findSendTypeNumber();
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition;
|
||||
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollow;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollowQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线收藏服务接口
|
||||
*/
|
||||
public interface PipelineFollowService {
|
||||
|
||||
/**
|
||||
* 创建收藏
|
||||
* @param pipelineFollow 收藏模型
|
||||
*/
|
||||
void updateFollow(PipelineFollow pipelineFollow);
|
||||
|
||||
/**
|
||||
* 获取用户收藏的流水线
|
||||
* @param userId 用户id
|
||||
* @return 收藏的流水线
|
||||
*/
|
||||
List<PipelineFollow> findUserFollowPipeline(String userId);
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
* @param followQuery 条件
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<PipelineFollow> findFollowQueryList(PipelineFollowQuery followQuery);
|
||||
|
||||
/**
|
||||
* 删除收藏
|
||||
* @param followId 收藏id
|
||||
*/
|
||||
void deleteFollow(String followId);
|
||||
|
||||
|
||||
void deletePipelineFollow(String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询单个信息
|
||||
* @param followId 收藏id
|
||||
* @return 收藏信息
|
||||
*/
|
||||
PipelineFollow findOneFollow(String followId);
|
||||
|
||||
/**
|
||||
* 查询所有收藏
|
||||
* @return 收藏集合
|
||||
*/
|
||||
List<PipelineFollow> findAllFollow();
|
||||
|
||||
List<PipelineFollow> findAllFollowList(List<String> idList);
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition;
|
||||
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineOpen;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线最近打开服务接口
|
||||
*/
|
||||
// todo
|
||||
//@JoinProvider(model = PipelineOpen.class)
|
||||
public interface PipelineOpenService {
|
||||
|
||||
/**
|
||||
* 查询用户最近打开流水线(详细信息)
|
||||
* @param number 查询数量
|
||||
* @return 最近打开的流水线
|
||||
*/
|
||||
List<PipelineOpen> findUserAllOpen(int number);
|
||||
|
||||
/**
|
||||
* 查询用户最近打开流水线
|
||||
* @param number 查询数量
|
||||
* @return 最近打开的流水线
|
||||
*/
|
||||
List<String> findUserOpen(int number);
|
||||
|
||||
/**
|
||||
* 删除流水线收藏
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void deleteAllOpen(String pipelineId);
|
||||
|
||||
/**
|
||||
* 获取打开的流水线
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void updatePipelineOpen(String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询单个次数信息
|
||||
* @param openId 次数id
|
||||
* @return 次数信息
|
||||
*/
|
||||
// @FindOne
|
||||
PipelineOpen findOneOpen(String openId);
|
||||
|
||||
/**
|
||||
* 查询所有次数
|
||||
* @return 次数集合
|
||||
*/
|
||||
// @FindAll
|
||||
List<PipelineOpen> findAllOpen();
|
||||
|
||||
// @FindList
|
||||
List<PipelineOpen> findAllOpenList(List<String> idList);
|
||||
|
||||
}
|
@ -1,165 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineQuery;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineRecently;
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线服务接口
|
||||
*/
|
||||
//@JoinProvider(model = Pipeline.class)
|
||||
public interface PipelineService {
|
||||
|
||||
/**
|
||||
* 创建流水线
|
||||
* @param pipeline 流水线信息
|
||||
* @return 流水线id
|
||||
*/
|
||||
String createPipeline(@NotNull @Valid Pipeline pipeline);
|
||||
|
||||
/**
|
||||
* 删除流水线
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void deletePipeline(@NotNull String pipelineId);
|
||||
|
||||
/**
|
||||
* 更新流水线
|
||||
* @param pipeline 更新后流水线信息
|
||||
*/
|
||||
void updatePipeline(@NotNull @Valid Pipeline pipeline);
|
||||
|
||||
/**
|
||||
* 查询单个流水线
|
||||
* @param pipelineId 流水线id
|
||||
* @return 流水线信息
|
||||
*/
|
||||
// @FindOne
|
||||
Pipeline findPipelineById(@NotNull String pipelineId);
|
||||
|
||||
|
||||
Pipeline findPipelineByIdNoQuery(String pipelineId);
|
||||
|
||||
/**
|
||||
* 该接口返回用户流水线
|
||||
* @param pipelineId 流水线Id
|
||||
* @return 流水线
|
||||
*/
|
||||
Pipeline findOnePipeline(String pipelineId);
|
||||
|
||||
/**
|
||||
* 该接口返回用户流水线
|
||||
* @param pipelineId 流水线Id
|
||||
* @return 流水线
|
||||
*/
|
||||
Pipeline findPipelineNoQuery(String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询所有流水线
|
||||
* @return 流水线列表
|
||||
*/
|
||||
// @FindAll
|
||||
List<Pipeline> findAllPipeline();
|
||||
|
||||
|
||||
List<Pipeline> findAllPipelineNoQuery();
|
||||
|
||||
// @FindList
|
||||
List<Pipeline> findAllPipelineList(List<String> idList);
|
||||
|
||||
/**
|
||||
* 获取用户流水线
|
||||
* @return 流水线信息
|
||||
*/
|
||||
List<Pipeline> findUserPipeline(PipelineQuery query);
|
||||
|
||||
/**
|
||||
* 分页查询流水线信息
|
||||
* @param query 查询条件
|
||||
* @return 流水线信息
|
||||
*/
|
||||
PageResult<Pipeline> findUserPipelinePage(PipelineQuery query);
|
||||
|
||||
|
||||
List<Pipeline> findPipelineList(PipelineQuery query);
|
||||
|
||||
|
||||
/**
|
||||
* 查询拥有此流水线的用户
|
||||
* @param pipelineId 流水线id
|
||||
* @return 用户信息
|
||||
*/
|
||||
// todo 当前系统不知道有无用户先注释掉
|
||||
// List<User> findPipelineUser(String pipelineId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前用户最近构建的流水线
|
||||
* @return 流水线信息
|
||||
*/
|
||||
List<PipelineRecently> findPipelineRecently(String userId, int number);
|
||||
|
||||
|
||||
/**
|
||||
* 获取clone的流水线名称
|
||||
* @param pipelineId 流水线ID
|
||||
* @return 流水线民初
|
||||
*/
|
||||
String findPipelineCloneName(String pipelineId);
|
||||
|
||||
|
||||
/**
|
||||
* 流水线克隆
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void pipelineClone(String pipelineId,String pipelineName);
|
||||
|
||||
|
||||
/**
|
||||
* 获取最近打开的流水线
|
||||
* @param number 数量
|
||||
* @return 流水线
|
||||
*/
|
||||
List<Pipeline> findRecentlyPipeline(Integer number,String pipelineId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition;
|
||||
|
||||
public interface PipelineYamlService {
|
||||
|
||||
String importPipelineYaml(String pipelineId);
|
||||
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PipelineEntity {
|
||||
//流水线id
|
||||
// @Id
|
||||
// @GeneratorValue(length = 12)
|
||||
// @Column(name = "id")
|
||||
private String id;
|
||||
|
||||
//流水线名称
|
||||
// @Column(name = "name")
|
||||
private String name;
|
||||
|
||||
//流水线创建人
|
||||
// @Column(name = "user_id")
|
||||
private String userId;
|
||||
|
||||
//流水线创建时间
|
||||
// @Column(name = "create_time")
|
||||
private String createTime;
|
||||
|
||||
//流水线类型 1.多任务 2.多阶段
|
||||
// @Column(name = "type")
|
||||
private int type;
|
||||
|
||||
//运行状态 1.运行中 2.停止中
|
||||
// @Column(name = "state")
|
||||
private int state;
|
||||
|
||||
//项目作用域 1.全局 2.项目
|
||||
// @Column(name = "power")
|
||||
private int power;
|
||||
|
||||
//颜色 1~5随机生成
|
||||
// @Column(name="color")
|
||||
private int color;
|
||||
|
||||
// @Column(name="env_id")
|
||||
private String envId;
|
||||
|
||||
// @Column(name="group_id")
|
||||
private String groupId;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
//@Table(name="pip_other_follow")
|
||||
@Data
|
||||
public class PipelineFollowEntity {
|
||||
// @Id
|
||||
// @GeneratorValue(length = 12)
|
||||
// @Column(name = "id")
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
// @Column(name = "pipeline_id")
|
||||
private String pipelineId;
|
||||
|
||||
// @Column(name = "user_id")
|
||||
private String userId ;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
//@Entity
|
||||
//@Table(name="pip_other_open")
|
||||
@Data
|
||||
public class PipelineOpenEntity {
|
||||
|
||||
// @Id
|
||||
// @GeneratorValue(length = 12)
|
||||
// @Column(name = "open_id")
|
||||
private String openId;
|
||||
|
||||
// @Column(name = "pipeline_id")
|
||||
private String pipelineId;
|
||||
|
||||
//打开次数
|
||||
// @Column(name = "number")
|
||||
private int number ;
|
||||
|
||||
// @Column(name = "user_id")
|
||||
private String userId ;
|
||||
|
||||
// @Column(name = "create_time")
|
||||
private String createTime;
|
||||
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.impl;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollow;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollowQuery;
|
||||
import cd.casic.ci.commons.utils.PipelineUtil;
|
||||
import cd.casic.framework.commons.exception.ServiceException;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineFollowEntity;
|
||||
import cd.casic.module.process.process.definition.PipelineFollowService;
|
||||
import cd.casic.module.process.process.definition.dao.PipelineFollowDao;
|
||||
import cd.casic.module.process.toolkit.beans.BeanMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class PipelineFollowServiceImpl implements PipelineFollowService {
|
||||
@Resource
|
||||
PipelineFollowDao pipelineFollowDao;
|
||||
|
||||
@Override
|
||||
public void updateFollow(PipelineFollow pipelineFollow) {
|
||||
Pipeline pipeline = pipelineFollow.getPipeline();
|
||||
String pipelineId = pipeline.getId();
|
||||
if (!PipelineUtil.isNoNull(pipelineId)){
|
||||
throw new ServiceException(50001,"流水线id不能为空。");
|
||||
}
|
||||
// TODO
|
||||
// String userId = LoginContext.getLoginId();
|
||||
String userId = "";
|
||||
List<PipelineFollowEntity> list =
|
||||
pipelineFollowDao.findOneUserFollowPipeline(userId, pipelineId);
|
||||
//用户为收藏该流水线
|
||||
if (list.isEmpty()){
|
||||
PipelineFollowEntity followEntity = BeanMapper.map(pipelineFollow, PipelineFollowEntity.class);
|
||||
followEntity.setUserId(userId);
|
||||
String follow = pipelineFollowDao.createFollow(followEntity);
|
||||
if (!PipelineUtil.isNoNull(follow)){
|
||||
throw new ServiceException(50001,"收藏失败");
|
||||
}
|
||||
//用户已收藏该流水线
|
||||
}else {
|
||||
deleteFollow(list.get(0).getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineFollow> findUserFollowPipeline(String userId){
|
||||
List<PipelineFollowEntity> list =
|
||||
pipelineFollowDao.findUserFollowPipeline(userId);
|
||||
return BeanMapper.mapList(list, PipelineFollow.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineFollow> findFollowQueryList(PipelineFollowQuery followQuery){
|
||||
List<PipelineFollowEntity> list =
|
||||
pipelineFollowDao.findFollowQueryList(followQuery);
|
||||
if (list == null || list.isEmpty()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return BeanMapper.mapList(list, PipelineFollow.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFollow(String followId) {
|
||||
pipelineFollowDao.deleteFollow(followId);
|
||||
}
|
||||
|
||||
|
||||
public void deletePipelineFollow(String pipelineId){
|
||||
PipelineFollowQuery followQuery = new PipelineFollowQuery();
|
||||
followQuery.setPipelineId(pipelineId);
|
||||
List<PipelineFollowEntity> list = pipelineFollowDao.findFollowQueryList(followQuery);
|
||||
|
||||
for (PipelineFollowEntity pipelineFollowEntity : list) {
|
||||
deleteFollow(pipelineFollowEntity.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipelineFollow findOneFollow(String followId) {
|
||||
return BeanMapper.map(pipelineFollowDao.findOneFollow(followId), PipelineFollow.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineFollow> findAllFollow() {
|
||||
return BeanMapper.mapList(pipelineFollowDao.findAllFollow(), PipelineFollow.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineFollow> findAllFollowList(List<String> idList) {
|
||||
List<PipelineFollowEntity> followList = pipelineFollowDao.findAllFollowList(idList);
|
||||
return BeanMapper.mapList(followList, PipelineFollow.class);
|
||||
}
|
||||
}
|
@ -1,196 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.impl;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineOpen;
|
||||
import cd.casic.ci.commons.bean.support.count.PipelineOverview;
|
||||
import cd.casic.ci.commons.utils.PipelineUtil;
|
||||
import cd.casic.module.process.pipeline.definition.PipelineOpenService;
|
||||
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineEntity;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineOpenEntity;
|
||||
import cd.casic.module.process.pipeline.overview.service.PipelineOverviewService;
|
||||
import cd.casic.module.process.process.definition.dao.PipelineDao;
|
||||
import cd.casic.module.process.process.definition.dao.PipelineOpenDao;
|
||||
import cd.casic.module.process.support.authority.service.PipelineAuthorityService;
|
||||
import cd.casic.module.process.toolkit.beans.BeanMapper;
|
||||
import cd.casic.module.process.toolkit.join.JoinTemplate;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
//@Exporter
|
||||
public class PipelineOpenServiceImpl implements PipelineOpenService {
|
||||
|
||||
@Resource
|
||||
PipelineOpenDao pipelineOpenDao;
|
||||
|
||||
@Resource
|
||||
PipelineAuthorityService authorityService;
|
||||
|
||||
@Resource
|
||||
PipelineOverviewService overviewService;
|
||||
|
||||
@Resource
|
||||
JoinTemplate joinTemplate;
|
||||
|
||||
@Resource
|
||||
PipelineDao pipelineDao;
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteAllOpen(String pipelineId){
|
||||
List<PipelineOpen> allOpen = findAllOpenNoQuery();
|
||||
if (allOpen.isEmpty()){
|
||||
return;
|
||||
}
|
||||
for (PipelineOpen pipelineOpen : allOpen) {
|
||||
Pipeline pipeline = pipelineOpen.getPipeline();
|
||||
if (!pipeline.getId().equals(pipelineId)){
|
||||
continue;
|
||||
}
|
||||
deleteOpen(pipelineOpen.getOpenId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePipelineOpen(String pipelineId) {
|
||||
if (pipelineId.equals("undefined")){
|
||||
return;
|
||||
}
|
||||
// TODO
|
||||
// String userId = LoginContext.getLoginId();
|
||||
String userId = "";
|
||||
PipelineOpen pipelineOpen = new PipelineOpen();
|
||||
pipelineOpen.setPipeline(new Pipeline(pipelineId));
|
||||
pipelineOpen.setCreateTime(PipelineUtil.date(1));
|
||||
pipelineOpen.setUserId(userId);
|
||||
createOpen(pipelineOpen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipelineOpen findOneOpen(String openId) {
|
||||
PipelineOpenEntity openEntity = pipelineOpenDao.findOneOpen(openId);
|
||||
PipelineOpen pipelineOpen = BeanMapper.map(openEntity, PipelineOpen.class);
|
||||
joinTemplate.joinQuery(pipelineOpen);
|
||||
return pipelineOpen;
|
||||
}
|
||||
|
||||
public PipelineOpen findOneOpenNoQuery(String openId) {
|
||||
PipelineOpenEntity openEntity = pipelineOpenDao.findOneOpen(openId);
|
||||
return BeanMapper.map(openEntity, PipelineOpen.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineOpen> findAllOpen() {
|
||||
List<PipelineOpenEntity> allOpen = pipelineOpenDao.findAllOpen();
|
||||
if (Objects.isNull(allOpen)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<PipelineOpen> list = BeanMapper.mapList(allOpen, PipelineOpen.class);
|
||||
joinTemplate.joinQuery(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<PipelineOpen> findAllOpenNoQuery() {
|
||||
List<PipelineOpenEntity> allOpen = pipelineOpenDao.findAllOpen();
|
||||
if (Objects.isNull(allOpen)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return BeanMapper.mapList(allOpen, PipelineOpen.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineOpen> findAllOpenList(List<String> idList) {
|
||||
List<PipelineOpenEntity> openList = pipelineOpenDao.findAllOpenList(idList);
|
||||
return BeanMapper.mapList(openList, PipelineOpen.class);
|
||||
}
|
||||
|
||||
//更新最近打开
|
||||
private void updateOpen(PipelineOpen pipelineOpen) {
|
||||
pipelineOpenDao.updateOpen(BeanMapper.map(pipelineOpen, PipelineOpenEntity.class));
|
||||
}
|
||||
|
||||
//删除最近打开
|
||||
private void deleteOpen(String openId) {
|
||||
pipelineOpenDao.deleteOpen(openId);
|
||||
}
|
||||
|
||||
//创建最近打开
|
||||
private void createOpen(PipelineOpen pipelineOpen) {
|
||||
pipelineOpenDao.createOpen(BeanMapper.map(pipelineOpen, PipelineOpenEntity.class));
|
||||
}
|
||||
|
||||
public List<String> findUserOpen(int number){
|
||||
// 获取用户流水线
|
||||
// TODO
|
||||
// String userId = LoginContext.getLoginId();
|
||||
String userId = "";
|
||||
String[] userPipeline = authorityService.findUserPipelineIdString(userId);
|
||||
if (userPipeline.length == 0){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < userPipeline.length; i++) {
|
||||
builder.append("'").append(userPipeline[i]).append("'");
|
||||
if (i != userPipeline.length-1){
|
||||
builder.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
List<String> pipelineIds = pipelineOpenDao.findUserOpen(userId, number,builder.toString());
|
||||
if (pipelineIds.isEmpty()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return pipelineIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流水线最近打开
|
||||
* @param number 查询数量
|
||||
* @return 最近打开的流水线
|
||||
*/
|
||||
@Override
|
||||
public List<PipelineOpen> findUserAllOpen(int number) {
|
||||
|
||||
// 获取用户流水线
|
||||
// String userId = LoginContext.getLoginId();
|
||||
String userId = "";
|
||||
|
||||
List<String> pipelineIds = findUserOpen(number);
|
||||
if (pipelineIds.isEmpty()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<PipelineOpen> openList = new ArrayList<>();
|
||||
|
||||
for (String pipelineId : pipelineIds) {
|
||||
PipelineOpen pipelineOpen = new PipelineOpen();
|
||||
|
||||
PipelineEntity pipelineEntity = pipelineDao.findPipelineById(pipelineId);
|
||||
Pipeline pipeline = BeanMapper.map(pipelineEntity, Pipeline.class);
|
||||
pipelineOpen.setPipeline(pipeline);
|
||||
|
||||
Integer openNumber = pipelineOpenDao.findUserOpenNumber(userId, pipelineId);
|
||||
pipelineOpen.setNumber(openNumber);
|
||||
|
||||
PipelineOverview pipelineOverview = overviewService.pipelineOverview(pipelineId);
|
||||
pipelineOpen.setPipelineExecState(pipelineOverview);
|
||||
|
||||
if (Objects.isNull(pipeline) || Objects.isNull(pipeline.getName())){
|
||||
deleteOpen(pipelineOpen.getOpenId());
|
||||
continue;
|
||||
}
|
||||
|
||||
openList.add(pipelineOpen);
|
||||
}
|
||||
return openList;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,628 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.impl;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.*;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstance;
|
||||
import cd.casic.ci.commons.utils.PipelineFileUtil;
|
||||
import cd.casic.ci.commons.utils.PipelineUtil;
|
||||
import cd.casic.framework.commons.exception.ServiceException;
|
||||
import cd.casic.framework.commons.exception.enums.GlobalErrorCodeConstants;
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.process.engine.task.TasksCloneService;
|
||||
import cd.casic.module.process.engine.task.TasksService;
|
||||
import cd.casic.module.process.home.service.PipelineHomeService;
|
||||
import cd.casic.module.process.message.message.MessageDmNoticeService;
|
||||
import cd.casic.module.process.message.message.model.MessageNoticePatch;
|
||||
import cd.casic.module.process.pipeline.definition.PipelineFollowService;
|
||||
import cd.casic.module.process.pipeline.definition.PipelineOpenService;
|
||||
import cd.casic.module.process.pipeline.definition.PipelineService;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineEntity;
|
||||
|
||||
import cd.casic.module.process.support.variable.service.VariableService;
|
||||
import cd.casic.module.process.process.definition.dao.PipelineDao;
|
||||
import cd.casic.module.process.process.instance.PipelineInstanceService;
|
||||
import cd.casic.module.process.process.stage.StageService;
|
||||
import cd.casic.module.process.support.authority.service.PipelineAuthorityService;
|
||||
import cd.casic.module.process.support.condition.service.ConditionService;
|
||||
import cd.casic.module.process.support.postprocess.service.PostprocessService;
|
||||
import cd.casic.module.process.support.trigger.service.TriggerService;
|
||||
import cd.casic.module.process.support.util.PipelineUtilService;
|
||||
import cd.casic.module.process.support.util.util.PipelineFinal;
|
||||
import cd.casic.module.process.toolkit.beans.BeanMapper;
|
||||
import cd.casic.module.process.toolkit.join.JoinTemplate;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class PipelineServiceImpl implements PipelineService {
|
||||
@Resource
|
||||
JoinTemplate joinTemplate;
|
||||
|
||||
// @Resource
|
||||
// UserService userService;
|
||||
|
||||
@Resource
|
||||
PipelineDao pipelineDao;
|
||||
|
||||
@Resource
|
||||
PipelineInstanceService instanceService;
|
||||
|
||||
@Resource
|
||||
PipelineHomeService homeService;
|
||||
|
||||
@Resource
|
||||
PipelineAuthorityService authorityService;
|
||||
|
||||
@Resource
|
||||
TasksService tasksService;
|
||||
|
||||
@Resource
|
||||
TasksCloneService tasksCloneService;
|
||||
|
||||
@Resource
|
||||
StageService stageService;
|
||||
|
||||
@Resource
|
||||
PipelineFollowService followService;
|
||||
|
||||
@Resource
|
||||
PipelineUtilService utilService;
|
||||
|
||||
@Resource
|
||||
PipelineOpenService openService;
|
||||
|
||||
@Resource
|
||||
PostprocessService postprocessService;
|
||||
|
||||
@Resource
|
||||
TriggerService triggerService;
|
||||
|
||||
@Resource
|
||||
VariableService variableService;
|
||||
|
||||
@Resource
|
||||
ConditionService conditionService;
|
||||
|
||||
@Resource
|
||||
MessageDmNoticeService messageDmNoticeService;
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(PipelineServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public String createPipeline(Pipeline pipeline) {
|
||||
//随机颜色
|
||||
Random random ;
|
||||
try {
|
||||
random = SecureRandom.getInstanceStrong();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new ServiceException();
|
||||
}
|
||||
pipeline.setColor((random.nextInt(5) + 1));
|
||||
pipeline.setCreateTime(PipelineUtil.date(1));
|
||||
// if (Objects.isNull(pipeline.getUser()) || StringUtils.isEmpty(pipeline.getUser().getId())){
|
||||
// String loginId = LoginContext.getLoginId();
|
||||
// pipeline.setUser(new User(loginId));
|
||||
// }
|
||||
|
||||
//创建流水线
|
||||
PipelineEntity pipelineEntity = BeanMapper.map(pipeline, PipelineEntity.class);
|
||||
pipelineEntity.setState(1);
|
||||
String pipelineId = pipelineDao.createPipeline(pipelineEntity);
|
||||
joinTemplate.joinQuery(pipeline);
|
||||
pipeline.setId(pipelineId);
|
||||
|
||||
//创建对应流水线模板
|
||||
String template = pipeline.getTemplate();
|
||||
String[] ints;
|
||||
switch (template) {
|
||||
case "2131" -> ints =
|
||||
new String[]{PipelineFinal.TASK_CODE_GIT, PipelineFinal.TASK_BUILD_MAVEN, PipelineFinal.TASK_DEPLOY_LINUX};
|
||||
case "112131" -> ints =
|
||||
new String[]{PipelineFinal.TASK_CODE_GIT, PipelineFinal.TASK_TEST_MAVENTEST, PipelineFinal.TASK_BUILD_MAVEN, PipelineFinal.TASK_DEPLOY_LINUX};
|
||||
case "2231" -> ints =
|
||||
new String[]{PipelineFinal.TASK_CODE_GIT, PipelineFinal.TASK_TEST_MAVENTEST, PipelineFinal.TASK_DEPLOY_LINUX};
|
||||
default -> ints = new String[]{PipelineFinal.TASK_CODE_GIT};
|
||||
}
|
||||
if (pipeline.getType() == 1) {
|
||||
tasksService.createTaskTemplate(pipelineId , ints);
|
||||
}
|
||||
if (pipeline.getType() == 2) {
|
||||
stageService.createStageTemplate(pipelineId , ints);
|
||||
}
|
||||
|
||||
// String userId = pipeline.getUser().getId();
|
||||
// //流水线关联角色,用户信息
|
||||
// authorityService.createDmUser(pipelineId,userId,pipeline.getUserList());
|
||||
|
||||
// 消息通知方案
|
||||
MessageNoticePatch messageNoticePatch = new MessageNoticePatch();
|
||||
messageNoticePatch.setDomainId(pipelineId);
|
||||
// messageNoticePatch.setUserList(List.of(userId));
|
||||
messageDmNoticeService.initMessageDmNotice(messageNoticePatch);
|
||||
|
||||
//动态与消息
|
||||
Map<String,Object> map =homeService.initMap(pipeline);
|
||||
map.put("link",PipelineFinal.CREATE_LINK);
|
||||
map.put("pipelineName",pipeline.getName());
|
||||
homeService.log(PipelineFinal.LOG_TYPE_CREATE, map);
|
||||
homeService.settingMessage(PipelineFinal.MES_CREATE, map);
|
||||
|
||||
return pipelineId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePipeline(String pipelineId) {
|
||||
Pipeline pipeline = findPipelineById(pipelineId);
|
||||
// joinTemplate.joinQuery(pipeline);
|
||||
//删除关联信息
|
||||
pipelineDao.deletePipeline(pipelineId); //删除流水线
|
||||
|
||||
new Thread(() -> {
|
||||
authorityService.deleteDmUser(pipelineId); //删除关联用户
|
||||
logger.warn("删除流水线历史信息....");
|
||||
deleteOther(pipelineId); //删除历史,日志,收藏,最近打开
|
||||
|
||||
//删除配置信息
|
||||
logger.warn("删除流水线关联配置信息....");
|
||||
if (pipeline.getType() == 1){
|
||||
tasksService.deleteAllTasksOrTask(pipelineId,1);
|
||||
}
|
||||
if (pipeline.getType() == 2){
|
||||
stageService.deleteAllStagesOrTask(pipelineId);
|
||||
}
|
||||
}).start();
|
||||
|
||||
//动态与消息
|
||||
Map<String,Object> map = homeService.initMap(pipeline);
|
||||
homeService.log(PipelineFinal.LOG_TYPE_DELETE, map);
|
||||
homeService.settingMessage(PipelineFinal.MES_DELETE, map);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePipeline(Pipeline pipeline) {
|
||||
//更新名称
|
||||
Pipeline flow = findPipelineById(pipeline.getId());
|
||||
joinTemplate.joinQuery(flow);
|
||||
//判断名称是否改变
|
||||
if (!pipeline.getName().equals(flow.getName())){
|
||||
Map<String,Object> map = homeService.initMap(pipeline);
|
||||
map.put("link",PipelineFinal.UPDATE_LINK);
|
||||
map.put("message", flow.getName() +"更改为:"+pipeline.getName());
|
||||
map.put("lastName", flow.getName());
|
||||
flow.setName(pipeline.getName());
|
||||
map.put("dmMessage",true);
|
||||
homeService.log(PipelineFinal.LOG_TYPE_UPDATE, map);
|
||||
homeService.settingMessage(PipelineFinal.MES_UPDATE, map);
|
||||
}
|
||||
|
||||
//判断权限是否改变
|
||||
int pipelinePower = pipeline.getPower();
|
||||
if (pipelinePower != flow.getPower() && pipelinePower != 0){
|
||||
flow.setPower(pipelinePower);
|
||||
}
|
||||
if (pipeline.getState() !=0 ){
|
||||
flow.setState(pipeline.getState());
|
||||
}
|
||||
|
||||
flow.setEnv(pipeline.getEnv());
|
||||
flow.setGroup(pipeline.getGroup());
|
||||
|
||||
PipelineEntity pipelineEntity = BeanMapper.map(flow, PipelineEntity.class);
|
||||
pipelineDao.updatePipeline(pipelineEntity);
|
||||
|
||||
}
|
||||
|
||||
//查询
|
||||
@Override
|
||||
public Pipeline findPipelineById(String pipelineId) {
|
||||
PipelineEntity pipelineEntity = pipelineDao.findPipelineById(pipelineId);
|
||||
Pipeline pipeline = BeanMapper.map(pipelineEntity, Pipeline.class);
|
||||
joinTemplate.joinQuery(pipeline);
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pipeline findPipelineByIdNoQuery(String pipelineId) {
|
||||
PipelineEntity pipelineEntity = pipelineDao.findPipelineById(pipelineId);
|
||||
return BeanMapper.map(pipelineEntity, Pipeline.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pipeline findOnePipeline(String pipelineId){
|
||||
return findPipelineById(pipelineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pipeline findPipelineNoQuery(String pipelineId){
|
||||
PipelineEntity pipelineEntity = pipelineDao.findPipelineById(pipelineId);
|
||||
return BeanMapper.map(pipelineEntity, Pipeline.class);
|
||||
}
|
||||
|
||||
//查询所有
|
||||
@Override
|
||||
public List<Pipeline> findAllPipeline() {
|
||||
List<Pipeline> list = BeanMapper.mapList(pipelineDao.findAllPipeline(), Pipeline.class);
|
||||
joinTemplate.joinQuery(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Pipeline> findAllPipelineNoQuery() {
|
||||
List<Pipeline> list = BeanMapper.mapList(pipelineDao.findAllPipeline(), Pipeline.class);
|
||||
joinTemplate.joinQuery(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pipeline> findAllPipelineList(List<String> idList) {
|
||||
List<PipelineEntity> pipelineEntityList = pipelineDao.findAllPipelineList(idList);
|
||||
return BeanMapper.mapList(pipelineEntityList, Pipeline.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pipeline> findUserPipeline(PipelineQuery query){
|
||||
String[] builder = authorityService.findUserPipelineIdString(query.getUserId());
|
||||
query.setIdString(builder);
|
||||
List<Pipeline> userPipeline = findPipelineList(query);
|
||||
if (Objects.isNull(userPipeline)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return userPipeline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<Pipeline> findUserPipelinePage(PipelineQuery query){
|
||||
String userId = query.getUserId();
|
||||
|
||||
String[] builders = authorityService.findUserPipelineIdString(userId);
|
||||
query.setIdString(builders);
|
||||
// 用户收藏的流水线
|
||||
Integer follow = query.getPipelineFollow();
|
||||
if (!Objects.isNull(follow) && follow == 1){
|
||||
PageResult<PipelineEntity> pipelineListQuery = pipelineDao.findPipelineListQuery(query);
|
||||
List<PipelineEntity> dataList = pipelineListQuery.getList();
|
||||
if (dataList.isEmpty()){
|
||||
return PageResult.empty();
|
||||
}
|
||||
|
||||
List<Pipeline> pipelineList = BeanMapper.mapList(dataList, Pipeline.class);
|
||||
// TODO 流水线关联上用户
|
||||
// List<Pipeline> list = new ArrayList<>();
|
||||
return new PageResult<Pipeline>(pipelineList, pipelineListQuery.getTotal());
|
||||
// List<String> userIdList = new ArrayList<>();
|
||||
// for (Pipeline pipeline : pipelineList) {
|
||||
//// userIdList.add(pipeline.getUser().getId());
|
||||
// pipeline.setCollect(1);
|
||||
// Pipeline pipelineMessage = findPipelineExecMessage(pipeline);
|
||||
// list.add(pipelineMessage);
|
||||
// }
|
||||
|
||||
// // 查询用户信息
|
||||
// Map<String, User> pipelineUser = findPipelineUser(userIdList);
|
||||
//
|
||||
// List<Pipeline> pipelines = list.stream()
|
||||
// .peek(pipeline -> pipeline.setUser(pipelineUser.get(pipeline.getUser().getId())))
|
||||
// .toList();
|
||||
|
||||
// return PaginationBuilder.build(pipelineListQuery,pipelines);
|
||||
}
|
||||
|
||||
// 查询用户流水线
|
||||
PipelineFollowQuery followQuery = new PipelineFollowQuery();
|
||||
followQuery.setUserId(userId);
|
||||
List<PipelineFollow> followPipeline = followService.findFollowQueryList(followQuery);
|
||||
Map<String,String> map = new HashMap<>();
|
||||
for (PipelineFollow pipelineFollow : followPipeline) {
|
||||
Pipeline pipeline = pipelineFollow.getPipeline();
|
||||
if (Objects.isNull(pipeline)){
|
||||
continue;
|
||||
}
|
||||
map.put(pipeline.getId(),pipeline.getId());
|
||||
}
|
||||
PageResult<PipelineEntity> pipelinePage = pipelineDao.findPipelinePage(query);
|
||||
List<PipelineEntity> dataList = pipelinePage.getList();
|
||||
List<Pipeline> pipelineList = BeanMapper.mapList(dataList, Pipeline.class);
|
||||
if (pipelineList.isEmpty()){
|
||||
// return PaginationBuilder.build(pipelinePage, Collections.emptyList());
|
||||
return PageResult.empty();
|
||||
}
|
||||
return new PageResult<>(pipelineList,Long.valueOf(String.valueOf(followPipeline.size())) );
|
||||
// TODO 关联上用户信息
|
||||
// List<Pipeline> list = new ArrayList<>();
|
||||
// List<String> userIdList = new ArrayList<>();
|
||||
// for (Pipeline pipeline : pipelineList) {
|
||||
// // 判断是否收藏
|
||||
// String s = map.get(pipeline.getId());
|
||||
// pipeline.setCollect(0);
|
||||
// if (!Objects.isNull(s)){
|
||||
// pipeline.setCollect(1);
|
||||
// }
|
||||
// userIdList.add(pipeline.getUser().getId());
|
||||
// list.add(findPipelineExecMessage(pipeline));
|
||||
// }
|
||||
// Map<String, User> pipelineUser = findPipelineUser(userIdList);
|
||||
//
|
||||
// List<Pipeline> pipelines = list.stream()
|
||||
// .peek(pipeline -> pipeline.setUser(pipelineUser.get(pipeline.getUser().getId())))
|
||||
// .toList();
|
||||
//
|
||||
// return PaginationBuilder.build(pipelinePage,pipelines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pipeline> findPipelineList(PipelineQuery query){
|
||||
List<PipelineEntity> pipelineEntityList = pipelineDao.findPipelineList(query);
|
||||
if (Objects.isNull(pipelineEntityList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return BeanMapper.mapList(pipelineEntityList,Pipeline.class);
|
||||
}
|
||||
// TODO
|
||||
// @Override
|
||||
// public List<User> findPipelineUser(String pipelineId) {
|
||||
// return authorityService.findPipelineUser(pipelineId);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<PipelineRecently> findPipelineRecently(String userId, int number){
|
||||
|
||||
// 筛选出用户拥有的流水线的历史
|
||||
String[] userPipeline = authorityService.findUserPipelineIdString(userId);
|
||||
if (userPipeline.length == 0){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<PipelineInstance> instanceList = instanceService.findUserPipelineInstance(userId,number);
|
||||
if (instanceList.isEmpty()){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<PipelineInstance> pipelineInstanceList = new ArrayList<>();
|
||||
List<String> pipelineIdList = Arrays.stream(userPipeline).toList();
|
||||
for (PipelineInstance instance : instanceList) {
|
||||
String id = instance.getPipeline().getId();
|
||||
boolean containsElement = pipelineIdList.contains(id);
|
||||
if (!containsElement){
|
||||
continue;
|
||||
}
|
||||
pipelineInstanceList.add(instance);
|
||||
}
|
||||
List<PipelineRecently> list = new ArrayList<>();
|
||||
for (PipelineInstance lastInstance : pipelineInstanceList) {
|
||||
String pipelineId = lastInstance.getPipeline().getId();
|
||||
Pipeline pipeline = findPipelineByIdNoQuery(pipelineId);
|
||||
|
||||
PipelineRecently recently = new PipelineRecently();
|
||||
recently.setPipelineId(pipelineId);
|
||||
recently.setPipelineName(pipeline.getName());
|
||||
recently.setLastRunState(lastInstance.getRunStatus());
|
||||
recently.setNumber(lastInstance.getFindNumber());
|
||||
String createTime = lastInstance.getCreateTime();
|
||||
recently.setCreateTime(createTime);
|
||||
Date date = PipelineUtil.StringChengeDate(createTime);
|
||||
String dateTime = PipelineUtil.findDateTime(date, 3000);
|
||||
recently.setExecTime(dateTime);
|
||||
// String formatted = PipelineUtil.formatDateTime(lastInstance.getRunTime());
|
||||
// recently.setLastRunTime(formatted);
|
||||
// recently.setColor(pipeline.getColor());
|
||||
recently.setInstanceId(lastInstance.getInstanceId());
|
||||
recently.setLastRunType(lastInstance.getRunWay());
|
||||
list.add(recently);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findPipelineCloneName(String pipelineId){
|
||||
Pipeline pipeline = findPipelineById(pipelineId);
|
||||
|
||||
if (Objects.isNull(pipeline)){
|
||||
logger.error("没有查询到当前流水线信息,pipelineId:{}",pipelineId);
|
||||
// throw new ApplicationException("没有查询到当前流水线信息!");
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(),"没有查询到当前流水线信息!");
|
||||
}
|
||||
String name = pipeline.getName() + "_copy";
|
||||
|
||||
// 匹配流水线名称
|
||||
int i = 1;
|
||||
PipelineQuery pipelineQuery = new PipelineQuery();
|
||||
pipelineQuery.setPipelineName(name);
|
||||
pipelineQuery.setEqName(true);
|
||||
List<Pipeline> userPipelineList = findPipelineList(pipelineQuery);
|
||||
while (!userPipelineList.isEmpty() && i < 10){
|
||||
name = pipeline.getName() + "_copy_"+ i ;
|
||||
pipelineQuery.setPipelineName(name);
|
||||
userPipelineList = findPipelineList(pipelineQuery);
|
||||
i ++ ;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pipelineClone(String pipelineId,String pipelineName) {
|
||||
Pipeline pipeline = findPipelineById(pipelineId);
|
||||
|
||||
if (Objects.isNull(pipeline)){
|
||||
logger.error("没有查询到当前流水线信息,pipelineId:{}",pipelineId);
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(),"克隆失败,没有查询到当前流水线信息!");
|
||||
}
|
||||
|
||||
pipeline.setName(pipelineName);
|
||||
|
||||
// 克隆流水线
|
||||
PipelineEntity pipelineEntity = BeanMapper.map(pipeline, PipelineEntity.class);
|
||||
String clonePipelineId = pipelineDao.createPipeline(pipelineEntity);
|
||||
|
||||
// 克隆流水线成员以及权限信息
|
||||
authorityService.cloneDomainRole(pipelineId,clonePipelineId);
|
||||
|
||||
// 克隆任务
|
||||
int type = pipeline.getType();
|
||||
if (type == 1){
|
||||
// 多任务
|
||||
tasksCloneService.clonePipelineTasks(pipelineId,clonePipelineId);
|
||||
}else {
|
||||
// 多阶段
|
||||
stageService.cloneStage(pipelineId, clonePipelineId);
|
||||
}
|
||||
|
||||
// 克隆后置任务
|
||||
postprocessService.clonePostTask(pipelineId,clonePipelineId);
|
||||
|
||||
// 克隆触发器
|
||||
triggerService.cloneTrigger(pipelineId,clonePipelineId);
|
||||
|
||||
// 克隆流水线变量
|
||||
variableService.cloneVariable(pipelineId,clonePipelineId);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pipeline> findRecentlyPipeline(Integer number,String pipelineId){
|
||||
|
||||
int i = number + 1;
|
||||
List<String> userOpenList = openService.findUserOpen(i);
|
||||
|
||||
// String loginId = LoginContext.getLoginId();
|
||||
// TODO
|
||||
String loginId = "";
|
||||
String[] builders = authorityService.findUserPipelineIdString(loginId);
|
||||
|
||||
Pipeline pipeline = findPipelineNoQuery(pipelineId);
|
||||
|
||||
// 过滤出当前流水线
|
||||
List<String> strings = Stream.of(builders).filter(a -> !a.equals(pipelineId)).toList();
|
||||
if (strings.isEmpty()){
|
||||
List<Pipeline> objects = new ArrayList<>();
|
||||
objects.add(pipeline);
|
||||
return objects;
|
||||
}
|
||||
|
||||
// 最近没有打开流水线
|
||||
if (userOpenList.isEmpty()){
|
||||
List<PipelineEntity> pipelineEntityList = pipelineDao.findAllPipelineList(strings);
|
||||
if (pipelineEntityList.size() > number){
|
||||
pipelineEntityList.subList(0, number);
|
||||
}
|
||||
List<Pipeline> pipelineList = BeanMapper.mapList(pipelineEntityList, Pipeline.class);
|
||||
pipelineList.add(0,pipeline);
|
||||
return pipelineList;
|
||||
}
|
||||
|
||||
// 过滤出当前流水线
|
||||
List<String> pieplineIdList = userOpenList.stream().filter(s -> !s.equals(pipelineId))
|
||||
.toList();
|
||||
|
||||
// 获取最近打开以及拥有权限的流水线
|
||||
List<String> collect = strings.stream()
|
||||
.filter(pieplineIdList::contains).distinct().toList();
|
||||
|
||||
List<String> idStrings = new ArrayList<>(collect);
|
||||
|
||||
// 判断是否超出数量
|
||||
if (collect.size() >= number){
|
||||
idStrings = idStrings.subList(0, number);
|
||||
}else {
|
||||
List<String> collect1 = strings.stream().filter(element -> !pieplineIdList.contains(element)).toList();
|
||||
if (collect1.size() >= number - collect.size()){
|
||||
idStrings.addAll(collect.size()-1,collect1.subList(0,number - collect.size()));
|
||||
}else {
|
||||
idStrings.addAll(collect.size()-1,collect1);
|
||||
}
|
||||
}
|
||||
// if (strings.isEmpty()){
|
||||
// List<Pipeline> objects = new ArrayList<>();
|
||||
// objects.add(pipeline);
|
||||
// return objects;
|
||||
// }
|
||||
|
||||
List<Pipeline> pipelineList = findAllPipelineList(idStrings);
|
||||
pipelineList.add(0,pipeline);
|
||||
|
||||
return pipelineList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关联信息
|
||||
* @param pipelineId 流水线Id
|
||||
*/
|
||||
private void deleteOther(String pipelineId){
|
||||
|
||||
//删除对应的历史
|
||||
instanceService.deleteAllInstance(pipelineId);
|
||||
|
||||
//删除对应源码文件
|
||||
String fileAddress = utilService.findPipelineDefaultAddress(pipelineId,1);
|
||||
PipelineFileUtil.deleteFile(new File(fileAddress));
|
||||
|
||||
//删除对应日志
|
||||
String logAddress = utilService.findPipelineDefaultAddress(pipelineId,2);
|
||||
PipelineFileUtil.deleteFile(new File(logAddress));
|
||||
|
||||
// 删除最近打开
|
||||
openService.deleteAllOpen(pipelineId);
|
||||
|
||||
// 删除收藏
|
||||
followService.deletePipelineFollow(pipelineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加流水线执行信息
|
||||
* @param pipeline 流水线
|
||||
* @return 流水线
|
||||
*/
|
||||
public Pipeline findPipelineExecMessage(Pipeline pipeline){
|
||||
PipelineInstance latelyHistory = instanceService.findLatelyInstance(pipeline.getId());
|
||||
if (!Objects.isNull(latelyHistory)){
|
||||
|
||||
pipeline.setBuildStatus(latelyHistory.getRunStatus());
|
||||
pipeline.setNumber(latelyHistory.getFindNumber());
|
||||
pipeline.setInstanceId(latelyHistory.getInstanceId());
|
||||
|
||||
String createTime = latelyHistory.getCreateTime();
|
||||
Date date = PipelineUtil.StringChengeDate(createTime);
|
||||
String dateTime = PipelineUtil.findDateTime(date, 1000);
|
||||
if (!Objects.isNull(dateTime)){
|
||||
pipeline.setLastBuildTime(dateTime);
|
||||
// pipeline.setBuildStatus(latelyHistory.getRunStatus());
|
||||
// pipeline.setNumber(latelyHistory.getFindNumber());
|
||||
// pipeline.setInstanceId(latelyHistory.getInstanceId());
|
||||
}
|
||||
}
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户Id查询用户
|
||||
* @param userIdString 用户Id
|
||||
* @return 用户
|
||||
*/
|
||||
// public Map<String, User> findPipelineUser(List<String> userIdString){
|
||||
//
|
||||
// // 使用Stream API去除重复元素
|
||||
// List<String> uniqueList = userIdString.stream()
|
||||
// .distinct()
|
||||
// .toList();
|
||||
//
|
||||
// Map<String,User> map = new HashMap<>();
|
||||
//
|
||||
// List<User> list = userService.findList(uniqueList);
|
||||
// for (User user : list) {
|
||||
// if (Objects.isNull(user)){
|
||||
// continue;
|
||||
// }
|
||||
// map.put(user.getId(),user);
|
||||
// }
|
||||
// return map;
|
||||
// }
|
||||
|
||||
}
|
@ -1,650 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.definition.impl;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.job.Tasks;
|
||||
import cd.casic.ci.commons.bean.process.stage.Stage;
|
||||
import cd.casic.ci.commons.bean.support.deploy.TaskDeploy;
|
||||
import cd.casic.module.process.engine.task.TasksService;
|
||||
import cd.casic.module.process.pipeline.definition.PipelineYamlService;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineEntity;
|
||||
import cd.casic.module.process.process.definition.dao.PipelineDao;
|
||||
import cd.casic.module.process.setting.service.AuthHostService;
|
||||
import cd.casic.module.process.setting.service.AuthService;
|
||||
import cd.casic.module.process.setting.service.AuthThirdService;
|
||||
import cd.casic.module.process.stages.service.StageService;
|
||||
import cd.casic.module.process.support.util.util.PipelineFinal;
|
||||
import cd.casic.module.process.task.artifact.model.TaskArtifact;
|
||||
import cd.casic.module.process.task.artifact.service.TaskArtifactXpackService;
|
||||
import cd.casic.module.process.task.build.model.TaskBuild;
|
||||
import cd.casic.module.process.task.code.model.TaskCode;
|
||||
import cd.casic.module.process.task.code.service.TaskCodeGittokService;
|
||||
import cd.casic.module.process.task.codescan.model.TaskCodeScan;
|
||||
import cd.casic.module.process.task.test.model.TaskTest;
|
||||
import cd.casic.module.process.task.test.service.TaskTestOnService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class PipelineYamlServiceImpl implements PipelineYamlService {
|
||||
|
||||
@Autowired
|
||||
PipelineDao pipelineDao;
|
||||
|
||||
@Autowired
|
||||
AuthHostService authHostService;
|
||||
|
||||
@Autowired
|
||||
AuthThirdService authThirdService;
|
||||
|
||||
@Autowired
|
||||
TaskTestOnService taskTestOnService;
|
||||
|
||||
@Autowired
|
||||
TaskCodeGittokService taskCodeGittokService;
|
||||
|
||||
@Autowired
|
||||
TaskArtifactXpackService taskArtifactXpackService;
|
||||
|
||||
@Autowired
|
||||
AuthService authService;
|
||||
|
||||
@Autowired
|
||||
PipelineYamlService pipelineYamlService;
|
||||
|
||||
@Autowired
|
||||
TasksService tasksService;
|
||||
|
||||
@Autowired
|
||||
StageService stageService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(PipelineYamlService.class);
|
||||
|
||||
|
||||
@Override
|
||||
public String importPipelineYaml(String pipelineId){
|
||||
|
||||
PipelineEntity pipeline = pipelineDao.findPipelineById(pipelineId);
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("pipeline", Map.of("name", pipeline.getName()));
|
||||
|
||||
DumperOptions options = new DumperOptions();
|
||||
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
|
||||
Yaml yaml = new Yaml(options);
|
||||
|
||||
// 将Java对象转换为YAML字符串
|
||||
String yamlString = yaml.dump(properties);
|
||||
|
||||
return importStageYaml(yamlString,pipelineId);
|
||||
|
||||
// int type = pipeline.getType();
|
||||
//
|
||||
// if (type == 1){
|
||||
// return importTaskYaml(yamlString,pipelineId);
|
||||
// }else {
|
||||
// return importStageYaml(yamlString,pipelineId);
|
||||
// }
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出多任务配置为Yaml格式
|
||||
// * @param yamlString yaml
|
||||
// * @param pipelineId 流水线
|
||||
// * @return Yaml格式支付串
|
||||
// */
|
||||
// private String importTaskYaml(String yamlString,String pipelineId){
|
||||
//
|
||||
// DumperOptions options = new DumperOptions();
|
||||
// options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
//
|
||||
// Yaml yaml = new Yaml(options);
|
||||
// Map<String, Object> data = yaml.load(yamlString);
|
||||
//
|
||||
// List<Map<String, Object>> taskList = new ArrayList<>();
|
||||
//
|
||||
// List<Tasks> tasksList = tasksService.finAllPipelineTaskOrTask(pipelineId);
|
||||
// for (Tasks tasks : tasksList) {
|
||||
// LinkedHashMap<String, Object> tasksMap = new LinkedHashMap<>();
|
||||
//
|
||||
// LinkedHashMap<String, Object> taskDetails = new LinkedHashMap<>();
|
||||
//
|
||||
// taskDetails.put("taskId",tasks.getTaskId());
|
||||
// taskDetails.put("taskName",tasks.getTaskName());
|
||||
// findTaskDetails(tasks.getTaskType(), tasks.getTask(), taskDetails);
|
||||
//
|
||||
// tasksMap.put("task",taskDetails);
|
||||
// taskList.add(tasksMap);
|
||||
// }
|
||||
//
|
||||
// Map<String, Object> pipelineMap = (Map<String, Object>) data.get("pipeline");
|
||||
// pipelineMap.put("tasks",taskList);
|
||||
// return yaml.dump(data);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出多阶段配置为Yaml格式
|
||||
* @param yamlString yaml
|
||||
* @param pipelineId 流水线
|
||||
* @return Yaml格式支付串
|
||||
*/
|
||||
private String importStageYaml(String yamlString,String pipelineId){
|
||||
|
||||
DumperOptions options = new DumperOptions();
|
||||
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
|
||||
Yaml yaml = new Yaml(options);
|
||||
Map<String, Object> data = yaml.load(yamlString);
|
||||
|
||||
List<Map<String, Object>> stageMapList = new ArrayList<>();
|
||||
|
||||
List<Stage> stageList = stageService.findAllStagesOrTask(pipelineId);
|
||||
|
||||
for (Stage stage : stageList) {
|
||||
LinkedHashMap<String, Object> stageMap = new LinkedHashMap<>();
|
||||
|
||||
List<Stage> parallelStageList = stage.getStageList();
|
||||
|
||||
List<Map<String, Object>> parallelMapList = new ArrayList<>();
|
||||
LinkedHashMap<String, Object> parallelsMap = new LinkedHashMap<>();
|
||||
for (Stage parallelStage : parallelStageList) {
|
||||
|
||||
LinkedHashMap<String, Object> parallelMap = new LinkedHashMap<>();
|
||||
|
||||
List<Map<String, Object>> taskMapList = new ArrayList<>();
|
||||
List<Tasks> taskList = parallelStage.getTaskValues();
|
||||
LinkedHashMap<String, Object> tasksMap = new LinkedHashMap<>();
|
||||
for (Tasks tasks : taskList) {
|
||||
|
||||
LinkedHashMap<String, Object> taskMap = new LinkedHashMap<>();
|
||||
LinkedHashMap<String, Object> taskDetails = new LinkedHashMap<>();
|
||||
|
||||
taskDetails.put("taskId",tasks.getTaskId());
|
||||
taskDetails.put("taskName",tasks.getTaskName());
|
||||
findTaskDetails(tasks.getTaskType(), tasks.getTask(), taskDetails);
|
||||
|
||||
taskMap.put("task",taskDetails);
|
||||
taskMapList.add(taskMap);
|
||||
|
||||
tasksMap.put("parallelId",parallelStage.getStageId());
|
||||
tasksMap.put("parallelName",parallelStage.getStageName());
|
||||
tasksMap.put("tasks",taskMapList);
|
||||
}
|
||||
|
||||
parallelMap.put("parallel",tasksMap);
|
||||
parallelMapList.add(parallelMap);
|
||||
}
|
||||
parallelsMap.put("stageId",stage.getStageId());
|
||||
parallelsMap.put("stageName",stage.getStageName());
|
||||
parallelsMap.put("parallels",parallelMapList);
|
||||
|
||||
stageMap.put("stage",parallelsMap);
|
||||
stageMapList.add(stageMap);
|
||||
}
|
||||
Map<String, Object> pipelineMap = (Map<String, Object>) data.get("pipeline");
|
||||
pipelineMap.put("stages",stageMapList);
|
||||
|
||||
return yaml.dump(data);
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> findTaskDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetails){
|
||||
if (Objects.isNull(object)){
|
||||
return null;
|
||||
}
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_CODE_GIT , PipelineFinal.TASK_CODE_GITEE , PipelineFinal.TASK_CODE_GITHUB ,
|
||||
PipelineFinal.TASK_CODE_GITLAB, PipelineFinal.TASK_CODE_XCODE, PipelineFinal.TASK_CODE_SVN ->{
|
||||
return taskCodeDetails(taskType,object,taskDetails);
|
||||
}
|
||||
case PipelineFinal.TASK_BUILD_MAVEN, PipelineFinal.TASK_BUILD_NODEJS ->{
|
||||
return taskBuildDetails(taskType,object,taskDetails);
|
||||
}
|
||||
case PipelineFinal.TASK_TEST_MAVENTEST, PipelineFinal.TASK_TEST_TESTON ->{
|
||||
return taskTestDetails(taskType,object,taskDetails);
|
||||
}
|
||||
case PipelineFinal.TASK_DEPLOY_LINUX , PipelineFinal.TASK_DEPLOY_DOCKER ->{
|
||||
return taskDeployDetails(taskType,object,taskDetails);
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_NEXUS , PipelineFinal.TASK_ARTIFACT_SSH , PipelineFinal.TASK_ARTIFACT_XPACK ->{
|
||||
return taskArtifactDetails(taskType,object,taskDetails);
|
||||
}
|
||||
case PipelineFinal.TASK_CODESCAN_SONAR ->{
|
||||
return taskCodeScanDetails(taskType,object,taskDetails);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> taskCodeDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskCode taskCode = JSONObject.parseObject(string, TaskCode.class);
|
||||
if (!Objects.isNull(taskCode.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskCode.getAuthId());
|
||||
}
|
||||
if (!taskType.equals(PipelineFinal.TASK_CODE_SVN)){
|
||||
if (!Objects.isNull(taskCode.getCodeName())){
|
||||
taskDetailsMap.put("url",taskCode.getCodeName());
|
||||
}
|
||||
if (!Objects.isNull(taskCode.getCodeBranch())){
|
||||
taskDetailsMap.put("branch",taskCode.getCodeBranch());
|
||||
}else {
|
||||
taskDetailsMap.put("branch", PipelineFinal.TASK_CODE_DEFAULT_BRANCH);
|
||||
}
|
||||
}else {
|
||||
if (!Objects.isNull(taskCode.getCodeName())){
|
||||
taskDetailsMap.put("detection_url",taskCode.getCodeName());
|
||||
}
|
||||
|
||||
if (!Objects.isNull(taskCode.getSvnFile())){
|
||||
taskDetailsMap.put("detection_file",taskCode.getSvnFile());
|
||||
}
|
||||
}
|
||||
|
||||
// switch (taskType){
|
||||
// case PipelineFinal.TASK_CODE_GIT, PipelineFinal.TASK_CODE_GITLAB ->{
|
||||
// if (!Objects.isNull(taskCode.getAuthId())){
|
||||
// taskDetailsMap.put("authId",taskCode.getAuthId());
|
||||
// }
|
||||
// if (!Objects.isNull(taskCode.getCodeName())){
|
||||
// taskDetailsMap.put("url",taskCode.getCodeName());
|
||||
// }
|
||||
//
|
||||
// if (!Objects.isNull(taskCode.getCodeBranch())){
|
||||
// taskDetailsMap.put("branch",taskCode.getCodeBranch());
|
||||
// }else {
|
||||
// taskDetailsMap.put("branch", PipelineFinal.TASK_CODE_DEFAULT_BRANCH);
|
||||
// }
|
||||
// }
|
||||
// case PipelineFinal.TASK_CODE_GITEE, PipelineFinal.TASK_CODE_GITHUB ->{
|
||||
// if (!Objects.isNull(taskCode.getAuthId())){
|
||||
// taskDetailsMap.put("authId",taskCode.getAuthId());
|
||||
// }
|
||||
// if (!Objects.isNull(taskCode.getCodeName())){
|
||||
// taskDetailsMap.put("repository_name",taskCode.getCodeName());
|
||||
// }
|
||||
// if (!Objects.isNull(taskCode.getCodeAddress())){
|
||||
// taskDetailsMap.put("repository_url",taskCode.getCodeAddress());
|
||||
// }
|
||||
//
|
||||
// if (!Objects.isNull(taskDetailsMap.get("authId"))){
|
||||
// String authId = (String) taskDetailsMap.get("authId");
|
||||
// String repositoryName = (String) taskDetailsMap.get("repository_name");
|
||||
// String houseUrl = codeThirdService.getHouseUrl(authId, repositoryName, taskType);
|
||||
// taskCode.setCodeAddress(houseUrl);
|
||||
// taskDetailsMap.put("repository_url",houseUrl);
|
||||
// }
|
||||
//
|
||||
// if (!Objects.isNull(taskCode.getCodeBranch())){
|
||||
// taskDetailsMap.put("branch",taskCode.getCodeBranch());
|
||||
// }else {
|
||||
// taskDetailsMap.put("branch", PipelineFinal.TASK_CODE_DEFAULT_BRANCH);
|
||||
// }
|
||||
// }
|
||||
// case PipelineFinal.TASK_CODE_XCODE ->{
|
||||
// String authId = taskCode.getAuthId();
|
||||
// if (!Objects.isNull(authId)){
|
||||
// taskDetailsMap.put("authId",taskCode.getAuthId());
|
||||
// }
|
||||
// if (!Objects.isNull(taskCode.getRepository())){
|
||||
// String rpyId = taskCode.getRepository().getRpyId();
|
||||
// taskDetailsMap.put("repository_id",rpyId);
|
||||
// ThirdHouse thirdHouse = taskCodeGittokService.
|
||||
// findStoreHouse((String) taskDetailsMap.get("authId"), rpyId);
|
||||
// if (!Objects.isNull(thirdHouse)) {
|
||||
// // taskCode.setRepository(thirdHouse);
|
||||
// taskDetailsMap.put("repository_url",thirdHouse.getHouseWebUrl());
|
||||
// taskDetailsMap.put("repository_name",thirdHouse.getName());
|
||||
// }
|
||||
// }
|
||||
// taskDetailsMap.put("branch", PipelineFinal.TASK_CODE_DEFAULT_BRANCH);
|
||||
// if (!Objects.isNull(taskCode.getBranch())){
|
||||
// String branchId = taskCode.getBranch().getBranchId();
|
||||
// String authId1 = (String) taskDetailsMap.get("authId");
|
||||
// String rpyId1 = (String) taskDetailsMap.get("repository_id");
|
||||
// XcodeBranch xcodeBranch = taskCodeGittokService.findOneBranch(authId1, rpyId1,branchId);
|
||||
// if (!Objects.isNull(xcodeBranch)){
|
||||
// taskCode.setBranch(xcodeBranch);
|
||||
// taskDetailsMap.put("branch_name",xcodeBranch.getBranchName());
|
||||
// }
|
||||
// }else {
|
||||
// taskDetailsMap.put("branch", PipelineFinal.TASK_CODE_DEFAULT_BRANCH);
|
||||
// }
|
||||
// }
|
||||
// case PipelineFinal.TASK_CODE_SVN ->{
|
||||
// if (!Objects.isNull(taskCode.getAuthId())){
|
||||
// taskDetailsMap.put("authId",taskCode.getAuthId());
|
||||
// }
|
||||
// if (!Objects.isNull(taskCode.getCodeName())){
|
||||
// taskDetailsMap.put("detection_url",taskCode.getCodeName());
|
||||
// }
|
||||
//
|
||||
// if (!Objects.isNull(taskCode.getSvnFile())){
|
||||
// taskDetailsMap.put("detection_file",taskCode.getSvnFile());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> taskCodeScanDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskCodeScan taskCodeScan = JSONObject.parseObject(string, TaskCodeScan.class);
|
||||
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_CODESCAN_SONAR ->{
|
||||
if (!Objects.isNull(taskCodeScan.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskCodeScan.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskCodeScan.getProjectName())){
|
||||
taskDetailsMap.put("project_name",taskCodeScan.getProjectName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> taskTestDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskTest taskTest = JSONObject.parseObject(string, TaskTest.class);
|
||||
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_TEST_MAVENTEST ->{
|
||||
if (!Objects.isNull(taskTest.getTestOrder())){
|
||||
taskDetailsMap.put("test_order",taskTest.getTestOrder());
|
||||
}
|
||||
if (!Objects.isNull(taskTest.getAddress())){
|
||||
taskDetailsMap.put("pom_address",taskTest.getAddress());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_TEST_TESTON ->{
|
||||
|
||||
if (!Objects.isNull(taskTest.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskTest.getAuthId());
|
||||
}
|
||||
|
||||
if (!Objects.isNull(taskTest.getWebEnv())){
|
||||
taskDetailsMap.put("webEnv",taskTest.getWebEnv().getId());
|
||||
}
|
||||
|
||||
if (!Objects.isNull(taskTest.getApiEnv())){
|
||||
taskDetailsMap.put("apiEnv",taskTest.getApiEnv().getId());
|
||||
}
|
||||
if (!Objects.isNull(taskTest.getAppEnv())){
|
||||
taskDetailsMap.put("appEnv",taskTest.getAppEnv().getId());
|
||||
}
|
||||
if (!Objects.isNull(taskTest.getTestPlan())){
|
||||
taskDetailsMap.put("testPlan",taskTest.getTestPlan().getId());
|
||||
}
|
||||
if (!Objects.isNull(taskTest.getTestSpace())){
|
||||
taskDetailsMap.put("testSpace",taskTest.getTestSpace().getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> taskBuildDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskBuild taskBuilder = JSONObject.parseObject(string, TaskBuild.class);
|
||||
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_BUILD_MAVEN ->{
|
||||
if (!Objects.isNull(taskBuilder.getBuildOrder())){
|
||||
taskDetailsMap.put("mvn_order",taskBuilder.getBuildOrder());
|
||||
}
|
||||
if (!Objects.isNull(taskBuilder.getBuildAddress())){
|
||||
taskDetailsMap.put("pom_address",taskBuilder.getBuildAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskBuilder.getProductRule())){
|
||||
taskDetailsMap.put("artifact_role",taskBuilder.getProductRule());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_BUILD_NODEJS ->{
|
||||
if (!Objects.isNull(taskBuilder.getBuildOrder())){
|
||||
taskDetailsMap.put("npm_order",taskBuilder.getBuildOrder());
|
||||
}
|
||||
if (!Objects.isNull(taskBuilder.getBuildAddress())){
|
||||
taskDetailsMap.put("model_address",taskBuilder.getBuildAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskBuilder.getProductRule())){
|
||||
taskDetailsMap.put("artifact_role",taskBuilder.getProductRule());
|
||||
}
|
||||
}
|
||||
}
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> taskDeployDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskDeploy taskDeploy = JSONObject.parseObject(string, TaskDeploy.class);
|
||||
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_DEPLOY_LINUX ->{
|
||||
if (taskDeploy.getAuthType() != 0){
|
||||
taskDetailsMap.put("deploy_type",taskDeploy.getAuthType());
|
||||
}
|
||||
|
||||
if (taskDeploy.getAuthType() == 1){
|
||||
if (!Objects.isNull(taskDeploy.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskDeploy.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskDeploy.getDeployAddress())){
|
||||
taskDetailsMap.put("deploy_address",taskDeploy.getDeployAddress());
|
||||
}
|
||||
}
|
||||
if (!Objects.isNull(taskDeploy.getDeployOrder())){
|
||||
taskDetailsMap.put("deploy_order",taskDeploy.getDeployOrder());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_DEPLOY_DOCKER->{
|
||||
if (!Objects.isNull(taskDeploy.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskDeploy.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskDeploy.getDockerImage())){
|
||||
taskDetailsMap.put("image",taskDeploy.getDockerImage());
|
||||
}
|
||||
if (!Objects.isNull(taskDeploy.getDeployAddress())){
|
||||
taskDetailsMap.put("deploy_address",taskDeploy.getDeployAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskDeploy.getDeployOrder())){
|
||||
taskDetailsMap.put("deploy_order",taskDeploy.getDeployOrder());
|
||||
}
|
||||
}
|
||||
}
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
|
||||
private LinkedHashMap<String, Object> taskArtifactDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskArtifact taskArtifact = JSONObject.parseObject(string, TaskArtifact.class);
|
||||
|
||||
String artifactType = taskArtifact.getArtifactType();
|
||||
taskDetailsMap.put("artifact_type",artifactType);
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_ARTIFACT_MAVEN ->{
|
||||
switch (artifactType){
|
||||
case PipelineFinal.TASK_ARTIFACT_NEXUS ->{
|
||||
if (!Objects.isNull(taskArtifact.getArtifactId())){
|
||||
taskDetailsMap.put("artifact_id",taskArtifact.getArtifactId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("auth_id",taskArtifact.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getGroupId())){
|
||||
taskDetailsMap.put("group_id",taskArtifact.getGroupId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getVersion())){
|
||||
taskDetailsMap.put("version",taskArtifact.getVersion());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getFileAddress())){
|
||||
taskDetailsMap.put("file_address",taskArtifact.getFileAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getRule())){
|
||||
taskDetailsMap.put("rule",taskArtifact.getRule());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_SSH ->{
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("auth_id",taskArtifact.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getPutAddress())){
|
||||
taskDetailsMap.put("remote_address",taskArtifact.getPutAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getFileAddress())){
|
||||
taskDetailsMap.put("fileAddress",taskArtifact.getFileAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getFileAddress())){
|
||||
taskDetailsMap.put("put_address",taskArtifact.getPutAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getRule())){
|
||||
taskDetailsMap.put("rule",taskArtifact.getRule());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_XPACK ->{
|
||||
if (!Objects.isNull(taskArtifact.getArtifactId())){
|
||||
taskDetailsMap.put("artifactId",taskArtifact.getArtifactId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskArtifact.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getGroupId())){
|
||||
taskDetailsMap.put("groupId",taskArtifact.getGroupId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getVersion())){
|
||||
taskDetailsMap.put("version",taskArtifact.getVersion());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getRepository())){
|
||||
taskDetailsMap.put("repository_id",taskArtifact.getRepository().getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_NODEJS ->{
|
||||
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_DOCKER ->{
|
||||
switch (artifactType){
|
||||
case PipelineFinal.TASK_ARTIFACT_NEXUS ->{
|
||||
if (!Objects.isNull(taskArtifact.getDockerImage())){
|
||||
taskDetailsMap.put("image",taskArtifact.getDockerImage());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskArtifact.getAuthId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
private LinkedHashMap<String, Object> taskPullArtifactDetails(String taskType,Object object,LinkedHashMap<String, Object> taskDetailsMap){
|
||||
String string = JSONObject.toJSONString(object);
|
||||
|
||||
TaskArtifact taskArtifact = JSONObject.parseObject(string, TaskArtifact.class);
|
||||
|
||||
String artifactType = taskArtifact.getArtifactType();
|
||||
taskDetailsMap.put("artifact_type",artifactType);
|
||||
switch (taskType){
|
||||
case PipelineFinal.TASK_PULL_MAVEN ->{
|
||||
switch (artifactType){
|
||||
case PipelineFinal.TASK_ARTIFACT_NEXUS ->{
|
||||
if (!Objects.isNull(taskArtifact.getArtifactId())){
|
||||
taskDetailsMap.put("artifact_id",taskArtifact.getArtifactId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("auth_id",taskArtifact.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getGroupId())){
|
||||
taskDetailsMap.put("group_id",taskArtifact.getGroupId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getVersion())){
|
||||
taskDetailsMap.put("version",taskArtifact.getVersion());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getFileAddress())){
|
||||
taskDetailsMap.put("file_address",taskArtifact.getFileAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getRule())){
|
||||
taskDetailsMap.put("rule",taskArtifact.getRule());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_SSH ->{
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("auth_id",taskArtifact.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getPutAddress())){
|
||||
taskDetailsMap.put("remote_address",taskArtifact.getPutAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getFileAddress())){
|
||||
taskDetailsMap.put("fileAddress",taskArtifact.getFileAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getFileAddress())){
|
||||
taskDetailsMap.put("put_address",taskArtifact.getPutAddress());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getRule())){
|
||||
taskDetailsMap.put("rule",taskArtifact.getRule());
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_ARTIFACT_XPACK ->{
|
||||
if (!Objects.isNull(taskArtifact.getArtifactId())){
|
||||
taskDetailsMap.put("artifactId",taskArtifact.getArtifactId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskArtifact.getAuthId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getGroupId())){
|
||||
taskDetailsMap.put("groupId",taskArtifact.getGroupId());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getVersion())){
|
||||
taskDetailsMap.put("version",taskArtifact.getVersion());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getRepository())){
|
||||
taskDetailsMap.put("repository_id",taskArtifact.getRepository().getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case PipelineFinal.TASK_PULL_NODEJS ->{
|
||||
|
||||
}
|
||||
case PipelineFinal.TASK_PULL_DOCKER ->{
|
||||
switch (artifactType){
|
||||
case PipelineFinal.TASK_ARTIFACT_NEXUS ->{
|
||||
if (!Objects.isNull(taskArtifact.getDockerImage())){
|
||||
taskDetailsMap.put("image",taskArtifact.getDockerImage());
|
||||
}
|
||||
if (!Objects.isNull(taskArtifact.getAuthId())){
|
||||
taskDetailsMap.put("authId",taskArtifact.getAuthId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return taskDetailsMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.execute.service;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineRunMsg;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstance;
|
||||
|
||||
/**
|
||||
* 流水线运行服务接口
|
||||
*/
|
||||
public interface PipelineExecService {
|
||||
|
||||
/**
|
||||
* 开始构建
|
||||
*
|
||||
* @param runMsg 流水线id
|
||||
// * @param startWAy 执行方式(1.手动执行 2.定时器触发)
|
||||
* @return 开始构建(true:开始运行 false:正在运行)
|
||||
*/
|
||||
PipelineInstance start(PipelineRunMsg runMsg);
|
||||
|
||||
/**
|
||||
* 停止流水线运行
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void stop(String pipelineId);
|
||||
|
||||
/**
|
||||
* 保持运行
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void keepOn(String pipelineId);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,372 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.execute.service.impl;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineDetails;
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineRunMsg;
|
||||
import cd.casic.ci.commons.bean.engine.postprocess.Postprocess;
|
||||
import cd.casic.ci.commons.exception.SystemException;
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.definition.Variable;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstance;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstanceQuery;
|
||||
import cd.casic.ci.commons.bean.process.setting.Scm;
|
||||
import cd.casic.ci.commons.bean.process.stage.Stage;
|
||||
import cd.casic.ci.commons.bean.work.agent.AgentMessage;
|
||||
import cd.casic.ci.commons.bean.work.agent.model.Agent;
|
||||
import cd.casic.framework.commons.exception.ServiceException;
|
||||
import cd.casic.framework.commons.exception.enums.GlobalErrorCodeConstants;
|
||||
import cd.casic.module.process.engine.task.TasksExecService;
|
||||
import cd.casic.module.process.pipeline.definition.PipelineService;
|
||||
import cd.casic.module.process.pipeline.execute.service.PipelineExecService;
|
||||
import cd.casic.module.process.pipeline.instance.service.PipelineInstanceServiceImpl;
|
||||
import cd.casic.module.process.support.variable.service.VariableService;
|
||||
import cd.casic.module.process.process.instance.PipelineInstanceService;
|
||||
import cd.casic.module.process.setting.service.ResourcesService;
|
||||
import cd.casic.module.process.setting.service.ScmService;
|
||||
import cd.casic.module.process.stages.service.StageExecService;
|
||||
import cd.casic.module.process.stages.service.StageService;
|
||||
import cd.casic.module.process.support.agent.service.AgentService;
|
||||
import cd.casic.module.process.support.disk.service.DiskService;
|
||||
import cd.casic.module.process.support.version.service.PipelineVersionService;
|
||||
import cd.casic.module.process.support.postprocess.service.PostprocessExecService;
|
||||
import cd.casic.module.process.support.util.PipelineUtilService;
|
||||
import cd.casic.module.process.support.util.util.PipelineFinal;
|
||||
import cd.casic.module.process.toolkit.join.JoinTemplate;
|
||||
import cd.casic.module.process.ws.server.SocketServerHandler;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
//import org.springframework.web.socket.WebSocketSession;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 流水线运行服务
|
||||
*/
|
||||
@Service
|
||||
//@Exporter
|
||||
public class PipelineExecServiceImpl implements PipelineExecService {
|
||||
|
||||
@Autowired
|
||||
PipelineService pipelineService;
|
||||
|
||||
@Autowired
|
||||
PostprocessExecService postExecService;
|
||||
|
||||
@Autowired
|
||||
PipelineInstanceService pipelineInstanceService;
|
||||
|
||||
@Autowired
|
||||
TasksExecService tasksExecService;
|
||||
|
||||
@Autowired
|
||||
StageExecService stageExecService;
|
||||
|
||||
@Autowired
|
||||
ResourcesService resourcesService;
|
||||
|
||||
@Autowired
|
||||
PipelineVersionService versionService;
|
||||
|
||||
@Autowired
|
||||
PipelineUtilService utilService;
|
||||
|
||||
@Autowired
|
||||
DiskService diskService;
|
||||
|
||||
@Autowired
|
||||
StageService stageService;
|
||||
|
||||
@Autowired
|
||||
JoinTemplate joinTemplate;
|
||||
|
||||
@Autowired
|
||||
ScmService scmService;
|
||||
|
||||
@Autowired
|
||||
VariableService variableService;
|
||||
|
||||
@Autowired
|
||||
AgentService agentService;
|
||||
|
||||
public final Logger logger = LoggerFactory.getLogger(PipelineExecServiceImpl.class);
|
||||
|
||||
//流水线id:流水线实例id
|
||||
public static final Map<String, String> pipelineIdOrInstanceId = new HashMap<>();
|
||||
|
||||
//流水线id:agent
|
||||
public static final Map<String, Agent> pipelineIdOrAgentId = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
* 流水线开始运行
|
||||
*
|
||||
* @param runMsg 流水线id
|
||||
* @return 是否正在运行
|
||||
*/
|
||||
@Override
|
||||
public PipelineInstance start(PipelineRunMsg runMsg) {
|
||||
Agent agent;
|
||||
if (StringUtils.isEmpty(runMsg.getAgentId())) {
|
||||
agent = agentService.findDefaultAgent();
|
||||
} else {
|
||||
agent = agentService.findAgent(runMsg.getAgentId());
|
||||
}
|
||||
if (Objects.isNull(agent)) {
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(), "无法获取到流水线执行Agent!");
|
||||
}
|
||||
|
||||
WebSocketSession session = SocketServerHandler.sessionMap.get(agent.getAddress());
|
||||
if (Objects.isNull(session)) {
|
||||
throw new ServiceException(GlobalErrorCodeConstants.LOCKED.getCode(), "流水线Agent断开连接,无法执行。");
|
||||
}
|
||||
|
||||
// 判断同一任务是否在运行
|
||||
Pipeline pipeline = validExecPipeline(runMsg);
|
||||
String pipelineId = pipeline.getId();
|
||||
pipelineIdOrAgentId.put(pipelineId, agent);
|
||||
|
||||
// 判断磁盘空间是否足够
|
||||
diskService.validationStorageSpace();
|
||||
|
||||
// 资源限制
|
||||
resourcesService.judgeResources();
|
||||
|
||||
// 进入执行
|
||||
runMsg.setPipeline(pipeline);
|
||||
runMsg.setAgent(agent);
|
||||
return beginExecPipeline(runMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 放入正在执行的流水线缓存中
|
||||
*
|
||||
* @param runMsg 流水线id
|
||||
* @return 流水线信息
|
||||
*/
|
||||
public Pipeline validExecPipeline(PipelineRunMsg runMsg) {
|
||||
String pipelineId = runMsg.getPipelineId();
|
||||
|
||||
List<Stage> allMainStage = stageService.findAllMainStage(pipelineId);
|
||||
if (allMainStage.isEmpty()) {
|
||||
throw new ServiceException(2000, "当前流水线不存在可构建任务!");
|
||||
}
|
||||
|
||||
Boolean isVip = versionService.isVip();
|
||||
|
||||
Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
|
||||
int size = pipelineIdOrInstanceId.size();
|
||||
|
||||
// 资源限制放入缓存中等待执行
|
||||
if ((!isVip && size >= 2) || (isVip && size >= 4)) {
|
||||
throw new ServiceException(2000, "并行任务已满,等待执行!");
|
||||
}
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行流水线
|
||||
*
|
||||
* @param runMsg 流水线信息
|
||||
* @return 流水线实例
|
||||
*/
|
||||
public PipelineInstance beginExecPipeline(PipelineRunMsg runMsg) {
|
||||
String pipelineId = runMsg.getPipelineId();
|
||||
Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
pipeline.setState(2);
|
||||
pipelineService.updatePipeline(pipeline);
|
||||
runMsg.setPipeline(pipeline);
|
||||
|
||||
logger.info("流水线{}开始运行", pipeline.getName());
|
||||
PipelineInstance pipelineInstance = pipelineInstanceService.initializeInstance(runMsg);
|
||||
// 添加到缓存
|
||||
String instanceId = pipelineInstance.getInstanceId();
|
||||
pipelineInstanceService.instanceRuntime(pipelineInstance.getInstanceId());
|
||||
joinTemplate.joinQuery(pipelineInstance);
|
||||
|
||||
// 运行实例放入内存中
|
||||
pipelineIdOrInstanceId.put(pipelineId, instanceId);
|
||||
|
||||
try {
|
||||
// 创建多阶段运行实例
|
||||
List<Stage> stageList = stageExecService.createStageExecInstance(pipelineId, instanceId);
|
||||
|
||||
List<Postprocess> postprocessList = postExecService.createPipelinePostInstance(pipelineId, instanceId);
|
||||
|
||||
PipelineDetails pipelineDetails = new PipelineDetails();
|
||||
|
||||
// 流水线基本运行信息
|
||||
pipelineDetails.setPipelineId(pipelineId);
|
||||
pipelineDetails.setInstanceId(instanceId);
|
||||
pipelineDetails.setRunWay(runMsg.getRunWay());
|
||||
pipelineDetails.setAgent(runMsg.getAgent());
|
||||
|
||||
// 流水线运行任务
|
||||
pipelineDetails.setStageList(stageList);
|
||||
|
||||
// 流水线后置处理
|
||||
pipelineDetails.setPostprocessList(postprocessList);
|
||||
|
||||
// 数据路径,源码,日志保存
|
||||
String sourceDir = utilService.findPipelineDefaultAddress(pipelineId, 1);
|
||||
String logDir = utilService.findPipelineDefaultAddress(pipelineId, 2);
|
||||
pipelineDetails.setSourceDir(sourceDir);
|
||||
pipelineDetails.setLogDir(logDir);
|
||||
|
||||
// 环境
|
||||
List<Scm> scmList = scmService.findAllPipelineScm();
|
||||
pipelineDetails.setScmList(scmList);
|
||||
|
||||
// 变量
|
||||
List<Variable> variableList = variableService.findAllVariable(pipelineId);
|
||||
pipelineDetails.setVariableList(variableList);
|
||||
|
||||
AgentMessage agentMessage = new AgentMessage();
|
||||
agentMessage.setType("exec");
|
||||
agentMessage.setMessage(pipelineDetails);
|
||||
agentMessage.setPipelineId(pipelineId);
|
||||
|
||||
Agent agent = pipelineDetails.getAgent();
|
||||
|
||||
String id = agent.getAddress();
|
||||
|
||||
WebSocketSession session = SocketServerHandler.sessionMap.get(id);
|
||||
if (Objects.isNull(session)) {
|
||||
throw new SystemException("客户端推送消息失败,无法获取客户端连接,客户端信息:" + id);
|
||||
}
|
||||
|
||||
try {
|
||||
SocketServerHandler.instance().sendHandleMessage(id, agentMessage);
|
||||
} catch (Exception e) {
|
||||
throw new SystemException("客户端推送消息失败,错误信息:" + e.getMessage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("流水线执行出错了:{}", e.getMessage());
|
||||
stop(pipelineId);
|
||||
}
|
||||
return pipelineInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(String pipelineId) {
|
||||
Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
|
||||
Agent agent = pipelineIdOrAgentId.get(pipelineId);
|
||||
if (Objects.isNull(agent)) {
|
||||
pipeline.setState(1);
|
||||
pipelineService.updatePipeline(pipeline);
|
||||
|
||||
PipelineInstanceQuery pipelineInstanceQuery = new PipelineInstanceQuery();
|
||||
pipelineInstanceQuery.setState(PipelineFinal.RUN_RUN);
|
||||
pipelineInstanceQuery.setPipelineId(pipelineId);
|
||||
List<PipelineInstance> pipelineInstanceList = pipelineInstanceService.findPipelineInstanceList(pipelineInstanceQuery);
|
||||
for (PipelineInstance pipelineInstance : pipelineInstanceList) {
|
||||
String instanceId = pipelineInstance.getInstanceId();
|
||||
pipelineInstance.setRunStatus(PipelineFinal.RUN_HALT);
|
||||
int runtime = pipelineInstanceService.findInstanceRuntime(instanceId);
|
||||
pipelineInstance.setRunTime(runtime);
|
||||
pipelineInstanceService.updateInstance(pipelineInstance);
|
||||
}
|
||||
removeExecCache(pipelineId);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
AgentMessage agentMessage = new AgentMessage();
|
||||
agentMessage.setType("stop");
|
||||
agentMessage.setMessage(pipelineId);
|
||||
agentMessage.setPipelineId(pipelineId);
|
||||
SocketServerHandler.instance().sendHandleMessage(agent.getAddress(), agentMessage);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
// 添加资源配置
|
||||
// resourcesService.instanceResources(integer);
|
||||
|
||||
// 更新流水线状态
|
||||
pipeline.setState(1);
|
||||
pipelineService.updatePipeline(pipeline);
|
||||
|
||||
PipelineInstanceQuery pipelineInstanceQuery = new PipelineInstanceQuery();
|
||||
pipelineInstanceQuery.setState(PipelineFinal.RUN_RUN);
|
||||
pipelineInstanceQuery.setPipelineId(pipelineId);
|
||||
List<PipelineInstance> pipelineInstanceList = pipelineInstanceService.findPipelineInstanceList(pipelineInstanceQuery);
|
||||
for (PipelineInstance pipelineInstance : pipelineInstanceList) {
|
||||
pipelineInstance.setRunStatus(PipelineFinal.RUN_HALT);
|
||||
int runtime = pipelineInstanceService.findInstanceRuntime(pipelineInstance.getInstanceId());
|
||||
pipelineInstance.setRunTime(runtime);
|
||||
pipelineInstanceService.updateInstance(pipelineInstance);
|
||||
}
|
||||
removeExecCache(pipelineId);
|
||||
}
|
||||
|
||||
public void removeExecCache(String pipelineId) {
|
||||
String instanceId = pipelineIdOrInstanceId.get(pipelineId);
|
||||
PipelineInstanceServiceImpl.runTimeMap.remove(instanceId);
|
||||
pipelineInstanceService.stopThread(instanceId);
|
||||
pipelineIdOrInstanceId.remove(pipelineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keepOn(String pipelineId) {
|
||||
Agent agent = pipelineIdOrAgentId.get(pipelineId);
|
||||
String id = agent.getAddress();
|
||||
AgentMessage agentMessage = new AgentMessage();
|
||||
agentMessage.setType("keepOn");
|
||||
agentMessage.setMessage(pipelineId);
|
||||
agentMessage.setPipelineId(pipelineId);
|
||||
WebSocketSession session = SocketServerHandler.sessionMap.get(id);
|
||||
if (Objects.isNull(session)) {
|
||||
throw new SystemException("客户端推送消息失败,无法获取客户端连接,客户端信息:" + id);
|
||||
}
|
||||
|
||||
try {
|
||||
SocketServerHandler.instance().sendHandleMessage(id, agentMessage);
|
||||
} catch (Exception e) {
|
||||
throw new SystemException("客户端推送消息失败,错误信息:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,158 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.instance.service;
|
||||
|
||||
import cd.casic.ci.commons.bean.engine.execute.PipelineRunMsg;
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstance;
|
||||
import cd.casic.ci.commons.bean.process.instance.PipelineInstanceQuery;
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.process.engine.task.TasksInstanceService;
|
||||
import cd.casic.module.process.process.instance.PipelineInstanceService;
|
||||
import cd.casic.module.process.process.instance.dao.PipelineInstanceDao;
|
||||
import cd.casic.module.process.process.stage.StageInstanceServer;
|
||||
import cd.casic.module.process.support.util.PipelineUtilService;
|
||||
import cd.casic.module.process.task.build.service.TaskBuildProductService;
|
||||
import cd.casic.module.process.toolkit.join.JoinTemplate;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* 流水线实例服务
|
||||
*/
|
||||
@Service
|
||||
//@Exporter TODO
|
||||
public class PipelineInstanceServiceImpl implements PipelineInstanceService {
|
||||
public static final Map<String,Integer> runTimeMap = new HashMap<>();
|
||||
|
||||
|
||||
@Override
|
||||
public String createInstance(PipelineInstance pipelineInstance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAllInstance(String pipelineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipelineInstance initializeInstance(PipelineRunMsg runMsg) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteInstance(String instanceId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInstance(PipelineInstance pipelineInstance) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipelineInstance findOneInstance(String instanceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipelineInstance findLatelyInstance(String pipelineId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findAllInstance() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findPipelineAllInstance(String pipelineId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findUserPipelineInstance(String userId, Integer limit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findRunInstanceId(String pipelineId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findInstanceList(List<String> idList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findPipelineInstanceList(PipelineInstanceQuery pipelineInstanceQuery) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PipelineInstance> findUserInstance(PipelineInstanceQuery pipelineInstanceQuery) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PipelineInstance> findPipelineInstance(PipelineInstanceQuery query) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findInstanceByTime(String pipelineId, String[] queryTime) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipelineInstance> findInstanceByTime(String[] queryTime) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int findInstanceRuntime(String instanceId) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void instanceRuntime(String instanceId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopThread(String threadName) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
package cd.casic.module.process.pipeline.overview.service;
|
||||
|
||||
|
||||
import cd.casic.ci.commons.bean.support.count.PipelineOverview;
|
||||
|
||||
/**
|
||||
* 流水线统计服务接口
|
||||
*/
|
||||
|
||||
public interface PipelineOverviewService {
|
||||
|
||||
|
||||
/**
|
||||
* 流水线执行信息统计
|
||||
* @param pipelineId 流水线id
|
||||
* @return 统计信息
|
||||
*/
|
||||
PipelineOverview pipelineOverview(String pipelineId);
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package cd.casic.module.process.privilege.role.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PatchUser {
|
||||
private String userId;
|
||||
private Integer roleType = 0;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package cd.casic.module.process.privilege.vRole.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VRole {
|
||||
private String id;
|
||||
private String name;
|
||||
private String des;
|
||||
private Integer type;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package cd.casic.module.process.privilege.vRole.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class VRoleDomain {
|
||||
private List<VRole> vRoleList;
|
||||
private String domainId;
|
||||
private String type;
|
||||
private String modelId;
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
package cd.casic.module.process.process.definition;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Condition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线变量服务接口
|
||||
*/
|
||||
public interface ConditionService {
|
||||
|
||||
/**
|
||||
* 创建条件
|
||||
* @param condition 条件
|
||||
* @return 条件id
|
||||
*/
|
||||
String createCond(Condition condition);
|
||||
|
||||
|
||||
/**
|
||||
* 效验条件
|
||||
* @param pipelineId 流水线id
|
||||
* @param taskId 配置id
|
||||
* @return 状态 true:条件满足 false:条件不满足
|
||||
*/
|
||||
Boolean variableCondition(String pipelineId,String taskId);
|
||||
|
||||
/**
|
||||
* 删除条件
|
||||
* @param condId 条件id
|
||||
*/
|
||||
void deleteCond(String condId);
|
||||
|
||||
/**
|
||||
* 更新条件
|
||||
* @param condition 条件信息
|
||||
*/
|
||||
void updateCond(Condition condition);
|
||||
|
||||
/**
|
||||
* 查询单个条件
|
||||
* @param condId 条件id
|
||||
* @return 条件信息
|
||||
*/
|
||||
Condition findOneCond(String condId);
|
||||
|
||||
/**
|
||||
* 查询任务条件
|
||||
* @param taskId 任务id
|
||||
* @return 条件集合
|
||||
*/
|
||||
List<Condition> findAllTaskCond(String taskId);
|
||||
|
||||
|
||||
// 克隆条件
|
||||
void cloneCond(String id ,String cloneId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,65 +0,0 @@
|
||||
package cd.casic.module.process.process.definition;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollow;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollowQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线收藏服务接口
|
||||
*/
|
||||
public interface PipelineFollowService {
|
||||
|
||||
/**
|
||||
* 创建收藏
|
||||
* @param pipelineFollow 收藏模型
|
||||
*/
|
||||
void updateFollow(PipelineFollow pipelineFollow);
|
||||
|
||||
/**
|
||||
* 获取用户收藏的流水线
|
||||
* @param userId 用户id
|
||||
* @return 收藏的流水线
|
||||
*/
|
||||
List<PipelineFollow> findUserFollowPipeline(String userId);
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
* @param followQuery 条件
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<PipelineFollow> findFollowQueryList(PipelineFollowQuery followQuery);
|
||||
|
||||
/**
|
||||
* 删除收藏
|
||||
* @param followId 收藏id
|
||||
*/
|
||||
void deleteFollow(String followId);
|
||||
|
||||
/**
|
||||
* 删除流水线相关的所有收藏
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void deletePipelineFollow(String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询单个信息
|
||||
* @param followId 收藏id
|
||||
* @return 收藏信息
|
||||
*/
|
||||
PipelineFollow findOneFollow(String followId);
|
||||
|
||||
/**
|
||||
* 查询所有收藏
|
||||
* @return 收藏集合
|
||||
*/
|
||||
List<PipelineFollow> findAllFollow();
|
||||
|
||||
/**
|
||||
* 根据ID列表批量查询收藏信息
|
||||
* @param idList 收藏ID列表
|
||||
* @return 收藏信息列表
|
||||
*/
|
||||
List<PipelineFollow> findAllFollowList(List<String> idList);
|
||||
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package cd.casic.module.process.process.definition;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineOpen;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线最近打开服务接口
|
||||
*/
|
||||
public interface PipelineOpenService {
|
||||
|
||||
/**
|
||||
* 查询用户最近打开流水线(详细信息)
|
||||
*
|
||||
* @param number 查询数量
|
||||
* @return 最近打开的流水线
|
||||
*/
|
||||
List<PipelineOpen> findUserAllOpen(int number);
|
||||
|
||||
/**
|
||||
* 查询用户最近打开流水线
|
||||
*
|
||||
* @param number 查询数量
|
||||
* @return 最近打开的流水线
|
||||
*/
|
||||
List<String> findUserOpen(int number);
|
||||
|
||||
/**
|
||||
* 删除流水线收藏
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void deleteAllOpen(String pipelineId);
|
||||
|
||||
/**
|
||||
* 获取打开的流水线
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void updatePipelineOpen(String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询单个次数信息
|
||||
*
|
||||
* @param openId 次数id
|
||||
* @return 次数信息
|
||||
*/
|
||||
PipelineOpen findOneOpen(String openId);
|
||||
|
||||
/**
|
||||
* 查询所有次数
|
||||
*
|
||||
* @return 次数集合
|
||||
*/
|
||||
List<PipelineOpen> findAllOpen();
|
||||
|
||||
/**
|
||||
* 根据ID列表批量查询流水线打开信息
|
||||
*
|
||||
* @param idList 流水线ID列表
|
||||
* @return 流水线打开信息列表
|
||||
*/
|
||||
List<PipelineOpen> findAllOpenList(List<String> idList);
|
||||
|
||||
}
|
@ -1,199 +0,0 @@
|
||||
package cd.casic.module.process.process.definition;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineQuery;
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineRecently;
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线服务接口
|
||||
*/
|
||||
public interface PipelineService {
|
||||
|
||||
/**
|
||||
* 创建流水线
|
||||
*
|
||||
* @param pipeline 流水线信息
|
||||
* @return 流水线id
|
||||
*/
|
||||
String createPipeline(@NotNull @Valid Pipeline pipeline);
|
||||
|
||||
/**
|
||||
* 删除流水线
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void deletePipeline(@NotNull String pipelineId);
|
||||
|
||||
/**
|
||||
* 更新流水线
|
||||
*
|
||||
* @param pipeline 更新后流水线信息
|
||||
*/
|
||||
void updatePipeline(@NotNull @Valid Pipeline pipeline);
|
||||
|
||||
/**
|
||||
* 查询单个流水线
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
* @return 流水线信息
|
||||
*/
|
||||
Pipeline findPipelineById(@NotNull String pipelineId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询单个流水线(不进行关联查询)
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
* @return 流水线信息
|
||||
*/
|
||||
Pipeline findPipelineByIdNoQuery(String pipelineId);
|
||||
|
||||
/**
|
||||
* 该接口返回用户流水线
|
||||
*
|
||||
* @param pipelineId 流水线Id
|
||||
* @return 流水线
|
||||
*/
|
||||
Pipeline findOnePipeline(String pipelineId);
|
||||
|
||||
/**
|
||||
* 该接口返回用户流水线
|
||||
*
|
||||
* @param pipelineId 流水线Id
|
||||
* @return 流水线
|
||||
*/
|
||||
Pipeline findPipelineNoQuery(String pipelineId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新流水线负责人
|
||||
*
|
||||
* @param userId 负责人信息
|
||||
*/
|
||||
void updatePipelineRootUser(String userId);
|
||||
|
||||
/**
|
||||
* 查询所有流水线
|
||||
*
|
||||
* @return 流水线列表
|
||||
*/
|
||||
List<Pipeline> findAllPipeline();
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有流水线(不进行关联查询)
|
||||
*
|
||||
* @return 流水线列表
|
||||
*/
|
||||
List<Pipeline> findAllPipelineNoQuery();
|
||||
|
||||
List<Pipeline> findAllPipelineList(List<String> idList);
|
||||
|
||||
/**
|
||||
* 获取用户流水线
|
||||
*
|
||||
* @return 流水线信息
|
||||
*/
|
||||
List<Pipeline> findUserPipeline(PipelineQuery query);
|
||||
|
||||
/**
|
||||
* 分页查询流水线信息
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 流水线信息
|
||||
*/
|
||||
PageResult<Pipeline> findUserPipelinePage(PipelineQuery query);
|
||||
|
||||
|
||||
/**
|
||||
* 根据查询条件获取流水线列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 流水线列表
|
||||
*/
|
||||
List<Pipeline> findPipelineList(PipelineQuery query);
|
||||
|
||||
|
||||
/**
|
||||
* 查询拥有此流水线的用户
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
* @return 用户信息
|
||||
*/
|
||||
List<AdminUserRespDTO> findPipelineUser(String pipelineId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前用户最近构建的流水线
|
||||
*
|
||||
* @return 流水线信息
|
||||
*/
|
||||
List<PipelineRecently> findPipelineRecently(String userId, int number);
|
||||
|
||||
|
||||
/**
|
||||
* 获取clone的流水线名称
|
||||
*
|
||||
* @param pipelineId 流水线ID
|
||||
* @return 流水线民初
|
||||
*/
|
||||
String findPipelineCloneName(String pipelineId);
|
||||
|
||||
|
||||
/**
|
||||
* 流水线克隆
|
||||
*
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void pipelineClone(String pipelineId, String pipelineName);
|
||||
|
||||
|
||||
/**
|
||||
* 获取最近打开的流水线
|
||||
*
|
||||
* @param number 数量
|
||||
* @return 流水线
|
||||
*/
|
||||
List<Pipeline> findRecentlyPipeline(Integer number, String pipelineId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
package cd.casic.module.process.process.definition;
|
||||
|
||||
public interface PipelineYamlService {
|
||||
|
||||
/**
|
||||
* 导入流水线YAML配置
|
||||
* @param pipelineId 流水线id
|
||||
* @return YAML配置内容
|
||||
*/
|
||||
String importPipelineYaml(String pipelineId);
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package cd.casic.module.process.process.definition.dao;
|
||||
|
||||
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cd.casic.module.process.process.definition.dataobject.ConditionDo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname ConditionDao
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 20:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConditionDao extends BaseMapperX<ConditionDo> {
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
package cd.casic.module.process.process.definition.dao;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineQuery;
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineEntity;
|
||||
import cd.casic.module.process.process.definition.dataobject.PipelineDo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname Pipeline
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 14:13
|
||||
*/
|
||||
@Mapper
|
||||
public interface PipelineDao extends BaseMapperX<PipelineDo> {
|
||||
/**
|
||||
* 创建流水线
|
||||
* @param pipelineEntity 流水线实体
|
||||
* @return 流水线id
|
||||
*/
|
||||
public String createPipeline(PipelineEntity pipelineEntity);
|
||||
|
||||
/**
|
||||
* 删除流水线
|
||||
* @param id 流水线id
|
||||
*/
|
||||
public void deletePipeline(String id);
|
||||
|
||||
/**
|
||||
* 更新流水线
|
||||
* @param pipelineEntity 流水线实体
|
||||
*/
|
||||
public void updatePipeline(PipelineEntity pipelineEntity);
|
||||
|
||||
/**
|
||||
* 查询单个流水线
|
||||
* @param id 流水线id
|
||||
* @return 流水线信息
|
||||
*/
|
||||
public PipelineEntity findPipelineById(String id);
|
||||
|
||||
/**
|
||||
* 查询所有流水线
|
||||
* @return 流水线列表
|
||||
*/
|
||||
public List<PipelineEntity> findAllPipeline();
|
||||
|
||||
|
||||
public List<PipelineEntity> findAllPipelineList(List<String> idList);
|
||||
|
||||
// 关联查询,查询出收藏的
|
||||
public PageResult<PipelineEntity> findPipelineListQuery(PipelineQuery query);
|
||||
|
||||
|
||||
// 第一个方法:将字符串中的所有字母都转换为小写
|
||||
// public static String toLowerCase(String input) {
|
||||
// if (input == null) {
|
||||
// return null;
|
||||
// }
|
||||
// StringBuilder result = new StringBuilder();
|
||||
// for (char c : input.toCharArray()) {
|
||||
// // 如果是大写字母,转换为小写
|
||||
// if (Character.isUpperCase(c)) {
|
||||
// result.append(Character.toLowerCase(c));
|
||||
// } else {
|
||||
// result.append(c);
|
||||
// }
|
||||
// }
|
||||
// return result.toString();
|
||||
// }
|
||||
|
||||
// 第二个方法:将字符串中的所有字母都转换为大写
|
||||
// public static String toUpperCase(String input) {
|
||||
// if (input == null) {
|
||||
// return null;
|
||||
// }
|
||||
// StringBuilder result = new StringBuilder();
|
||||
// for (char c : input.toCharArray()) {
|
||||
// // 如果是小写字母,转换为大写
|
||||
// if (Character.isLowerCase(c)) {
|
||||
// result.append(Character.toUpperCase(c));
|
||||
// } else {
|
||||
// result.append(c);
|
||||
// }
|
||||
// }
|
||||
// return result.toString();
|
||||
// }
|
||||
|
||||
|
||||
public List<PipelineEntity> findPipelineList(PipelineQuery query);
|
||||
|
||||
public PageResult<PipelineEntity> findPipelinePage(PipelineQuery query);
|
||||
|
||||
// default String getLowerCase(String pipelineName) {
|
||||
// return toLowerCase(pipelineName);
|
||||
// }
|
||||
|
||||
public List<PipelineEntity> findRecentlyPipeline(Object[] pipelineIds, Integer number);
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
package cd.casic.module.process.process.definition.dao;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineFollowQuery;
|
||||
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineFollowEntity;
|
||||
import cd.casic.module.process.process.definition.dataobject.PipelineFollowDo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname PipelineFollowDao
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 14:23
|
||||
*/
|
||||
@Mapper
|
||||
public interface PipelineFollowDao extends BaseMapperX<PipelineFollowDo> {
|
||||
|
||||
/**
|
||||
* 创建收藏
|
||||
* @param pipelineFollowEntity 收藏
|
||||
* @return 收藏id
|
||||
*/
|
||||
public String createFollow(PipelineFollowEntity pipelineFollowEntity);
|
||||
|
||||
/**
|
||||
* 删除收藏
|
||||
* @param followId 收藏id
|
||||
*/
|
||||
public void deleteFollow(String followId);
|
||||
|
||||
/**
|
||||
* 更新收藏
|
||||
* @param pipelineFollowEntity 更新信息
|
||||
*/
|
||||
public void updateFollow(PipelineFollowEntity pipelineFollowEntity);
|
||||
|
||||
/**
|
||||
* 查询单个收藏信息
|
||||
* @param followId 收藏id
|
||||
* @return 收藏信息
|
||||
*/
|
||||
public PipelineFollowEntity findOneFollow(String followId);
|
||||
|
||||
/**
|
||||
* 查询所有收藏
|
||||
* @return 收藏集合
|
||||
*/
|
||||
public List<PipelineFollowEntity> findAllFollow();
|
||||
|
||||
|
||||
public List<PipelineFollowEntity> findAllFollowList(List<String> idList);
|
||||
|
||||
/**
|
||||
* 查询用户是否收藏该流水线
|
||||
* @param userId 用户id
|
||||
* @param pipelineId 流水线id
|
||||
* @return 收藏信息
|
||||
*/
|
||||
public List<PipelineFollowEntity> findOneUserFollowPipeline(String userId, String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询用户是藏的流水线
|
||||
* @param userId 用户id
|
||||
* @return 收藏信息
|
||||
*/
|
||||
public List<PipelineFollowEntity> findUserFollowPipeline(String userId);
|
||||
|
||||
|
||||
public List<PipelineFollowEntity> findFollowQueryList(PipelineFollowQuery followQuery);
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
package cd.casic.module.process.process.definition.dao;
|
||||
|
||||
import cd.casic.ci.commons.bean.process.definition.PipelineOpenQuery;
|
||||
import cd.casic.framework.commons.pojo.PageResult;
|
||||
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cd.casic.module.process.pipeline.definition.entity.PipelineOpenEntity;
|
||||
import cd.casic.module.process.process.definition.dataobject.PipelineOpenDo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname PipelineOpenDao
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 14:25
|
||||
*/
|
||||
@Mapper
|
||||
public interface PipelineOpenDao extends BaseMapperX<PipelineOpenDo> {
|
||||
/**
|
||||
* 创建次数
|
||||
* @param pipelineOpenEntity 次数
|
||||
* @return 次数id
|
||||
*/
|
||||
public String createOpen(PipelineOpenEntity pipelineOpenEntity);
|
||||
|
||||
/**
|
||||
* 删除次数
|
||||
* @param openId 次数id
|
||||
*/
|
||||
public void deleteOpen(String openId);
|
||||
|
||||
/**
|
||||
* 更新次数
|
||||
* @param pipelineOpenEntity 更新信息
|
||||
*/
|
||||
public void updateOpen(PipelineOpenEntity pipelineOpenEntity);
|
||||
|
||||
/**
|
||||
* 查询单个次数信息
|
||||
* @param openId 次数id
|
||||
* @return 次数信息
|
||||
*/
|
||||
public PipelineOpenEntity findOneOpen(String openId);
|
||||
|
||||
/**
|
||||
* 查询用户最近打开的流水线
|
||||
* @param userId 用户id
|
||||
* @return 最近打开信息
|
||||
*/
|
||||
public List<PipelineOpenEntity> findUserAllOpen(String userId);
|
||||
|
||||
public Integer findUserOpenNumberByTime(String userId,String pipelineId,String time);
|
||||
|
||||
|
||||
public Integer findUserOpenNumber(String userId,String pipelineId);
|
||||
|
||||
public List<String> findUserPipelineOpen(String userId,Integer number);
|
||||
|
||||
public List<String> findUserOpen(String userId,Integer number,String pipelineIds);
|
||||
|
||||
|
||||
public List<PipelineOpenEntity> findExpirePipelineOpen(String time);
|
||||
|
||||
|
||||
|
||||
public String findUserLastOpenPipeline(String userId,String pipelineId);
|
||||
|
||||
|
||||
public List<PipelineOpenEntity> findPipelineOpenList(PipelineOpenQuery query);
|
||||
|
||||
|
||||
public PageResult<PipelineOpenEntity> findPipelineOpenPage(PipelineOpenQuery query);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有次数
|
||||
* @return 次数集合
|
||||
*/
|
||||
public List<PipelineOpenEntity> findAllOpen();
|
||||
|
||||
public List<PipelineOpenEntity> findAllOpenList(List<String> idList);
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package cd.casic.module.process.process.definition.dataobject;
|
||||
|
||||
import cd.casic.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author by mianbin
|
||||
* @Classname ConditionDo
|
||||
* @Description TODO
|
||||
* @Date 2025/4/23 20:36
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "pip_condition", autoResultMap = true)
|
||||
public class ConditionDo extends BaseDO {
|
||||
|
||||
@TableId
|
||||
private String condId;
|
||||
|
||||
private String condName;
|
||||
|
||||
private String taskId;
|
||||
// todo
|
||||
// private String createTime;
|
||||
|
||||
private int condType;
|
||||
|
||||
private String condKey;
|
||||
|
||||
private String condValue;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user