Merge "Migrate project jobs to use lf-infra-publish"
[releng/builder.git] / jjb / netvirt / netvirt-sonar.yaml
1 ---
2 - project:
3     name: netvirt-sonar
4     jobs:
5       - 'netvirt-sonar'
6
7     project: 'netvirt'
8     jdk: 'openjdk8'
9     archive-artifacts: '*.log'
10
11 - builder:
12     name: install-docker-composeSonar
13     builders:
14       - shell: |
15           virtualenv $WORKSPACE/venv
16           source $WORKSPACE/venv/bin/activate
17           PYTHON="$WORKSPACE/venv/bin/python"
18           $PYTHON -m pip install --upgrade pip
19           $PYTHON -m pip install docker-compose
20
21 - job-template:
22     name: 'netvirt-sonar'
23
24     project-type: freestyle
25     node: centos7-docker-2c-4g
26     jdk: '{jdk}'
27
28     properties:
29       - opendaylight-infra-properties:
30           build-days-to-keep: 7
31
32     parameters:
33       - opendaylight-infra-parameters:
34           os-cloud: '{os-cloud}'
35           project: '{project}'
36           branch: '{branch}'
37           refspec: 'refs/heads/{branch}'
38           artifacts: '{archive-artifacts}'
39
40     scm:
41       - git-scm:
42           refspec: ''
43           branch: 'master'
44
45     wrappers:
46       - opendaylight-infra-wrappers:
47           build-timeout: '{build-timeout}'
48
49     triggers:
50       - timed: 'H H * * 6'
51       - gerrit-trigger-patch-sonar:
52           server-name: '{server-name}'
53           name: 'netvirt'
54
55     builders:
56       - shell: !include-raw-escape: include-setup-misc.sh
57       - inject:
58           properties-file: env.properties
59       - install-docker-composeSonar
60       - maven-target:
61           maven-version: 'mvn33'
62           pom: 'pom.xml'
63           goals: >
64               clean install dependency:tree -V -B -Dsonar
65               -Dskip.karaf.featureTest=true -Dmaven.compile.fork=true
66               -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
67           java-opts:
68             - '-Xmx1024m -XX:MaxPermSize=256m'
69           settings: 'netvirt-settings'
70           settings-type: cfp
71           global-settings: 'odl-global-settings'
72           global-settings-type: cfp
73       - inject:
74           properties-file: env.properties
75       - maven-target:
76           maven-version: 'mvn33'
77           pom: 'vpnservice/it/pom.xml'
78           goals: >
79               verify -V -B -l netvirt-vpnservice-sonar.log
80               -Pintegrationtest -Dsonar -Dskip.karaf.featureTest=true
81               -Dovsdb.controller.address=${{CONTROLLER_IP}}
82               -Ddocker.compose.file=ovs-2.5.0-hwvtep.yml
83               -Ddocker.vEnvWs=$WORKSPACE
84               -Dsgm=transparent
85           properties:
86             - 'maven.repo.local=/tmp/r'
87             - 'org.ops4j.pax.url.mvn.localRepository=/tmp/r'
88           settings: 'netvirt-settings'
89           settings-type: cfp
90           global-settings: 'odl-global-settings'
91           global-settings-type: cfp
92       - maven-target:
93           maven-version: 'mvn33'
94           pom: 'openstack/net-virt-it/pom.xml'
95           goals: >
96               verify -V -B -l net-virt-sonar.log
97               -Pintegrationtest -Dsonar -Dskip.karaf.featureTest=true
98               -Dovsdb.controller.address=${{CONTROLLER_IP}}
99               -Ddocker.compose.file=ovs-2.5.0-hwvtep.yml
100               -Ddocker.vEnvWs=$WORKSPACE
101               -Dsgm=transparent
102           properties:
103             - 'maven.repo.local=/tmp/r'
104             - 'org.ops4j.pax.url.mvn.localRepository=/tmp/r'
105           settings: 'netvirt-settings'
106           settings-type: cfp
107           global-settings: 'odl-global-settings'
108           global-settings-type: cfp
109       - shell: !include-raw-escape: include-raw-setup-docker.sh
110       - inject:
111           properties-file: env.properties
112       - maven-target:
113           maven-version: 'mvn33'
114           pom: 'openstack/net-virt-sfc/it/pom.xml'
115           goals: >
116               verify -V -B -l openstack/net-virt-sfc-sonar.log
117               -Pintegrationtest -Dsonar
118               -Dskip.karaf.featureTest=true
119               -Dovsdb.controller.address=${{CONTROLLER_IP}}
120               -Dsgm=transparent
121           properties:
122             - 'maven.repo.local=/tmp/r'
123             - 'org.ops4j.pax.url.mvn.localRepository=/tmp/r'
124             - 'ovsdbserver.ipaddress=127.0.0.1'
125             - 'ovsdbserver.port=6641'
126             - 'ovsdb.userspace.enabled=yes'
127           settings: 'netvirt-settings'
128           settings-type: cfp
129           global-settings: 'odl-global-settings'
130           global-settings-type: cfp
131       - maven-target:
132           maven-version: 'mvn33'
133           # We should switch to the recommended configuration of sonar once
134           # JJB adds support for configurating the Sonar wrapper:
135           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
136           goals: >
137               sonar:sonar -V -B -Djenkins
138               -Dsonar -Dsonar.host.url=https://sonar.opendaylight.org
139               -Dmaven.repo.local=/tmp/r
140               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
141           settings: 'netvirt-settings'
142           settings-type: cfp
143           global-settings: 'odl-global-settings'
144           global-settings-type: cfp
145       - shell: !include-raw-escape: include-raw-cleanup-docker.sh
146       - jacoco-nojava-workaround
147
148     publishers:
149       - email-notification:
150           email-recipients: '{email-recipients}'
151           email-prefix: '[netvirt]'
152       - jacoco-report
153       - findbugs
154       - lf-infra-publish