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' |
| 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: | |
| 70 | sonar.projectKey={project}_$GERRIT_BRANCH |
| 71 | sonar.python.pylint=/usr/local/bin/pylint |
| 72 | |
| 73 | |
| 74 | # run Sonarqube as a verification jobs on individual patchsets |
| 75 | - job-template: |
| 76 | id: verify-sonarqube |
| 77 | name: 'verify_{project}_sonarqube' |
| 78 | description: | |
| 79 | Created by verify-sonarqube job-template from ci-management/jjb/sonar.yaml |
| 80 | |
| 81 | triggers: |
| 82 | - cord-infra-gerrit-trigger-patchset: |
| 83 | gerrit-server-name: '{gerrit-server-name}' |
| 84 | project-regexp: '^{project}$' |
| 85 | branch-regexp: '{branch-regexp}' |
| 86 | dependency-jobs: '{dependency-jobs}' |
| 87 | file-include-regexp: '{all-files-regexp}' |
| 88 | |
| 89 | properties: |
| 90 | - cord-infra-properties: |
| 91 | build-days-to-keep: '{build-days-to-keep}' |
| 92 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 93 | |
| 94 | wrappers: |
| 95 | - lf-infra-wrappers: |
| 96 | build-timeout: '{build-timeout}' |
| 97 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 98 | |
| 99 | scm: |
| 100 | - lf-infra-gerrit-scm: |
| 101 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 102 | refspec: '$GERRIT_REFSPEC' |
| 103 | branch: '$GERRIT_BRANCH' |
| 104 | submodule-recursive: 'false' |
| 105 | choosing-strategy: gerrit |
| 106 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 107 | |
| 108 | node: '{build-node}' |
| 109 | project-type: freestyle |
| 110 | concurrent: true |
| 111 | |
| 112 | # coverage checks with sonarqube |
| 113 | # module docs: https://docs.openstack.org/infra/jenkins-job-builder/builders.html?highlight=sonar#builders.sonar |
| 114 | # Sonarqube docs: |
| 115 | # https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins |
| 116 | # https://docs.sonarqube.org/display/SCAN/Advanced+SonarQube+Scanner+Usages |
| 117 | builders: |
| 118 | - sonar: |
| 119 | sonar-name: 'sonarqube.opencord.org' |
| 120 | properties: | |
| 121 | sonar.projectKey=verify_{project}_$GERRIT_BRANCH |
| 122 | sonar.python.pylint=/usr/local/bin/pylint |
| 123 | |