blob: 7ec590cd161b820fbe8356d1ebb45fa108be240e [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}'
Zack Williams698e5d12018-12-18 16:52:39 -070052 file-include-regexp: '{all-files-regexp}'
Zack Williams0822a132018-04-11 14:44:35 -070053
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'
Zack Williamsccc14742020-01-22 13:15:59 -070069 submodule-disable: '{submodule-disable}'
Zack Williams0822a132018-04-11 14:44:35 -070070 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -070071 submodule-timeout: '{submodule-timeout}'
Zack Williamscd3eb202018-10-02 14:33:13 -070072 choosing-strategy: 'gerrit'
Zack Williams0822a132018-04-11 14:44:35 -070073 jenkins-ssh-credential: '{jenkins-ssh-credential}'
74
Zack Williams2c597f72018-04-16 12:27:41 -070075 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams0822a132018-04-11 14:44:35 -070076 project-type: freestyle
77 concurrent: true
78
79 builders:
hwchiu14f97852019-10-08 10:51:11 -070080 - 'cord-infra-sonarqube':
81 project: '{project}'
82 sonar-prep-commands: '{sonar-prep-commands}'
83 sonar-java-binaries: '{sonar-java-binaries}'
Zack Williams0822a132018-04-11 14:44:35 -070084
85# run Sonarqube as a verification jobs on individual patchsets
86- job-template:
87 id: verify-sonarqube
88 name: 'verify_{project}_sonarqube'
89 description: |
90 Created by verify-sonarqube job-template from ci-management/jjb/sonar.yaml
91
92 triggers:
93 - cord-infra-gerrit-trigger-patchset:
94 gerrit-server-name: '{gerrit-server-name}'
95 project-regexp: '^{project}$'
96 branch-regexp: '{branch-regexp}'
97 dependency-jobs: '{dependency-jobs}'
Zack Williams698e5d12018-12-18 16:52:39 -070098 file-include-regexp: '{code-files-regexp}'
Zack Williams0822a132018-04-11 14:44:35 -070099
100 properties:
101 - cord-infra-properties:
102 build-days-to-keep: '{build-days-to-keep}'
103 artifact-num-to-keep: '{artifact-num-to-keep}'
104
105 wrappers:
106 - lf-infra-wrappers:
107 build-timeout: '{build-timeout}'
108 jenkins-ssh-credential: '{jenkins-ssh-credential}'
109
110 scm:
111 - lf-infra-gerrit-scm:
112 git-url: '$GIT_URL/$GERRIT_PROJECT'
Zack Williams58750872018-05-07 17:35:45 -0700113 refspec: '$GERRIT_REFSPEC'
Zack Williams0822a132018-04-11 14:44:35 -0700114 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700115 submodule-disable: '{submodule-disable}'
Zack Williams0822a132018-04-11 14:44:35 -0700116 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700117 submodule-timeout: '{submodule-timeout}'
Zack Williams0822a132018-04-11 14:44:35 -0700118 choosing-strategy: gerrit
119 jenkins-ssh-credential: '{jenkins-ssh-credential}'
120
Zack Williams2c597f72018-04-16 12:27:41 -0700121 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams0822a132018-04-11 14:44:35 -0700122 project-type: freestyle
123 concurrent: true
124
Zack Williams0822a132018-04-11 14:44:35 -0700125 builders:
hwchiu14f97852019-10-08 10:51:11 -0700126 - 'cord-infra-sonarqube':
127 project: '{project}'
128 sonar-prep-commands: '{sonar-prep-commands}'
129 sonar-java-binaries: '{sonar-java-binaries}'
130