blob: a159abb2e0e2cb86e9072a8e66ac3a288d26a4e9 [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
70 builders:
71 - sonar:
72 sonar-name: 'sonarqube.opencord.org'
Zack Williams2c597f72018-04-16 12:27:41 -070073 java-opts: '-Xmx1280m'
Zack Williams0822a132018-04-11 14:44:35 -070074 properties: |
Zack Williams7985f2d2018-04-13 14:21:49 -070075 sonar.sources=.
Zack Williams0822a132018-04-11 14:44:35 -070076 sonar.projectKey={project}_$GERRIT_BRANCH
77 sonar.python.pylint=/usr/local/bin/pylint
78
79
80# run Sonarqube as a verification jobs on individual patchsets
81- job-template:
82 id: verify-sonarqube
83 name: 'verify_{project}_sonarqube'
84 description: |
85 Created by verify-sonarqube job-template from ci-management/jjb/sonar.yaml
86
87 triggers:
88 - cord-infra-gerrit-trigger-patchset:
89 gerrit-server-name: '{gerrit-server-name}'
90 project-regexp: '^{project}$'
91 branch-regexp: '{branch-regexp}'
92 dependency-jobs: '{dependency-jobs}'
93 file-include-regexp: '{all-files-regexp}'
94
95 properties:
96 - cord-infra-properties:
97 build-days-to-keep: '{build-days-to-keep}'
98 artifact-num-to-keep: '{artifact-num-to-keep}'
99
100 wrappers:
101 - lf-infra-wrappers:
102 build-timeout: '{build-timeout}'
103 jenkins-ssh-credential: '{jenkins-ssh-credential}'
104
105 scm:
106 - lf-infra-gerrit-scm:
107 git-url: '$GIT_URL/$GERRIT_PROJECT'
108 refspec: '$GERRIT_REFSPEC'
109 branch: '$GERRIT_BRANCH'
110 submodule-recursive: 'false'
111 choosing-strategy: gerrit
112 jenkins-ssh-credential: '{jenkins-ssh-credential}'
113
Zack Williams2c597f72018-04-16 12:27:41 -0700114 node: 'ubuntu16.04-basebuild-1c-2g'
Zack Williams0822a132018-04-11 14:44:35 -0700115 project-type: freestyle
116 concurrent: true
117
118# coverage checks with sonarqube
119# module docs: https://docs.openstack.org/infra/jenkins-job-builder/builders.html?highlight=sonar#builders.sonar
120# Sonarqube docs:
121# https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
122# https://docs.sonarqube.org/display/SCAN/Advanced+SonarQube+Scanner+Usages
123 builders:
124 - sonar:
125 sonar-name: 'sonarqube.opencord.org'
Zack Williams2c597f72018-04-16 12:27:41 -0700126 java-opts: '-Xmx1280m'
Zack Williams0822a132018-04-11 14:44:35 -0700127 properties: |
Zack Williams7985f2d2018-04-13 14:21:49 -0700128 sonar.sources=.
Zack Williams0822a132018-04-11 14:44:35 -0700129 sonar.projectKey=verify_{project}_$GERRIT_BRANCH
130 sonar.python.pylint=/usr/local/bin/pylint
131