代码拉取完成,页面将自动刷新
stages:
- code_quality
- code_report
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
when: never
- if: "$CI_COMMIT_BRANCH"
SONAR 分析:
tags:
- docker
stage: code_quality
image: harbor.baijiayun.com/sonar-scanner/sonar-scanner-cli:latest
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_PROJECT_PATH}_${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
paths:
- .sonar/cache
script:
- export
- sonar-scanner
-Dsonar.verbose=false
-Dsonar.qualitygate.wait=true
-Dsonar.projectKey=${PROJECT_KEY}
-Dsonar.projectName=${PROJECT_NAME}
-Dsonar.language=java
-Dsonar.java.source=1.8
-Dsonar.java.binaries=.
-Dsonar.java.libraries=sonar/*.jar
-Dsonar.exclusions=config/*,bin/*,*.xml
allow_failure: true
SONAR 报告:
tags:
- docker
stage: code_report
image: ${DOCKER_REGISTRY}/cicd/sonarnotify:latest
script:
- export
- sonarnotify
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。