欢迎光临
我们一直在努力

代码检测docker-sonarqube

本站教程收集整理的这篇文章主要介绍了代码检测docker-sonarqube,本站教程本站觉得挺不错的,现在分享给大家,也给大家做个参考。

gitlab-ce + gitlab-runner + sonarqube,在提交代码时对代码质量进行检测,对不符合要求的代码不允许提交到gitlab

version: '3.1'
services:

  gitlab-ce:
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab-ce
    restart: always
    hostname: 'gitlab.localhost.com'
    environment:
      GITLAB_OMNIBUS_CONfig: |
        external_url 'http://192.168.31.109'
    ports:
      - '80:80'
      - '443:443'
      - '10022:22'
    volumes:
      - '/root/gitlab-ce/home/config:/etc/gitlab'
      - '/root/gitlab-ce/home/logs:/var/log/gitlab'
      - '/root/gitlab-ce/home/data:/var/opt/gitlab'
    networks:
      - 'default'

  gitlab-runner:
    image: 'gitlab/gitlab-runner:latest'
    container_name: gitlab-runner
    depends_on:
      - 'gitlab-ce'
    restart: always
    volumes:
      - '/root/gitlab-ce/runnerconfig:/etc/gitlab-runner'
      - '/var/run/docker.sock:/var/run/docker.sock'
    networks:
      - 'default'
    links:
      - 'gitlab-ce:gitlab.localhost.com'

  MysqL:
    image: MysqL:5.7.27
    container_name: MysqL
    command: --default-authentication-plugin=MysqL_native_password
    restart: always
    ports:
      - 3306:3306
    volumes:
      - /root/gitlab-ce/MysqL/data:/var/lib/MysqL
      - /root/gitlab-ce/MysqL/logs:/logs
      - /root/gitlab-ce/MysqL/init:/docker-entrypoint-initdb.d
    environment:
      MysqL_ROOT_password: root@123456
      MysqL_USER: test   #创建test用户
      MysqL_password: test  #设置test用户的密码
    networks:
      - 'default'

  sonarqube:
    image: sonarqube:7.7-community
#    image: sonarqube:latest
    container_name: sonarqube
    ports:
      - "9000:9000"
      - "9002:9002"
    volumes:
      - "/root/gitlab-ce/sonarqube/conf:/opt/sonarqube/conf"
      - 香港vps "/root/gitlab-ce/sonarqube/extensions:/opt/sonarqube/extensions"
      - "/root/gitlab-ce/sonarqube/logs:/opt/sonarqube/logs"
      - "/etc/sysctl.conf:/etc/sysctl.conf"
#     - "/root/gitlab-ce/sonarqube/data:/opt/sonarqube/data"
    environment:
      sonar.jdbc.username: root   #root管理员用户密码
      sonar.jdbc.password: root@123456   #创建test用户
      sonar.jdbc.url: "jdbc:MysqL://MysqL:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerfoRMANce&useSSL=false"
    restart: always
    depends_on:
      - MysqL
    links:
      - MysqL
    networks:
      - 'default'

    sysctls:
      - net.core.somaxconn=1024
    ulimits:
      nproc: 65536
      nofile:
        soft: 65536
        hard: 65536  

networks:
  default:
    driver: 'bridge'

未测试。
参考:
https://yq.aliyun.com/articles/711488?spm=a2c4e.11155435.0.0.16cc2eb4nWOrV4
https://www.ibm.com/developerworks/cn/java/j-lo-sonar/

本站总结

以上是本站教程为你收集整理的代码检测docker-sonarqube全部内容,希望文章能够帮你解决代码检测docker-sonarqube所遇到的程序开发问题。

如果觉得本站教程网站内容还不错,欢迎将本站教程推荐给好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。