Commit 4b1e0534cbcb17ef27fd6b89e148e906683faa58

Authored by Jean-Pierre
0 parents
Exists in master

Initial commit

... ... @@ -0,0 +1,17 @@
  1 +FROM java:8
  2 +
  3 +MAINTAINER Jean-Pierre Huynh <jean-pierre.huynh@alfresco.com>
  4 +
  5 +# Keep up to date according to SonarQube server compatibility matrix
  6 +ENV SONAR_SCANNER_VERSION 2.6.1
  7 +
  8 +ENV SONAR_SCANNER_HOME /sonar-scanner-${SONAR_SCANNER_VERSION}
  9 +ENV SONAR_SCANNER_DIST sonar-scanner-${SONAR_SCANNER_VERSION}.zip
  10 +ENV SONAR_SCANNER_DIST_URL https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/${SONAR_SCANNER_DIST}
  11 +
  12 +RUN wget ${SONAR_SCANNER_DIST_URL} && unzip ${SONAR_SCANNER_DIST} && rm ${SONAR_SCANNER_DIST}
  13 +
  14 +COPY sonar-scanner.properties ${SONAR_SCANNER_HOME}/conf/sonar-scanner.properties
  15 +ADD entrypoint.sh /entrypoint.sh
  16 +
  17 +ENTRYPOINT ["/entrypoint.sh"]
0 18 \ No newline at end of file
... ...
... ... @@ -0,0 +1,30 @@
  1 +#docker-sonar-runner
  2 +
  3 +### How to build
  4 +> docker build -t docker-internal.alfresco.com/docker-sonar-scanner .
  5 +
  6 +### Usage
  7 +
  8 +Copy the project settings file to your project
  9 +```
  10 +cp sample/sonar.project.settings.properties <your_source_folder>
  11 +```
  12 +
  13 +Edit the file with your configuration:
  14 +
  15 +```
  16 +sonar.projectKey=org.alfresco:console-frontend
  17 +
  18 +sonar.projectName=Console Frontend
  19 +sonar.projectVersion=0.0.1
  20 +# /tmp is mandatory
  21 +sonar.sources=/tmp/dist
  22 +
  23 +# Optional
  24 +# sonar.exclusions=/tmp/dist/vendor/**
  25 +```
  26 +
  27 +Start the scan
  28 +```
  29 +docker run -v $PWD:/tmp docker-internal.alfresco.com/docker-sonar-scanner:2.6.1
  30 +```
... ...
... ... @@ -0,0 +1,4 @@
  1 +#!/bin/bash
  2 +
  3 +# Run Sonar Scanner on tmp
  4 +/sonar-scanner-2.6.1/bin/sonar-scanner -Dproject.settings=/tmp/sonar.project.settings.properties
0 5 \ No newline at end of file
... ...
sample/sonar.project.settings.properties
... ... @@ -0,0 +1,15 @@
  1 +# Example: org.alfresco:console-frontend
  2 +sonar.projectKey=
  3 +
  4 +# Example: Console Frontend
  5 +sonar.projectName=
  6 +
  7 +sonar.projectVersion=0.0.1
  8 +
  9 +# Has to start with /tmp
  10 +# Example: /tmp/dist
  11 +sonar.sources=/tmp/
  12 +
  13 +# Optional
  14 +# Example: /tmp/dist/vendor/**
  15 +sonar.exclusions=
0 16 \ No newline at end of file
... ...
sonar-scanner.properties
... ... @@ -0,0 +1,5 @@
  1 +#----- Default SonarQube server
  2 +sonar.host.url=http://pson01.alfresco.com:9000
  3 +
  4 +#----- Default source code encoding
  5 +sonar.sourceEncoding=UTF-8
0 6 \ No newline at end of file
... ...