OCT 1. 更新 gitlab-ci 配置

This commit is contained in:
黄昕 2024-03-06 11:03:32 +08:00
parent 2adb7b5439
commit 98eab99263
1 changed files with 12 additions and 11 deletions

View File

@ -1,10 +1,10 @@
# 本次构建的阶段: compile、package、deploy
stages :
- sonarqube-check
- sonarqube-vulnerability-report
- compile
- integration-test
- package
- coverage
sonarqube-check :
stage : sonarqube-check
@ -27,21 +27,22 @@ sonarqube-check :
- main
- develop
coverage:
stage: coverage
tags:
- linux-maven
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
sonarqube-vulnerability-report:
stage: sonarqube-vulnerability-report
script:
- python /opt/cover2cover.py target/site/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > target/site/cobertura.xml
- 'curl -u "${SONAR_TOKEN}:" "${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=cmhi_commonframework_79d69580-8b80-4c2c-aff6-b289255ae16a&branch=${CI_COMMIT_BRANCH}&pullRequest=${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
allow_failure: true
only:
- merge_requests
- master
- main
- develop
artifacts:
expire_in: 1 day
reports:
coverage_report:
coverage_format: cobertura
path: target/site/cobertura.xml
sast: gl-sast-sonar-report.json
dependencies:
- package
- sonarqube-check
# 编译
compile :