gitlab-runner register #输入公司的gitlab公网地址 Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/): http://gitlab.wuidm.com/ #输入gitlab的token Please enter the gitlab-ci token for this runner: #输入描述这个runner名称 Please enter the gitlab-ci description for this runner: [k8s-node02]: test #输入runner的标签 Please enter the gitlab-ci tags for this runner (comma separated): my-tag,another-tag Registering runner... succeeded runner=8sjydnrs #输入runner执行器的环境 Please enter the executor: custom, docker-ssh, parallels, kubernetes, docker-ssh+machine, docker, shell, ssh, virtualbox, docker+machine: shell
sonarqube-check: tags: -test 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: -sonar-scanner allow_failure:true only: -master # - merge_requests # - develop
在 SonarQube 的通用配置里面,配置好 base URL, 以方便在 gitlab 的评论里面能够正确连接到 SonarQube 平台。
sonarqube-check: tags: -sonar 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: -JAVA_HOME=/home/zwadmin/data/jdk-11/&&exportJAVA_HOME -mvnverifysonar:sonar-Dsonar.projectKey=com.ydm:zw-ydm-Dsonar.branch.name=feature/sonar-1216 allow_failure:true only: -feature/sonar-1216 # - merge_requests
整合 IDEA 插件
用于同步服务器上的规则、质量配置文件和文件排除设置。
创建token类型为用户
IDEA Plugins Marketplace 下载 SonarQube for IDE。
连接到SonarQube。
配置项目
BUG 记录
docker 拉取失败 (Client.Timeout exceeded while awaiting headers)
内链:[[Docker拉取失败 (Client.Timeout exceeded while awaiting headers)]]