Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 1 | --- |
| 2 | # these parameters are used for infra related variables |
| 3 | - parameter: |
Fatih Degirmenci | 5addd51 | 2018-10-19 14:06:03 +0200 | [diff] [blame] | 4 | name: infra-parameters |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 5 | parameters: |
| 6 | - string: |
| 7 | name: JJB_GIT_REPO |
| 8 | default: https://git.openstack.org/openstack-infra/jenkins-job-builder |
| 9 | description: OpenStack JJB repo |
| 10 | - string: |
| 11 | name: JJB_VERSION |
Fatih Degirmenci | 43187b2 | 2019-02-25 15:57:17 +0100 | [diff] [blame] | 12 | default: 2.9.1 |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 13 | description: OpenStack JJB version to install - matches to LFN JJB version |
| 14 | |
| 15 | # these parameters are used for setting the Gerrit Project on Nordix |
| 16 | - parameter: |
Fatih Degirmenci | 5addd51 | 2018-10-19 14:06:03 +0200 | [diff] [blame] | 17 | name: project-parameters |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 18 | parameters: |
| 19 | - string: |
| 20 | name: PROJECT |
| 21 | default: '{project}' |
| 22 | description: JJB configured PROJECT parameter to identify a Nordix Gerrit project |
Fatih Degirmenci | 2c4038b | 2018-10-18 15:25:24 +0200 | [diff] [blame] | 23 | - string: |
| 24 | name: BRANCH |
| 25 | default: '{branch}' |
| 26 | description: "JJB configured BRANCH parameter (e.g. master, nordix-dev)" |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 27 | |
| 28 | # these parameters are used for streaming changes from various Gerrit Systems |
| 29 | - parameter: |
| 30 | name: nordix-gerrit-parameters |
| 31 | parameters: |
| 32 | - string: |
| 33 | name: GERRIT_USER |
| 34 | default: infra |
| 35 | description: Non-interactive user to stream Gerrit Events on Nordix Gerrit |
| 36 | - string: |
| 37 | name: GIT_BASE_HTTPS |
Fatih Degirmenci | 9a746ac | 2018-10-23 00:20:43 +0200 | [diff] [blame] | 38 | default: https://gerrit.nordix.org |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 39 | description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo |
| 40 | - string: |
| 41 | name: GIT_BASE_SSH |
Fatih Degirmenci | 9a746ac | 2018-10-23 00:20:43 +0200 | [diff] [blame] | 42 | default: ssh://$GERRIT_USER@gerrit.nordix.org:29418 |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 43 | description: HTTPS URL of Project Repo on Nordix Gerrit to clone repo |
| 44 | |
| 45 | - parameter: |
| 46 | name: onap-gerrit-parameters |
| 47 | parameters: |
| 48 | - string: |
| 49 | name: GERRIT_USER |
| 50 | default: nordix |
| 51 | description: Non-interactive user to stream Gerrit Events on ONAP Gerrit |
| 52 | - string: |
| 53 | name: GIT_BASE_HTTPS |
Fatih Degirmenci | 9a746ac | 2018-10-23 00:20:43 +0200 | [diff] [blame] | 54 | default: https://gerrit.onap.org/r/p |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 55 | description: HTTPS URL to Project Repo on ONAP Gerrit to clone repo |
| 56 | - string: |
| 57 | name: GIT_BASE_SSH |
Fatih Degirmenci | 9a746ac | 2018-10-23 00:20:43 +0200 | [diff] [blame] | 58 | default: ssh://$GERRIT_USER@gerrit.onap.org:29418 |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 59 | description: SSH URL to Project Repo on ONAP Gerrit to clone repo |
| 60 | |
Fatih Degirmenci | 1e7b337 | 2019-03-14 15:11:15 -0700 | [diff] [blame] | 61 | - parameter: |
| 62 | name: acumos-gerrit-parameters |
| 63 | parameters: |
| 64 | - string: |
| 65 | name: GERRIT_USER |
| 66 | default: nordix |
| 67 | description: Non-interactive user to stream Gerrit Events on Acumos Gerrit |
| 68 | - string: |
| 69 | name: GIT_BASE_HTTPS |
| 70 | default: https://gerrit.acumos.org/r/p |
| 71 | description: HTTPS URL to Project Repo on Acumos Gerrit to clone repo |
| 72 | - string: |
| 73 | name: GIT_BASE_SSH |
| 74 | default: ssh://$GERRIT_USER@gerrit.acumos.org:29418 |
| 75 | description: SSH URL to Project Repo on Acumos Gerrit to clone repo |
| 76 | |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 77 | # defaults for job build history |
| 78 | - property: |
| 79 | name: logrotate-default |
| 80 | properties: |
| 81 | - build-discarder: |
| 82 | days-to-keep: 60 |
| 83 | num-to-keep: 200 |
| 84 | artifact-days-to-keep: 60 |
| 85 | artifact-num-to-keep: 200 |
| 86 | |
| 87 | # defaults for SCM and Gerrit |
| 88 | - scm: |
| 89 | name: git-scm |
| 90 | scm: |
Fatih Degirmenci | 352a9b1 | 2018-10-19 15:36:09 +0200 | [diff] [blame] | 91 | - git: |
Fatih Degirmenci | 9a746ac | 2018-10-23 00:20:43 +0200 | [diff] [blame] | 92 | url: '$GIT_BASE_SSH/$PROJECT' |
Fatih Degirmenci | 627036b | 2018-10-23 00:37:19 +0200 | [diff] [blame] | 93 | credentials-id: '{ssh-credentials-id}' |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 94 | branches: |
Fatih Degirmenci | 352a9b1 | 2018-10-19 15:36:09 +0200 | [diff] [blame] | 95 | - 'refs/heads/{branch}' |
| 96 | refspec: '{refspec}' |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 97 | timeout: 15 |
| 98 | per-build-tag: false |
| 99 | skip-tag: true |
| 100 | shallow-clone: false |
| 101 | use-author: false |
| 102 | ignore-notify: false |
| 103 | wipe-workspace: true |
| 104 | prune: false |
Fatih Degirmenci | 352a9b1 | 2018-10-19 15:36:09 +0200 | [diff] [blame] | 105 | choosing-strategy: 'default' |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 106 | |
| 107 | - scm: |
| 108 | name: git-scm-gerrit |
| 109 | scm: |
| 110 | - git: |
Fatih Degirmenci | 9a746ac | 2018-10-23 00:20:43 +0200 | [diff] [blame] | 111 | url: '$GIT_BASE_SSH/$PROJECT' |
Fatih Degirmenci | 627036b | 2018-10-23 00:37:19 +0200 | [diff] [blame] | 112 | credentials-id: '{ssh-credentials-id}' |
Fatih Degirmenci | 352a9b1 | 2018-10-19 15:36:09 +0200 | [diff] [blame] | 113 | branches: |
| 114 | - 'refs/heads/{branch}' |
| 115 | refspec: '{refspec}' |
| 116 | timeout: 15 |
| 117 | per-build-tag: false |
| 118 | skip-tag: true |
| 119 | shallow-clone: false |
| 120 | use-author: false |
| 121 | ignore-notify: false |
| 122 | wipe-workspace: true |
| 123 | prune: false |
Fatih Degirmenci | 03be82a | 2018-10-18 12:16:14 +0200 | [diff] [blame] | 124 | choosing-strategy: 'gerrit' |
Fatih Degirmenci | 1fab66d | 2018-10-18 15:14:30 +0200 | [diff] [blame] | 125 | |
Fatih Degirmenci | a2beeb2 | 2018-12-10 10:57:50 -0800 | [diff] [blame] | 126 | # triggers for Nordix Gerrit |
Fatih Degirmenci | 1fab66d | 2018-10-18 15:14:30 +0200 | [diff] [blame] | 127 | - trigger: |
| 128 | name: nordix-gerrit-trigger-patchset-created |
| 129 | triggers: |
| 130 | - gerrit: |
| 131 | server-name: 'Nordix Gerrit' |
| 132 | trigger-on: |
| 133 | - patchset-created-event: |
| 134 | exclude-drafts: 'false' |
| 135 | exclude-trivial-rebase: 'false' |
| 136 | exclude-no-code-change: 'false' |
| 137 | - draft-published-event |
| 138 | - comment-added-contains-event: |
| 139 | comment-contains-value: 'recheck' |
| 140 | - comment-added-contains-event: |
| 141 | comment-contains-value: 'reverify' |
| 142 | projects: |
Fatih Degirmenci | 1f3f914 | 2019-02-08 12:07:36 +0100 | [diff] [blame] | 143 | - project-compare-type: 'REG_EXP' |
Fatih Degirmenci | 1fab66d | 2018-10-18 15:14:30 +0200 | [diff] [blame] | 144 | project-pattern: '{project}' |
| 145 | branches: |
| 146 | - branch-compare-type: 'ANT' |
| 147 | branch-pattern: '**/{branch}' |
| 148 | file-paths: |
| 149 | - compare-type: 'ANT' |
| 150 | pattern: '{files}' |
| 151 | skip-vote: |
| 152 | successful: false |
| 153 | failed: false |
| 154 | unstable: false |
| 155 | notbuilt: false |
| 156 | |
| 157 | - trigger: |
| 158 | name: nordix-gerrit-trigger-change-merged |
| 159 | triggers: |
| 160 | - gerrit: |
| 161 | server-name: 'Nordix Gerrit' |
| 162 | trigger-on: |
| 163 | - change-merged-event |
| 164 | - comment-added-contains-event: |
| 165 | comment-contains-value: 'remerge' |
| 166 | projects: |
| 167 | - project-compare-type: 'ANT' |
| 168 | project-pattern: '{project}' |
| 169 | branches: |
| 170 | - branch-compare-type: 'ANT' |
| 171 | branch-pattern: '**/{branch}' |
| 172 | file-paths: |
| 173 | - compare-type: 'ANT' |
| 174 | pattern: '{files}' |
Fatih Degirmenci | f1d9610 | 2018-10-19 15:10:56 +0200 | [diff] [blame] | 175 | |
Conor Ward | d48d835 | 2019-01-02 15:54:28 +0000 | [diff] [blame] | 176 | - trigger: |
| 177 | name: nordix-gerrit-push-upstream |
| 178 | triggers: |
| 179 | - gerrit: |
| 180 | server-name: 'Nordix Gerrit' |
| 181 | trigger-on: |
| 182 | - comment-added-contains-event: |
| 183 | comment-contains-value: 'push-upstream' |
| 184 | projects: |
| 185 | - project-compare-type: 'ANT' |
| 186 | project-pattern: '{project}' |
| 187 | branches: |
| 188 | - branch-compare-type: 'ANT' |
| 189 | branch-pattern: '**/{branch}' |
| 190 | file-paths: |
| 191 | - compare-type: 'ANT' |
| 192 | pattern: '{files}' |
| 193 | |
Fatih Degirmenci | a2beeb2 | 2018-12-10 10:57:50 -0800 | [diff] [blame] | 194 | # triggers for ONAP Gerrit |
| 195 | - trigger: |
| 196 | name: onap-gerrit-trigger-change-merged |
| 197 | triggers: |
| 198 | - gerrit: |
| 199 | server-name: 'ONAP Gerrit' |
| 200 | trigger-on: |
| 201 | - change-merged-event |
| 202 | - comment-added-contains-event: |
| 203 | comment-contains-value: 'remerge' |
| 204 | projects: |
| 205 | - project-compare-type: 'ANT' |
| 206 | project-pattern: '{project}' |
| 207 | branches: |
| 208 | - branch-compare-type: 'ANT' |
| 209 | branch-pattern: '**/{branch}' |
| 210 | file-paths: |
| 211 | - compare-type: 'ANT' |
| 212 | pattern: '{files}' |
Fatih Degirmenci | e0611a1 | 2018-12-18 09:24:53 +0100 | [diff] [blame] | 213 | silent: true |
| 214 | silent-start: true |
Fatih Degirmenci | a2beeb2 | 2018-12-10 10:57:50 -0800 | [diff] [blame] | 215 | |
Fatih Degirmenci | 1e7b337 | 2019-03-14 15:11:15 -0700 | [diff] [blame] | 216 | # triggers for Acumos Gerrit |
| 217 | - trigger: |
| 218 | name: acumos-gerrit-trigger-change-merged |
| 219 | triggers: |
| 220 | - gerrit: |
| 221 | server-name: 'Acumos Gerrit' |
| 222 | trigger-on: |
| 223 | - change-merged-event |
| 224 | - comment-added-contains-event: |
| 225 | comment-contains-value: 'remerge' |
| 226 | projects: |
| 227 | - project-compare-type: 'ANT' |
| 228 | project-pattern: '{project}' |
| 229 | branches: |
| 230 | - branch-compare-type: 'ANT' |
| 231 | branch-pattern: '**/{branch}' |
| 232 | file-paths: |
| 233 | - compare-type: 'ANT' |
| 234 | pattern: '{files}' |
| 235 | silent: true |
| 236 | silent-start: true |
| 237 | |
| 238 | |
Fatih Degirmenci | f1d9610 | 2018-10-19 15:10:56 +0200 | [diff] [blame] | 239 | # wrappers to use for jobs |
| 240 | - wrapper: |
| 241 | name: nordixinfra-jjb-creds-wrapper |
| 242 | wrappers: |
| 243 | - credentials-binding: |
| 244 | - username-password-separated: |
| 245 | credential-id: nordixinfra-jjb-creds |
| 246 | username: JJB_USERNAME |
| 247 | password: JJB_USERTOKEN |
Fatih Degirmenci | 2804ff9 | 2019-01-29 10:43:13 +0100 | [diff] [blame] | 248 | |
| 249 | # timeout wrapper to use for jobs |
| 250 | - wrapper: |
| 251 | name: build-timeout |
| 252 | wrappers: |
| 253 | - timeout: |
| 254 | timeout: '{timeout}' |
| 255 | timeout-var: 'BUILD_TIMEOUT' |
| 256 | fail: true |
Fatih Degirmenci | 243f424 | 2019-01-31 18:48:58 +0100 | [diff] [blame] | 257 | |
Fatih Degirmenci | 46f97c7 | 2019-02-07 10:58:44 +0100 | [diff] [blame] | 258 | # wrapper to fix jenkins build workspace permissions |
| 259 | - wrapper: |
| 260 | name: fix-workspace-permissions |
| 261 | wrappers: |
| 262 | - pre-scm-buildstep: |
| 263 | failOnError: true |
| 264 | buildsteps: |
| 265 | - shell: | |
| 266 | #!/bin/bash |
| 267 | sudo chown -R $USER:$USER $WORKSPACE || exit 1 |
| 268 | |
Fatih Degirmenci | 243f424 | 2019-01-31 18:48:58 +0100 | [diff] [blame] | 269 | - publisher: |
| 270 | name: notify-slack |
| 271 | publishers: |
| 272 | - slack: |
| 273 | room: '{slack-channel}' |
| 274 | notify-failure: True |
Fatih Degirmenci | fbd236f | 2019-02-07 10:08:35 +0100 | [diff] [blame] | 275 | |
| 276 | # property to discard old builds |
| 277 | - property: |
| 278 | name: logrotate |
| 279 | properties: |
| 280 | - build-discarder: |
| 281 | days-to-keep: 30 |
| 282 | num-to-keep: 100 |
| 283 | artifact-days-to-keep: 30 |
| 284 | artifact-num-to-keep: 100 |