提交 e440ff56 authored 作者: husishuai's avatar husishuai

init

上级 c1f220c3
流水线 #218 已失败
stages:
- sonarqube-check
- sonarqube-vulnerability-report
sonarqube-check:
stage: sonarqube-check
image: maven:3-eclipse-temurin-17
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar
allow_failure: true
only:
- merge_requests
- master
- main
- develop
sonarqube-vulnerability-report:
stage: sonarqube-vulnerability-report
script:
- 'curl -u "${SONAR_TOKEN}:" "${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=hushuai_sonarqube_268af5c1-6c6e-4720-9b3b-aa6b9dcdeae0&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:
sast: gl-sast-sonar-report.json
dependencies:
- sonarqube-check
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<description>test</description> <description>test</description>
<properties> <properties>
<java.version>17</java.version> <java.version>17</java.version>
<sonar.projectKey>hushuai_sonarqube_268af5c1-6c6e-4720-9b3b-aa6b9dcdeae0</sonar.projectKey>
<sonar.projectName>sonarqube</sonar.projectName>
<sonar.qualitygate.wait>true</sonar.qualitygate.wait>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
......
spring.application.name=test spring.application.name=test
server.port=8081
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论