代码检测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: 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" - "/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: #创建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/
相关推荐
sakurayz 2020-06-16
yuanyuan 2020-06-14
yuanyuan 2020-06-14
hevenue 2020-06-04
yieryi 2020-06-02
yuanyuan 2020-05-17
huaqiangli 2020-05-14
yangliuhbhd 2020-05-11
一片荷叶 2020-05-09
静水楼台 2020-05-09
huaqiangli 2020-04-27
yieryi 2020-04-10
郭宇 2020-02-14
xiaodaiwang 2020-02-02
xiaodaiwang 2020-01-09
leonranri 2019-12-16
xiaodaiwang 2019-11-02
chwnpp 2018-01-05
sakurayz 2019-10-24
arnodzl 2019-07-31
sakurayz 2019-04-05
BigBirds 2019-09-12
huaqiangli 2019-08-05
wesaylove 2017-06-19
静水楼台 2019-07-24
mydownloador 2019-07-24
BORISHOU 2019-07-23
yuanyuan 2016-11-25
sakurayz 2015-07-25
骑苍蝇过大海 2015-06-19
BigBirds 2019-06-28
sakurayz 2019-06-28