blob: 6e660977009151af1b02112aa56cc4e2e5e5b108 [file] [log] [blame]
Zack Williams0822a132018-04-11 14:44:35 -07001---
2# Sonarqube coverage tests
3#
4# There are two kinds of tests:
5#
6# - coverage_{project}_sonarqube - run after merge to give an idea of ongoing code health
7# - verify_{project}_sonarqube - run on patchsets, invoked in the verify/*.yaml
8#
9# JJB module docs:
10# https://docs.openstack.org/infra/jenkins-job-builder/builders.html?highlight=sonar#builders.sonar
11#
12# Sonarqube docs:
13# https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
14# https://docs.sonarqube.org/display/SCAN/Advanced+SonarQube+Scanner+Usages
Zack Williamsefc1cb92018-07-17 14:11:08 -070015#
16# Variables:
17# sonar-java-binaries - paths to Java bytecodefiles for SonarQube to analyze. Defaults to "".
18# See: https://docs.sonarqube.org/display/PLUG/Java+Plugin+and+Bytecode
19# sonar-prep-commands - shell commands to run before SonarScanner is run, frequently used to
20# build java bytecode. Defaults to "" (nothing run)
21#
Zack Williams0822a132018-04-11 14:44:35 -070022
23- project:
24 name: 'sonarqube-ongoing-coverage'
25
26 jobs:
27 - 'sonarqube-coverage':
28 branch-regexp: '{supported-branches-regexp}'
29 project:
30 - 'cord'
Zack Williams2c597f72018-04-16 12:27:41 -070031 - 'ecord'
Zack Williams0822a132018-04-11 14:44:35 -070032 - 'maas'
Zack Williams2c597f72018-04-16 12:27:41 -070033 - 'mcord'
Zack Williams0822a132018-04-11 14:44:35 -070034 - 'platform-install'
Zack Williams2c597f72018-04-16 12:27:41 -070035 - 'rcord'
Zack Williams0822a132018-04-11 14:44:35 -070036 - 'xos'
Zack Williams2c597f72018-04-16 12:27:41 -070037 - 'xos-gui'
Zack Williams0822a132018-04-11 14:44:35 -070038
39# run ongoing coverage tests on merged patchsets
40- job-template:
41 id: sonarqube-coverage
42 name: 'coverage_{project}_sonarqube'
43 description: |
44 Created by sonarqube-coverage job-template from ci-management/jjb/sonar.yaml
45
46 triggers:
47 - cord-infra-gerrit-trigger-merge:
48 gerrit-server-name: '{gerrit-server-name}'
49 project-regexp: '^{project}$'
50 branch-regexp: '{branch-regexp}'
51 dependency-jobs: '{dependency-jobs}'
52 file-include-regexp: '{all-files-regexp}'
53
54 properties:
55 - cord-infra-properties:
56 build-days-to-keep: '{build-days-to-keep}'
57 artifact-num-to-keep: '{artifact-num-to-keep}'
58
59 wrappers:
60 - lf-infra-wrappers:
61 build-timeout: '{build-timeout}'
62 jenkins-ssh-credential: '{jenkins-ssh-credential}'
63
64 scm:
65 - lf-infra-gerrit-scm:
66 git-url: '$GIT_URL/$GERRIT_PROJECT'
Zack Williams58750872018-05-07 17:35:45 -070067 refspec: ''
Zack Williams0822a132018-04-11 14:44:35 -070068 branch: '$GERRIT_BRANCH'
69 submodule-recursive: 'false'
Zack Williamscd3eb202018-10-02 14:33:13 -070070 choosing-strategy: 'gerrit'
Zack Williams0822a132018-04-11 14:44:35 -070071 jenkins-ssh-credential: '{jenkins-ssh-credential}'
72
Zack Williams2c597f72018-04-16 12:27:41 -070073 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams0822a132018-04-11 14:44:35 -070074 project-type: freestyle
75 concurrent: true
76
77 builders:
Kailash Khalasibfeee692018-05-01 14:15:04 -070078 - 'cord-infra-sonarqube':
79 project: '{project}'
Zack Williamsefc1cb92018-07-17 14:11:08 -070080 sonar-prep-commands: '{sonar-prep-commands}'
81 sonar-java-binaries: '{sonar-java-binaries}'
Zack Williams0822a132018-04-11 14:44:35 -070082
83# run Sonarqube as a verification jobs on individual patchsets
84- job-template:
85 id: verify-sonarqube
86 name: 'verify_{project}_sonarqube'
87 description: |
88 Created by verify-sonarqube job-template from ci-management/jjb/sonar.yaml
89
90 triggers:
91 - cord-infra-gerrit-trigger-patchset:
92 gerrit-server-name: '{gerrit-server-name}'
93 project-regexp: '^{project}$'
94 branch-regexp: '{branch-regexp}'
95 dependency-jobs: '{dependency-jobs}'
96 file-include-regexp: '{all-files-regexp}'
97
98 properties:
99 - cord-infra-properties:
100 build-days-to-keep: '{build-days-to-keep}'
101 artifact-num-to-keep: '{artifact-num-to-keep}'
102
103 wrappers:
104 - lf-infra-wrappers:
105 build-timeout: '{build-timeout}'
106 jenkins-ssh-credential: '{jenkins-ssh-credential}'
107
108 scm:
109 - lf-infra-gerrit-scm:
110 git-url: '$GIT_URL/$GERRIT_PROJECT'
Zack Williams58750872018-05-07 17:35:45 -0700111 refspec: '$GERRIT_REFSPEC'
Zack Williams0822a132018-04-11 14:44:35 -0700112 branch: '$GERRIT_BRANCH'
113 submodule-recursive: 'false'
114 choosing-strategy: gerrit
115 jenkins-ssh-credential: '{jenkins-ssh-credential}'
116
Zack Williams2c597f72018-04-16 12:27:41 -0700117 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams0822a132018-04-11 14:44:35 -0700118 project-type: freestyle
119 concurrent: true
120
Zack Williams0822a132018-04-11 14:44:35 -0700121 builders:
Kailash Khalasibfeee692018-05-01 14:15:04 -0700122 - 'cord-infra-sonarqube':
123 project: '{project}'
Zack Williamsefc1cb92018-07-17 14:11:08 -0700124 sonar-prep-commands: '{sonar-prep-commands}'
125 sonar-java-binaries: '{sonar-java-binaries}'