码迷,mamicode.com
首页 > 其他好文 > 详细

Jenkins集成sonarQube 8.2

时间:2020-03-15 11:40:41      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:mit   准备   href   about   mes   set   art   ons   log   

目录准备

  • mkdir -p /home/jenkins_root/sonarQube/{sonarqube_data,sonarqube_extensions,sonarqube_logs,conf}

  • mkdir -p /home/jenkins_root/sonarQube/postgreSQL_data

目录说明

sonarqube_data – contains data files, such as the embedded H2 database and Elasticsearch indexes
sonarqube_logs – contains SonarQube logs about access, web process, CE process, and Elasticsearch
sonarqube_extensions – contains plugins, such as language analyzers

镜像准备更多参数配置

FROM sonarqube:8.2-community
COPY /home/jenkins_root/sonarQube/conf/sonar.properties  /opt/sonarqube/conf/
  • $ docker build --tag=sonarqube-custom .
  • $ docker run -ti sonarqube-custom

[^避免暴力停止容器导致任务终端 --stop-timeout 3600 (延迟关闭容器)]

version: '2.4'
services:
  postgres:
    image: "postgres" 
    restart: always 
    ports: 
     - "9000:9000"
  sonar:
    image: "sonarqube:lastest"
    restart: always
    ports:
     - "9000:9000"
     - "9092:9092"
    volumes:
     - "/home/jenkins_root/jenkins_install_dir:/var/jenkins_home"
     - "/home/jenkins_root/sonarQube/sonarqube_data:/opt/sonarqube/data"
     - "/home/jenkins_root/sonarQube/sonarqube_extensions:/opt/sonarqube/extensions"
     - "/home/jenkins_root/sonarQube/sonarqube_logs:/opt/sonarqube/logs"
    environment:
     - sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=cloudnet
     - sonar.jdbc.url=jdbc:username:eccom
     - sonar.jdbc.url=jdbc:password:eccom   
    network_mode: "host"
    cpus: 1
    mem_limit: 2g
    depends_on:
     - postgres

loading...

Jenkins集成sonarQube 8.2

标签:mit   准备   href   about   mes   set   art   ons   log   

原文地址:https://www.cnblogs.com/nhz-M/p/12496519.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!