OVSDB customize sonar job 59/15159/2
authorFlavio Fernandes <ffernand@redhat.com>
Wed, 11 Feb 2015 19:10:24 +0000 (14:10 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 11 Feb 2015 20:20:27 +0000 (15:20 -0500)
Change-Id: Ibee53427c5dc8f73159cb49b086894fc811d5177
Also-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/ovsdb/include-raw-cleanup-docker.sh [new file with mode: 0644]
jjb/ovsdb/include-raw-setup-docker.sh [new file with mode: 0644]
jjb/ovsdb/ovsdb-custom.yaml [new file with mode: 0644]
jjb/ovsdb/ovsdb.yaml

diff --git a/jjb/ovsdb/include-raw-cleanup-docker.sh b/jjb/ovsdb/include-raw-cleanup-docker.sh
new file mode 100644 (file)
index 0000000..82c97fc
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+echo "---> Cleaning up"
+docker logs $CID > $WORKSPACE/docker-ovs-${OVS_VERSION}.log
+docker stop $CID
+docker rm $CID
+rm env.properties
+
+docker images
diff --git a/jjb/ovsdb/include-raw-setup-docker.sh b/jjb/ovsdb/include-raw-setup-docker.sh
new file mode 100644 (file)
index 0000000..f0e3d2d
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -e
+
+export OVS_VERSION=2.1.2
+
+echo "---> Cleaning up existing Docker processes and images"
+for x in $(docker ps -a -q)
+do
+   docker stop "$x"
+   docker rm "$x"
+done
+
+for x in $(docker images | grep davetucker | awk '{print $3}')
+do
+   docker rmi "$x"
+done
+
+
+
+echo "---> Starting OVS $OVS_VERSION"
+/usr/bin/docker pull davetucker/docker-ovs:$OVS_VERSION
+CID=$(/usr/bin/docker run -p 6641:6640 --privileged=true -d -i -t davetucker/docker-ovs:$OVS_VERSION /usr/bin/supervisord)
+REALCID=`echo $CID | rev | cut -d ' ' -f 1 | rev`
+echo "CID=$REALCID" > env.properties
+echo "OVS_VERSION=${OVS_VERSION}" >> env.properties
+
+echo "---> Waiting..."
+sleep 10
diff --git a/jjb/ovsdb/ovsdb-custom.yaml b/jjb/ovsdb/ovsdb-custom.yaml
new file mode 100644 (file)
index 0000000..1e626c4
--- /dev/null
@@ -0,0 +1,65 @@
+- project:
+    name: ovsdb-custom
+    jobs:
+        - 'ovsdb-sonar'
+
+    project: 'ovsdb'
+    jdk: 'openjdk7'
+
+- job-template:
+    name: 'ovsdb-sonar'
+
+    project-type: maven
+    node: dynamic_docker
+    jdk: '{jdk}'
+
+    logrotate:
+        daysToKeep: '7'
+        numToKeep: '10'
+        artifactDaysToKeep: '1'
+        artifactNumToKeep: '1'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: 'master'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            user: '{ssh-credentials}'
+
+    triggers:
+        - timed: 'H H * * *'
+
+    prebuilders:
+        - shell:
+            !include-raw-escape include-raw-setup-docker.sh
+
+    maven:
+        maven-name: '{mvn32}'
+        root-pom: 'pom.xml'
+        goals: 'clean install -Pintegrationtest,coverage,jenkins -Dovsdbserver.ipaddress=127.0.0.1 -Dovsdbserver.port=6641 -V -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r  -Dsonar'
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{ovsdb-settings}'
+        global-settings: '{odl-global-settings}'
+
+    postbuilders:
+        - inject:
+            properties-file: env.properties
+        - 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 ffc871397f1448cddc3461b822870516dc623ebc..69dd00bf3ff45fa8798deab22bc328fb000cdbc0 100644 (file)
@@ -1,7 +1,3 @@
-# REMOVE THIS LINE IF YOU WANT TO CUSTOMIZE ANYTHING BELOW
-# Otherwise this file will be automatically overwritten by the template
-# autobuilder.
-
 # ODL Releng build templates
 - project:
     name: ovsdb
@@ -10,7 +6,6 @@
         - 'ovsdb-merge-{stream}'
         - 'ovsdb-daily-{stream}'
         - 'ovsdb-integration-{stream}'
-        - 'ovsdb-sonar'
 
     # stream:    branch with - in place of / (eg. stable-helium)
     # branch:    branch (eg. stable/helium)
             deploy-unstable: false
         - jacoco-report
 
-- job-template:
-    name: 'ovsdb-sonar'
-
-    project-type: maven
-    node: dynamic_verify
-    jdk: '{jdk}'
-
-    logrotate:
-        daysToKeep: '7'
-        numToKeep: '10'
-        artifactDaysToKeep: '1'
-        artifactNumToKeep: '1'
-
-    parameters:
-        - project-parameter:
-            project: '{project}'
-
-    scm:
-        - git-scm:
-            credentials-id: '{ssh-credentials}'
-            refspec: ''
-            branch: 'master'
-
-    wrappers:
-        - build-timeout
-        - ssh-agent-credentials:
-            user: '{ssh-credentials}'
-
-    triggers:
-        - timed: 'H H * * *'
-
-    maven:
-        maven-name: '{mvn32}'
-        root-pom: 'pom.xml'
-        goals: 'clean install -V -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r  -Dsonar'
-        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
-        settings: '{ovsdb-settings}'
-        global-settings: '{odl-global-settings}'
-
-    postbuilders:
-        - jacoco-nojava-workaround
-
-    publishers:
-        - sonar:
-            language: 'java'
-            maven-opts: '-Xmx6144m -XX:MaxPermSize=1024m'
-        - email-notification:
-            email-prefix: '[ovsdb]'
-        - jacoco-report