Skip to content

Commit

Permalink
CLOUD-61479 added sonar back
Browse files Browse the repository at this point in the history
  • Loading branch information
doktoric committed Aug 11, 2016
1 parent 752387a commit 3aa0dac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
27 changes: 18 additions & 9 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ buildscript {
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1"
classpath "gradle.plugin.com.palantir:jacoco-coverage:0.4.0"
classpath "gradle.plugin.com.github.jk1:gradle-license-report:0.3.4"
}
}

apply plugin: 'jacoco'
apply plugin: 'sonar-runner'
apply plugin: 'license-report'
plugins {
id "com.palantir.jacoco-full-report" version "0.4.0"
id "org.sonarqube" version "2.0.1"
id "com.github.jk1.dependency-license-report" version "0.3.4"
}

apply plugin: 'spring-boot'

bootRun {
Expand Down Expand Up @@ -91,13 +97,16 @@ dependencies {

}

sonarRunner {
sonarProperties {
sonarqube {
properties {
property "sonar.host.url", "$config.sonar_host_url"
property "sonar.jdbc.url", "$config.sonar_jdbc_url"
property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
property "sonar.jdbc.username", "$System.env.SONAR_USERNAME"
property "sonar.jdbc.password", "$System.env.SONAR_PASSWORD"
property "sonar.jdbc.driverClassName", "org.postgresql.Driver"
property "sonar.login", "$config.sonar_host_user"
property "sonar.password", "$config.sonar_host_password"
property "sonar.sources", "src/main"
property "sonar.tests", "src/test"
property "sonar.java.binaries", "build/classes"
property "sonar.java.libraries", "build/libs/*.jar"
property "project.reporting.outputEncoding", "UTF-8"
property "sonar.projectKey", "cloudbreak"
property "sonar.projectName", "cloudbreak"
Expand Down
8 changes: 5 additions & 3 deletions gradle/config/buildConfig.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
environments {
jenkins {
sonar_host_url = "http://$System.env.SONAR_PORT_9000_TCP_ADDR:9000"
sonar_jdbc_url = "jdbc:mysql://$System.env.SONAR_DB_PORT_3306_TCP_ADDR:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true"
sonar_host_url = "http://$System.env.SONAR_HOST:9000"
metadata = "https://s3-eu-west-1.amazonaws.com/maven.sequenceiq.com/releases/com/sequenceiq/cloudbreak/maven-metadata.xml"
sonar_host_user = "$System.env.SONAR_USER"
sonar_host_password = "$System.env.SONAR_PASSWORD"
}

local {
sonar_host_url = "http://localhost:9000"
sonar_jdbc_url = "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true"
metadata = "https://s3-eu-west-1.amazonaws.com/maven.sequenceiq.com/releases/com/sequenceiq/cloudbreak/maven-metadata.xml"
sonar_host_user = "$System.env.SONAR_USER"
sonar_host_password = "$System.env.SONAR_PASSWORD"
}
}
2 changes: 1 addition & 1 deletion scripts/build-dev.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
: ${WORKSPACE=.}

./gradlew -Penv=jenkins -b build.gradle clean build release uploadArchives -Prelease.scope=minor -Prelease.stage=dev --info --stacktrace
./gradlew -Penv=jenkins -b build.gradle clean build release uploadArchives sonarqube -Prelease.scope=minor -Prelease.stage=dev --info --stacktrace

echo VERSION=$(git describe --abbrev=0 --tags) > $WORKSPACE/version

0 comments on commit 3aa0dac

Please sign in to comment.