Fix sonar jobs due to freestyle transition 01/45501/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 12 Sep 2016 17:18:15 +0000 (13:18 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 12 Sep 2016 17:35:05 +0000 (13:35 -0400)
The freestyle job migration from patch
I810316417769df3c4f3f775aff3f3c151be76e3f broke the sonar jobs due to
missing jdk and maven-version configuration. Unfortunately JJB does not
support configuration those options either.

Since the post build step for Sonar is deprecated anyway there's no
point continuing to use it so transition to using the sonar method
recommended by SonarQube [0].

The "Prepare SonarQube Scanner environment" is currently not
configurable via Jenkins so explicitly set the Maven Goals directly to
work around this. We should switch back in the future once JJB supports
the setting.

[0]
http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins

Change-Id: I6a3e00c4b385adad03a470d3aae0e476c6bb769d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/netvirt/netvirt-sonar.yaml
jjb/ovsdb/ovsdb-sonar.yaml
jjb/releng-templates-java.yaml

index 4d1d7bb938abb11cffba6ff99a950b294db81377..812da461543a6f7bd82e6f1b3c968da82a69876e 100644 (file)
             settings-type: cfp
             global-settings: 'odl-global-settings'
             global-settings-type: cfp
+        - maven-target:
+            maven-version: '{mvn33}'
+            # We should switch to the recommended configuration of sonar once
+            # JJB adds support for configurating the Sonar wrapper:
+            #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
+            goals: 'sonar:sonar -V -B -Djenkins -Dsonar -Dsonar.host.url=https://sonar.opendaylight.org -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
+            settings: 'netvirt-settings'
+            settings-type: cfp
+            global-settings: 'odl-global-settings'
+            global-settings-type: cfp
         - shell:
             !include-raw-escape:
                 - include-raw-cleanup-docker.sh
         - jacoco-nojava-workaround
 
     publishers:
-        - sonar:
-            language: 'java'
-            maven-opts: '-Xmx6144m -XX:MaxPermSize=1024m'
         - email-notification:
             email-prefix: '[netvirt]'
         - jacoco-report
index e152eeaa0d918e4a8073dfb0a0d101782fef9c6e..3dbeb09d26471a04b735808507198cc4a34c05b7 100644 (file)
             settings-type: cfp
             global-settings: 'odl-global-settings'
             global-settings-type: cfp
+        - maven-target:
+            maven-version: '{mvn33}'
+            # We should switch to the recommended configuration of sonar once
+            # JJB adds support for configurating the Sonar wrapper:
+            #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
+            goals: 'sonar:sonar -V -B -Djenkins -Dsonar -Dsonar.host.url=https://sonar.opendaylight.org -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
+            settings: 'ovsdb-settings'
+            settings-type: cfp
+            global-settings: 'odl-global-settings'
+            global-settings-type: cfp
         - shell:
             !include-raw-escape:
                 - include-raw-cleanup-docker.sh
         - jacoco-nojava-workaround
 
     publishers:
-        - sonar:
-            language: 'java'
-            maven-opts: '-Xmx6144m -XX:MaxPermSize=1024m'
         - email-notification:
             email-prefix: '[ovsdb]'
         - jacoco-report
index 58b1e517806e21e099bec4bf5cc304827c2b575f..9caa5f984e93ffa5fe38c907b96c05972d2b8aee 100644 (file)
             settings-type: cfp
             global-settings: 'odl-global-settings'
             global-settings-type: cfp
+        - maven-target:
+            maven-version: '{mvn33}'
+            # We should switch to the recommended configuration of sonar once
+            # JJB adds support for configurating the Sonar wrapper:
+            #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
+            goals: 'sonar:sonar -V -B -Djenkins -Dsonar -Dsonar.host.url=https://sonar.opendaylight.org -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
+            maven-opts:
+              - '{mvn-opts}'
+            settings: '{mvn-settings}'
+            settings-type: cfp
+            global-settings: 'odl-global-settings'
+            global-settings-type: cfp
 
     publishers:
-        - sonar:
-            language: 'java'
-            maven-opts: '-Xmx6144m -XX:MaxPermSize=1024m'
         - email-notification:
             email-prefix: '[{project-name}]'
         - jacoco-report