blob: b76d557164f98e94e4237b907f1de738c1825bc5 [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
15
16- project:
17 name: 'sonarqube-ongoing-coverage'
18
19 jobs:
20 - 'sonarqube-coverage':
21 branch-regexp: '{supported-branches-regexp}'
22 project:
23 - 'cord'
Zack Williams2c597f72018-04-16 12:27:41 -070024 - 'ecord'
Zack Williams0822a132018-04-11 14:44:35 -070025 - 'maas'
Zack Williams2c597f72018-04-16 12:27:41 -070026 - 'mcord'
Zack Williams0822a132018-04-11 14:44:35 -070027 - 'platform-install'
Zack Williams2c597f72018-04-16 12:27:41 -070028 - 'rcord'
Zack Williams0822a132018-04-11 14:44:35 -070029 - 'xos'
Zack Williams2c597f72018-04-16 12:27:41 -070030 - 'xos-gui'
Zack Williams0822a132018-04-11 14:44:35 -070031
32# run ongoing coverage tests on merged patchsets
33- job-template:
34 id: sonarqube-coverage
35 name: 'coverage_{project}_sonarqube'
36 description: |
37 Created by sonarqube-coverage job-template from ci-management/jjb/sonar.yaml
38
39 triggers:
40 - cord-infra-gerrit-trigger-merge:
41 gerrit-server-name: '{gerrit-server-name}'
42 project-regexp: '^{project}$'
43 branch-regexp: '{branch-regexp}'
44 dependency-jobs: '{dependency-jobs}'
45 file-include-regexp: '{all-files-regexp}'
46
47 properties:
48 - cord-infra-properties:
49 build-days-to-keep: '{build-days-to-keep}'
50 artifact-num-to-keep: '{artifact-num-to-keep}'
51
52 wrappers:
53 - lf-infra-wrappers:
54 build-timeout: '{build-timeout}'
55 jenkins-ssh-credential: '{jenkins-ssh-credential}'
56
57 scm:
58 - lf-infra-gerrit-scm:
59 git-url: '$GIT_URL/$GERRIT_PROJECT'
60 refspec: '$GERRIT_REFSPEC'
61 branch: '$GERRIT_BRANCH'
62 submodule-recursive: 'false'
63 choosing-strategy: gerrit
64 jenkins-ssh-credential: '{jenkins-ssh-credential}'
65
Zack Williams2c597f72018-04-16 12:27:41 -070066 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams0822a132018-04-11 14:44:35 -070067 project-type: freestyle
68 concurrent: true
69
Zack Williamsbd8f3662018-04-30 12:27:03 -070070# run `pylint --version` before sonarqube, to expose version in logs and to
71# avoid a timeout when sonarqube runs it during analysis.
Zack Williams0822a132018-04-11 14:44:35 -070072 builders:
Zack Williamsbd8f3662018-04-30 12:27:03 -070073 - shell: 'pylint --version'
Zack Williams0822a132018-04-11 14:44:35 -070074 - sonar:
75 sonar-name: 'sonarqube.opencord.org'
Zack Williams2c597f72018-04-16 12:27:41 -070076 java-opts: '-Xmx1280m'
Zack Williams0822a132018-04-11 14:44:35 -070077 properties: |
Zack Williams7985f2d2018-04-13 14:21:49 -070078 sonar.sources=.
Zack Williams0822a132018-04-11 14:44:35 -070079 sonar.projectKey={project}_$GERRIT_BRANCH
80 sonar.python.pylint=/usr/local/bin/pylint
81
82
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'
111 refspec: '$GERRIT_REFSPEC'
112 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 Williamsbd8f3662018-04-30 12:27:03 -0700121# run `pylint --version` before sonarqube, to expose version in logs and to
122# avoid a timeout when sonarqube runs it during analysis.
Zack Williams0822a132018-04-11 14:44:35 -0700123 builders:
Zack Williamsbd8f3662018-04-30 12:27:03 -0700124 - shell: 'pylint --version'
Zack Williams0822a132018-04-11 14:44:35 -0700125 - sonar:
126 sonar-name: 'sonarqube.opencord.org'
Zack Williams2c597f72018-04-16 12:27:41 -0700127 java-opts: '-Xmx1280m'
Zack Williams0822a132018-04-11 14:44:35 -0700128 properties: |
Zack Williams7985f2d2018-04-13 14:21:49 -0700129 sonar.sources=.
Zack Williams0822a132018-04-11 14:44:35 -0700130 sonar.projectKey=verify_{project}_$GERRIT_BRANCH
131 sonar.python.pylint=/usr/local/bin/pylint
132