blob: 693c855e6a0703e367c94e9a22faa64ece0f3311 [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'
24 - 'maas'
25 - 'platform-install'
26 - 'xos'
27
28# run ongoing coverage tests on merged patchsets
29- job-template:
30 id: sonarqube-coverage
31 name: 'coverage_{project}_sonarqube'
32 description: |
33 Created by sonarqube-coverage job-template from ci-management/jjb/sonar.yaml
34
35 triggers:
36 - cord-infra-gerrit-trigger-merge:
37 gerrit-server-name: '{gerrit-server-name}'
38 project-regexp: '^{project}$'
39 branch-regexp: '{branch-regexp}'
40 dependency-jobs: '{dependency-jobs}'
41 file-include-regexp: '{all-files-regexp}'
42
43 properties:
44 - cord-infra-properties:
45 build-days-to-keep: '{build-days-to-keep}'
46 artifact-num-to-keep: '{artifact-num-to-keep}'
47
48 wrappers:
49 - lf-infra-wrappers:
50 build-timeout: '{build-timeout}'
51 jenkins-ssh-credential: '{jenkins-ssh-credential}'
52
53 scm:
54 - lf-infra-gerrit-scm:
55 git-url: '$GIT_URL/$GERRIT_PROJECT'
56 refspec: '$GERRIT_REFSPEC'
57 branch: '$GERRIT_BRANCH'
58 submodule-recursive: 'false'
59 choosing-strategy: gerrit
60 jenkins-ssh-credential: '{jenkins-ssh-credential}'
61
62 node: '{build-node}'
63 project-type: freestyle
64 concurrent: true
65
66 builders:
67 - sonar:
68 sonar-name: 'sonarqube.opencord.org'
69 properties: |
Zack Williams7985f2d2018-04-13 14:21:49 -070070 sonar.sources=.
Zack Williams0822a132018-04-11 14:44:35 -070071 sonar.projectKey={project}_$GERRIT_BRANCH
72 sonar.python.pylint=/usr/local/bin/pylint
73
74
75# run Sonarqube as a verification jobs on individual patchsets
76- job-template:
77 id: verify-sonarqube
78 name: 'verify_{project}_sonarqube'
79 description: |
80 Created by verify-sonarqube job-template from ci-management/jjb/sonar.yaml
81
82 triggers:
83 - cord-infra-gerrit-trigger-patchset:
84 gerrit-server-name: '{gerrit-server-name}'
85 project-regexp: '^{project}$'
86 branch-regexp: '{branch-regexp}'
87 dependency-jobs: '{dependency-jobs}'
88 file-include-regexp: '{all-files-regexp}'
89
90 properties:
91 - cord-infra-properties:
92 build-days-to-keep: '{build-days-to-keep}'
93 artifact-num-to-keep: '{artifact-num-to-keep}'
94
95 wrappers:
96 - lf-infra-wrappers:
97 build-timeout: '{build-timeout}'
98 jenkins-ssh-credential: '{jenkins-ssh-credential}'
99
100 scm:
101 - lf-infra-gerrit-scm:
102 git-url: '$GIT_URL/$GERRIT_PROJECT'
103 refspec: '$GERRIT_REFSPEC'
104 branch: '$GERRIT_BRANCH'
105 submodule-recursive: 'false'
106 choosing-strategy: gerrit
107 jenkins-ssh-credential: '{jenkins-ssh-credential}'
108
109 node: '{build-node}'
110 project-type: freestyle
111 concurrent: true
112
113# coverage checks with sonarqube
114# module docs: https://docs.openstack.org/infra/jenkins-job-builder/builders.html?highlight=sonar#builders.sonar
115# Sonarqube docs:
116# https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
117# https://docs.sonarqube.org/display/SCAN/Advanced+SonarQube+Scanner+Usages
118 builders:
119 - sonar:
120 sonar-name: 'sonarqube.opencord.org'
121 properties: |
Zack Williams7985f2d2018-04-13 14:21:49 -0700122 sonar.sources=.
Zack Williams0822a132018-04-11 14:44:35 -0700123 sonar.projectKey=verify_{project}_$GERRIT_BRANCH
124 sonar.python.pylint=/usr/local/bin/pylint
125