2024-03-07 09:03:46 +00:00
|
|
|
stages :
|
|
|
|
- compile
|
2024-03-13 08:48:58 +00:00
|
|
|
- test
|
|
|
|
- sonarqube-check
|
2024-03-07 09:03:46 +00:00
|
|
|
- package
|
|
|
|
|
|
|
|
# 代码质量检查
|
2024-03-12 09:16:48 +00:00
|
|
|
sonarqube-check :
|
|
|
|
stage : sonarqube-check
|
|
|
|
tags :
|
2024-03-07 09:03:46 +00:00
|
|
|
- linux-maven
|
2024-03-12 09:16:48 +00:00
|
|
|
image : maven:3-eclipse-temurin-17
|
|
|
|
variables :
|
2024-03-07 09:03:46 +00:00
|
|
|
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
|
2024-03-12 09:16:48 +00:00
|
|
|
GIT_DEPTH : "0" # Tells git to fetch all the branches of the project, required by the analysis task
|
|
|
|
cache :
|
|
|
|
key : "${CI_JOB_NAME}"
|
2024-03-07 09:03:46 +00:00
|
|
|
paths:
|
|
|
|
- .sonar/cache
|
2024-03-12 09:16:48 +00:00
|
|
|
script :
|
2024-03-12 09:43:37 +00:00
|
|
|
- mvn verify sonar:sonar -Dsonar.exclusions=target/generated-sources/**/* -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=600
|
2024-03-07 09:03:46 +00:00
|
|
|
allow_failure: true
|
2024-03-12 09:16:48 +00:00
|
|
|
only :
|
2024-03-07 09:03:46 +00:00
|
|
|
- merge_requests
|
|
|
|
- master
|
|
|
|
- main
|
|
|
|
- develop
|
2024-03-13 08:48:58 +00:00
|
|
|
dependencies:
|
2024-03-13 08:49:55 +00:00
|
|
|
- integration-test
|
2024-03-07 09:03:46 +00:00
|
|
|
|
|
|
|
# 编译
|
|
|
|
compile :
|
|
|
|
stage : compile
|
|
|
|
tags :
|
|
|
|
- linux-maven
|
|
|
|
only :
|
|
|
|
- master
|
|
|
|
script:
|
|
|
|
- echo "=============== 开始编译任务 ==============="
|
|
|
|
- mvn clean compile -DskipTests
|
|
|
|
|
2024-03-12 03:05:49 +00:00
|
|
|
# 集成测试
|
|
|
|
integration-test:
|
2024-03-13 08:48:58 +00:00
|
|
|
stage : test
|
2024-03-12 09:16:48 +00:00
|
|
|
tags :
|
2024-03-12 03:05:49 +00:00
|
|
|
- linux-maven
|
2024-03-12 09:16:48 +00:00
|
|
|
only :
|
2024-03-12 03:05:49 +00:00
|
|
|
- master
|
2024-03-12 09:16:48 +00:00
|
|
|
script :
|
2024-03-12 03:05:49 +00:00
|
|
|
- echo "=============== 开始集成测试 ==============="
|
|
|
|
- mvn test
|
2024-03-12 09:16:48 +00:00
|
|
|
artifacts :
|
2024-03-12 03:05:49 +00:00
|
|
|
when : always
|
|
|
|
reports:
|
|
|
|
junit:
|
2024-03-13 02:30:51 +00:00
|
|
|
- cs-base/target/surefire-reports/TEST-*.xml
|
|
|
|
- cs-crypto/target/surefire-reports/TEST-*.xml
|
|
|
|
- cs-protocol/target/surefire-reports/TEST-*.xml
|
|
|
|
- cs-database/target/surefire-reports/TEST-*.xml
|
|
|
|
- cs-authentication/target/surefire-reports/TEST-*.xml
|
|
|
|
- cs-restful/target/surefire-reports/TEST-*.xml
|
|
|
|
- cs-integrate-test/target/surefire-reports/TEST-*.xml
|
2024-03-12 03:05:49 +00:00
|
|
|
dependencies:
|
|
|
|
- compile
|
|
|
|
|
2024-03-07 09:03:46 +00:00
|
|
|
# 打包
|
|
|
|
package :
|
|
|
|
stage : package
|
|
|
|
tags :
|
|
|
|
- linux-maven
|
|
|
|
only :
|
|
|
|
- master
|
|
|
|
script:
|
|
|
|
- echo "=============== 开始打包任务 ==============="
|
2024-03-12 03:05:49 +00:00
|
|
|
- mvn clean package
|