Browse Source

sonarqube test

master
wanggang 1 year ago
parent
commit
b6a054491f
  1. 32
      .drone.yml
  2. 2
      .gitignore
  3. 26
      docker-compose.yml

32
.drone.yml

@ -21,32 +21,8 @@ steps:
- echo "${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_AUTHOR}-${DRONE_REPO_BRANCH}-${DRONE_COMMIT_SHA:0:8}\n">./publish/version.txt - echo "${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_AUTHOR}-${DRONE_REPO_BRANCH}-${DRONE_COMMIT_SHA:0:8}\n">./publish/version.txt
- echo ${DRONE_COMMIT_MESSAGE}>>./publish/version.txt - echo ${DRONE_COMMIT_MESSAGE}>>./publish/version.txt
- name: stop - name: code-analysis
image: appleboy/drone-ssh image: aosapps/drone-sonar-plugin
settings: settings:
host: dev.ccwin-in.com sonar_host: dev.ccwin-in.com:3005
port: 16085 sonar_token: sqa_a1da3cf5984f39d9a256493acbae857c6624e954
username: Administrator
password: Microsoft@2022
command_timeout: 10m
script:
- env
- mkdir -p /d/publish/${V_PRODUCT}/${V_PROJECT}
- cd /d/publish/${V_PRODUCT}/${V_PROJECT}
- ./stop.cmd
- sleep 3
- cd ..
- rm -rf publish
- mkdir -p publish
- name: publish
image: plugins/s3
settings:
endpoint: http://dev.ccwin-in.com:3008
path_style: true
bucket: default
access_key: O222sbIaMKeGfeX18t8K
secret_key: 0LEOWfXSDnaLbIYGZfdKUxyi2kYIayx4YvdLTgcR
source: build/publish/**/*
strip_prefix: build/publish/
target: /$V_PRODUCT/${V_PROJECT}/${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_AUTHOR}-${DRONE_REPO_BRANCH}-${DRONE_COMMIT_SHA:0:8}

2
.gitignore

@ -1,2 +1,2 @@
data/ data/
log/ logs/

26
docker-compose.yml

@ -84,3 +84,29 @@ services:
- ${DOCKER_SOCK}:/var/run/docker.sock - ${DOCKER_SOCK}:/var/run/docker.sock
depends_on: depends_on:
- drone - drone
sonarqube:
image: sonarqube:10.2-community
container_name: sonarqube
depends_on:
- pg
environment:
SONAR_JDBC_URL: jdbc:postgresql://pg:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: true
volumes:
- ./data/sonarqube/data:/opt/sonarqube/data
- ./data/sonarqube/extensions:/opt/sonarqube/extensions
- ./logs/sonarqube:/opt/sonarqube/logs
ports:
- 3005:9000
#command: tail -f /dev/null
pg:
image: postgres:12
container_name: pg
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
volumes:
- ./data/postgresql/postgresql:/var/lib/postgresql
- ./data/postgresql/data:/var/lib/postgresql/data

Loading…
Cancel
Save