Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 1 | --- |
| 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 Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 24 | - 'ecord' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 25 | - 'maas' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 26 | - 'mcord' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 27 | - 'platform-install' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 28 | - 'rcord' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 29 | - 'xos' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 30 | - 'xos-gui' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 31 | |
| 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 Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 66 | node: 'ubuntu16.04-basebuild-1c-2g' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 67 | project-type: freestyle |
| 68 | concurrent: true |
| 69 | |
Zack Williams | bd8f366 | 2018-04-30 12:27:03 -0700 | [diff] [blame] | 70 | # run `pylint --version` before sonarqube, to expose version in logs and to |
| 71 | # avoid a timeout when sonarqube runs it during analysis. |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 72 | builders: |
Kailash Khalasi | bfeee69 | 2018-05-01 14:15:04 -0700 | [diff] [blame] | 73 | - 'cord-infra-sonarqube': |
| 74 | project: '{project}' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 75 | |
| 76 | # run Sonarqube as a verification jobs on individual patchsets |
| 77 | - job-template: |
| 78 | id: verify-sonarqube |
| 79 | name: 'verify_{project}_sonarqube' |
| 80 | description: | |
| 81 | Created by verify-sonarqube job-template from ci-management/jjb/sonar.yaml |
| 82 | |
| 83 | triggers: |
| 84 | - cord-infra-gerrit-trigger-patchset: |
| 85 | gerrit-server-name: '{gerrit-server-name}' |
| 86 | project-regexp: '^{project}$' |
| 87 | branch-regexp: '{branch-regexp}' |
| 88 | dependency-jobs: '{dependency-jobs}' |
| 89 | file-include-regexp: '{all-files-regexp}' |
| 90 | |
| 91 | properties: |
| 92 | - cord-infra-properties: |
| 93 | build-days-to-keep: '{build-days-to-keep}' |
| 94 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 95 | |
| 96 | wrappers: |
| 97 | - lf-infra-wrappers: |
| 98 | build-timeout: '{build-timeout}' |
| 99 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 100 | |
| 101 | scm: |
| 102 | - lf-infra-gerrit-scm: |
| 103 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 104 | refspec: '$GERRIT_REFSPEC' |
| 105 | branch: '$GERRIT_BRANCH' |
| 106 | submodule-recursive: 'false' |
| 107 | choosing-strategy: gerrit |
| 108 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 109 | |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 110 | node: 'ubuntu16.04-basebuild-1c-2g' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 111 | project-type: freestyle |
| 112 | concurrent: true |
| 113 | |
Zack Williams | bd8f366 | 2018-04-30 12:27:03 -0700 | [diff] [blame] | 114 | # run `pylint --version` before sonarqube, to expose version in logs and to |
| 115 | # avoid a timeout when sonarqube runs it during analysis. |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 116 | builders: |
Kailash Khalasi | bfeee69 | 2018-05-01 14:15:04 -0700 | [diff] [blame] | 117 | - 'cord-infra-sonarqube': |
| 118 | project: '{project}' |