整理資料的時候發現一些乾貨,如下爲搭建Jenkins、Registry、SVN、GIT、SonarQube、OpenSTF等測試環境的docker腳本,對docker不熟的同窗可自行百度docker-compose,持續更新。android
1,須要Linux,並安裝docker及docker-compose
2,將配置文件保存爲文件,好比jenkins.yml
3,使用命令啓動相關工具,好比:
[CentOS]# docker-compose -f jenkins.yml up -dgit
version: "3" services: jenkins: environment: - "TZ=Asia/Shanghai" container_name: jenkins image: ${REPO:-docker.io}/ravihuang/jenkins ports: - "80:8080" - "50000:50000" restart: always volumes: - "jenkins:/var/jenkins_home" volumes: jenkins:
docker本地倉庫:sql
version: "3" services: registry: container_name: registry image: ${REPO:-docker.io}/registry:latest ports: - "5000:5000" restart: always volumes: - "registry:/var/lib/registry" volumes: registry:
這是git和svn二合一的,你喜歡用哪一個?docker
version: "3" services: svn: image: ${REPO:-docker.io}/mamohr/subversion-edge hostname: "${HOSTNAME-localhost}" ports: - "3343:3343" - "4434:4434" - "18080:18080" restart: always volumes: - "svn:/opt/csvn/data" git: image: ${REPO:-docker.io}/gitlab/gitlab-ce privileged: true hostname: "${HOSTNAME-localhost}" ports: - "443:443" - "80:80" restart: always volumes: - "gitlab-config:/etc/gitlab" - "gitlab-log:/var/log/gitlab" - "gitlab-data:/var/opt/gitlab" volumes: svn: gitlab-config: gitlab-log: gitlab-data:
靜態測試工具:tcp
version: "3" services: sonarqube: image: ${REPO:-docker.io}/sonarqube ports: - "9000:9000" - "9092:9092" restart: always networks: - sonarnet environment: - SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar volumes: - sonarqube_conf:/opt/sonarqube/conf - sonarqube_data:/opt/sonarqube/data - sonarqube_extensions:/opt/sonarqube/extensions - sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins db: image: ${REPO:-docker.io}/postgres restart: always networks: - sonarnet environment: - POSTGRES_USER=sonar - POSTGRES_PASSWORD=sonar volumes: - postgresql:/var/lib/postgresql - postgresql_data:/var/lib/postgresql/data networks: sonarnet: driver: bridge volumes: sonarqube_conf: sonarqube_data: sonarqube_extensions: sonarqube_bundled-plugins: postgresql: postgresql_data:
android手機測試農場,須要自行修改下面的public-ip:ide
version: "3" services: rethinkdb: image: ${REPO:-docker.io}/rethinkdb:2.3 ports: - "8080:8080" restart: always volumes: - "rethinkdb:/data" command: "rethinkdb --bind all --cache-size 2048" adbd: image: ${REPO:-docker.io}/sorccu/adb privileged: true ports: - "5037:5037" restart: always volumes: - "/dev/bus/usb:/dev/bus/usb" stf: image: ${REPO:-docker.io}/ravihuang/stf privileged: true environment: - RETHINKDB_PORT_28015_TCP=tcp://rethinkdb:28015 ports: - "7100:7100" - "7110:7110" - "7120:7120" - "7400-7500:7400-7500" restart: always command: stf local --allow-remote --public-ip 192.168.117.155 --provider-min-port 7400 --provider-max-port 7500 --adb-host adbd depends_on: - rethinkdb volumes: rethinkdb: