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 |
Zack Williams | efc1cb9 | 2018-07-17 14:11:08 -0700 | [diff] [blame] | 15 | # |
| 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 Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 22 | |
| 23 | - project: |
| 24 | name: 'sonarqube-ongoing-coverage' |
| 25 | |
| 26 | jobs: |
| 27 | - 'sonarqube-coverage': |
| 28 | branch-regexp: '{supported-branches-regexp}' |
| 29 | project: |
| 30 | - 'cord' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 31 | - 'ecord' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 32 | - 'maas' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 33 | - 'mcord' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 34 | - 'platform-install' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 35 | - 'rcord' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 36 | - 'xos' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 37 | - 'xos-gui' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 38 | |
| 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}' |
| 52 | file-include-regexp: '{all-files-regexp}' |
| 53 | |
| 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 Williams | 5875087 | 2018-05-07 17:35:45 -0700 | [diff] [blame] | 67 | refspec: '' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 68 | branch: '$GERRIT_BRANCH' |
| 69 | submodule-recursive: 'false' |
Zack Williams | cd3eb20 | 2018-10-02 14:33:13 -0700 | [diff] [blame^] | 70 | choosing-strategy: 'gerrit' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 71 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 72 | |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 73 | node: 'ubuntu16.04-basebuild-1c-2g' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 74 | project-type: freestyle |
| 75 | concurrent: true |
| 76 | |
| 77 | builders: |
Kailash Khalasi | bfeee69 | 2018-05-01 14:15:04 -0700 | [diff] [blame] | 78 | - 'cord-infra-sonarqube': |
| 79 | project: '{project}' |
Zack Williams | efc1cb9 | 2018-07-17 14:11:08 -0700 | [diff] [blame] | 80 | sonar-prep-commands: '{sonar-prep-commands}' |
| 81 | sonar-java-binaries: '{sonar-java-binaries}' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 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' |
Zack Williams | 5875087 | 2018-05-07 17:35:45 -0700 | [diff] [blame] | 111 | refspec: '$GERRIT_REFSPEC' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 112 | branch: '$GERRIT_BRANCH' |
| 113 | submodule-recursive: 'false' |
| 114 | choosing-strategy: gerrit |
| 115 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 116 | |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame] | 117 | node: 'ubuntu16.04-basebuild-1c-2g' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 118 | project-type: freestyle |
| 119 | concurrent: true |
| 120 | |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 121 | builders: |
Kailash Khalasi | bfeee69 | 2018-05-01 14:15:04 -0700 | [diff] [blame] | 122 | - 'cord-infra-sonarqube': |
| 123 | project: '{project}' |
Zack Williams | efc1cb9 | 2018-07-17 14:11:08 -0700 | [diff] [blame] | 124 | sonar-prep-commands: '{sonar-prep-commands}' |
| 125 | sonar-java-binaries: '{sonar-java-binaries}' |