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 | |
| 70 | builders: |
| 71 | - sonar: |
| 72 | sonar-name: 'sonarqube.opencord.org' |
Zack Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame^] | 73 | java-opts: '-Xmx1280m' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 74 | properties: | |
Zack Williams | 7985f2d | 2018-04-13 14:21:49 -0700 | [diff] [blame] | 75 | sonar.sources=. |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 76 | 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 Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame^] | 114 | node: 'ubuntu16.04-basebuild-1c-2g' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 115 | 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 Williams | 2c597f7 | 2018-04-16 12:27:41 -0700 | [diff] [blame^] | 126 | java-opts: '-Xmx1280m' |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 127 | properties: | |
Zack Williams | 7985f2d | 2018-04-13 14:21:49 -0700 | [diff] [blame] | 128 | sonar.sources=. |
Zack Williams | 0822a13 | 2018-04-11 14:44:35 -0700 | [diff] [blame] | 129 | sonar.projectKey=verify_{project}_$GERRIT_BRANCH |
| 130 | sonar.python.pylint=/usr/local/bin/pylint |
| 131 | |