Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 1 | --- |
| 2 | # ONOS System Test Pipeline jobs |
| 3 | |
| 4 | # TODO: Change all the job names in Jenkins Pipeline script. |
| 5 | |
| 6 | - test-free-job-boiler-plate: &test-free-job-boiler-plate |
| 7 | name: test-free-job-boiler-plate |
| 8 | |
| 9 | project-type: freestyle |
| 10 | |
| 11 | - init-station-plate: &init-station-plate |
| 12 | name: init-station-plate |
| 13 | station-type: |
| 14 | - 'VM' |
| 15 | - 'BM' |
| 16 | |
| 17 | - test-free-init-procedure-plate: &test-free-init-procedure-plate |
| 18 | name: test-free-init-procedure-plate |
| 19 | project: OnosSystemTest |
| 20 | stream: 'master' |
| 21 | |
| 22 | - inject-env-variable-plate: &inject-env-variable-plate |
| 23 | name: inject-env-variable-plate |
| 24 | wrappers: |
| 25 | - inject: |
| 26 | properties-file: '/var/jenkins/TestONOS.property' |
| 27 | script-content: | |
| 28 | echo "ONOSBranch=$ONOSBranch" > /var/jenkins/TestONOS.property |
| 29 | echo "TestONBranch=$TestONBranch" >> /var/jenkins/TestONOS.property |
| 30 | echo "ONOSTag=$ONOSTag" >> /var/jenkins/TestONOS.property |
| 31 | echo "WikiPrefix=$WikiPrefix" >> /var/jenkins/TestONOS.property |
| 32 | override-build-parameters: true |
| 33 | |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 34 | - builder: |
| 35 | name: clean-up-bash |
| 36 | beforeClean: | |
| 37 | echo -e "\n Before clean up disk usage: \n" |
| 38 | df -h |
| 39 | cleaning: | |
| 40 | cleaning{ |
| 41 | if [ $? -eq 0 ] |
| 42 | then |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 43 | echo "Checking if there are logs older than ${{DAYS_OLD}} days...." |
| 44 | for i in $(find . -mtime +${{DAYS_OLD}} -type d) |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 45 | do |
| 46 | echo -e "DIRs older than $DAYS_OLD are: " |
| 47 | echo $i |
| 48 | rm -rf $i |
| 49 | done |
| 50 | fi |
| 51 | afterClean: | |
| 52 | echo -e "\n After clean up disk usage:\n" |
| 53 | df -h |
| 54 | builders: |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 55 | - shell: | |
| 56 | #!/bin/bash |
| 57 | |
| 58 | source ./clean-up.sh |
| 59 | |
| 60 | {beforeClean} |
| 61 | |
| 62 | cd /home/{user}/OnosSystemTest/TestON/logs |
| 63 | |
| 64 | {cleaning} |
| 65 | |
| 66 | {additional} |
| 67 | |
| 68 | {afterClean} |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 69 | |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 70 | # post_Job |
| 71 | - job-template: |
| 72 | name: postjob-{station-type} |
| 73 | |
| 74 | <<: *test-free-job-boiler-plate |
| 75 | |
| 76 | properties: |
| 77 | |
| 78 | - build-discarder: |
| 79 | num-to-keep: 1 |
| 80 | |
| 81 | parameters: |
| 82 | |
| 83 | - lf-infra-parameters: |
| 84 | project: '{project}' |
| 85 | branch: '{stream}' |
| 86 | stream: '{stream}' |
| 87 | lftools-version: '{lftools-version}' |
| 88 | |
| 89 | node: 'TestStation-{station-type}s' |
| 90 | |
| 91 | publishers: |
| 92 | |
| 93 | # - image-gallery: |
| 94 | # - gallery-type: archived-images-gallery |
| 95 | # title: 'Test result' |
| 96 | # includes: '*.jpg' |
| 97 | |
| 98 | - archive: |
| 99 | artifacts: '*.jpg' |
| 100 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 101 | # cleanup_stations - TDOO: check if getting the directory works. |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 102 | - job-template: |
| 103 | name: test-station-log-cleanup-VM |
| 104 | |
| 105 | <<: *test-free-job-boiler-plate |
| 106 | <<: *inject-env-variable-plate |
| 107 | properties: |
| 108 | |
| 109 | - build-discarder: |
| 110 | num-to-keep: 30 |
| 111 | |
| 112 | parameters: |
| 113 | |
| 114 | - string: |
| 115 | name: 'DAYS_OLD' |
| 116 | default: '15' |
| 117 | |
| 118 | - lf-infra-parameters: |
| 119 | project: '{project}' |
| 120 | branch: '{stream}' |
| 121 | stream: '{stream}' |
| 122 | lftools-version: '{lftools-version}' |
| 123 | |
| 124 | node: 'TestStation-VMs' |
| 125 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 126 | # triggers: |
| 127 | # - timed: '01 08 1,15 * *' |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 128 | |
| 129 | builders: |
| 130 | |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 131 | - clean-up-bash: |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 132 | user: 'sdn' |
| 133 | additional: '' |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 134 | |
| 135 | - job-template: |
| 136 | name: test-station-log-cleanup-BM |
| 137 | |
| 138 | <<: *test-free-job-boiler-plate |
| 139 | <<: *inject-env-variable-plate |
| 140 | properties: |
| 141 | |
| 142 | - build-discarder: |
| 143 | num-to-keep: 30 |
| 144 | |
| 145 | parameters: |
| 146 | |
| 147 | - string: |
| 148 | name: 'DAYS_OLD' |
| 149 | default: '30' |
| 150 | |
| 151 | - lf-infra-parameters: |
| 152 | project: '{project}' |
| 153 | branch: '{stream}' |
| 154 | stream: '{stream}' |
| 155 | lftools-version: '{lftools-version}' |
| 156 | |
| 157 | node: 'TestStation-BMs' |
| 158 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 159 | # triggers: |
| 160 | # - timed: '01 08 1 * *' |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 161 | |
| 162 | builders: |
| 163 | |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 164 | - clean-up-bash: |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 165 | user: 'sdn' |
| 166 | additional: '' |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 167 | |
| 168 | - job-template: |
| 169 | name: test-station-log-cleanup-CHO |
| 170 | |
| 171 | <<: *test-free-job-boiler-plate |
| 172 | <<: *inject-env-variable-plate |
| 173 | properties: |
| 174 | |
| 175 | - build-discarder: |
| 176 | num-to-keep: 15 |
| 177 | |
| 178 | parameters: |
| 179 | |
| 180 | - string: |
| 181 | name: 'DAYS_OLD' |
| 182 | default: '15' |
| 183 | |
| 184 | - lf-infra-parameters: |
| 185 | project: '{project}' |
| 186 | branch: '{stream}' |
| 187 | stream: '{stream}' |
| 188 | lftools-version: '{lftools-version}' |
| 189 | |
| 190 | node: 'TestStation-CHOs' |
| 191 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 192 | # triggers: |
| 193 | # - timed: '@daily' |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 194 | |
| 195 | builders: |
| 196 | |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 197 | - clean-up-bash: |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 198 | user: 'admin' |
| 199 | additional: | |
| 200 | cd /var/lib/jenkins/workspace/OnosProdCHOpost |
| 201 | |
| 202 | echo "Checking if there are jenkins-logs older than ${{DAYS_OLD}} days...." |
| 203 | for i in $(find . -mtime +${{DAYS_OLD}}) |
| 204 | do |
| 205 | echo -e "logs older than $DAYS_OLD are: " |
| 206 | echo $i |
| 207 | rm -rf $i |
| 208 | done |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 209 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 210 | # haven't done this yet. |
| 211 | - job-template: |
| 212 | name: QA-check-style |
| 213 | |
| 214 | <<: *test-free-job-boiler-plate |
| 215 | properties: |
| 216 | |
| 217 | - build-discarder: |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 218 | num-to-keep: 100 |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 219 | |
| 220 | parameters: |
| 221 | |
| 222 | - string: |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 223 | name: 'GERRIT_CHANGE_NUMBER' |
| 224 | default: '' |
| 225 | description: '5-digit number that corresponds to the patch set change on Gerrit.' |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 226 | |
| 227 | - lf-infra-parameters: |
| 228 | project: '{project}' |
| 229 | branch: '{stream}' |
| 230 | stream: '{stream}' |
| 231 | lftools-version: '{lftools-version}' |
| 232 | |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 233 | concurrent: true |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 234 | |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 235 | node: 'TestStation-Jeremys' |
| 236 | |
| 237 | builders: |
| 238 | |
| 239 | - shell: !include-raw-escape: check-style.sh |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 240 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 241 | - job-template: |
| 242 | name: delta-nightly |
| 243 | |
| 244 | <<: *test-free-job-boiler-plate |
| 245 | properties: |
| 246 | |
| 247 | - build-discarder: |
| 248 | num-to-keep: 30 |
| 249 | |
| 250 | parameters: |
| 251 | |
| 252 | - string: |
| 253 | name: 'NIGHTLY_FILE_NAME' |
| 254 | default: '' |
| 255 | description: | |
| 256 | Name of ONOS nightly build file |
| 257 | will be set to the latest file if not specified here |
| 258 | |
| 259 | - string: |
| 260 | name: 'ONOS_VERSION' |
| 261 | default: '1.11.0' |
| 262 | description: 'Version number in ONOS nightly build file' |
| 263 | |
| 264 | - string: |
| 265 | name: 'DELTA_PATH' |
| 266 | default: '/home/sdn' |
| 267 | description: 'Path of DELTA project' |
| 268 | |
| 269 | - string: |
| 270 | name: 'WIKI_PREFIX' |
| 271 | default: 'master' |
| 272 | |
| 273 | - bool: |
| 274 | name: 'CLEANUP' |
| 275 | default: true |
| 276 | |
| 277 | - lf-infra-parameters: |
| 278 | project: '{project}' |
| 279 | branch: '{stream}' |
| 280 | stream: '{stream}' |
| 281 | lftools-version: '{lftools-version}' |
| 282 | |
| 283 | node: 'TestStation-BMs' |
| 284 | |
| 285 | wrappers: |
| 286 | - inject: |
| 287 | properties-file: '/var/jenkins/TestONOS.property' |
| 288 | |
| 289 | builders: |
| 290 | |
| 291 | - shell: !include-raw-escape: delta-script.sh |
| 292 | |
| 293 | # Todo : add graph and confluence ( use pipeline for post build ..? ) |
| 294 | |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 295 | - job-template: |
| 296 | name: init-CHO |
| 297 | |
| 298 | <<: *test-free-job-boiler-plate |
| 299 | properties: |
| 300 | |
| 301 | - build-discarder: |
| 302 | num-to-keep: 30 |
| 303 | |
| 304 | parameters: |
| 305 | |
| 306 | - string: |
| 307 | name: 'ONOSBranch' |
| 308 | default: 'master' |
| 309 | description: | |
| 310 | set onos branch to test. default to "master", |
| 311 | but can also be set at "onos-1.2", etc. |
| 312 | This parameter is also use to trigger where the test results to be posted |
| 313 | |
| 314 | - string: |
| 315 | name: 'ONOSJVMHeap' |
| 316 | default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\"" |
| 317 | description: 'onos cell jvm heap size setting' |
| 318 | |
| 319 | - string: |
| 320 | name: 'TestONBranch' |
| 321 | default: 'master' |
| 322 | description: 'sets TestON branch' |
| 323 | |
| 324 | - string: |
| 325 | name: 'ONOSTag' |
| 326 | default: '' |
| 327 | |
| 328 | - lf-infra-parameters: |
| 329 | project: '{project}' |
| 330 | branch: '{stream}' |
| 331 | stream: '{stream}' |
| 332 | lftools-version: '{lftools-version}' |
| 333 | |
| 334 | node: 'TestStation-CHOs' |
| 335 | |
| 336 | wrappers: |
| 337 | - inject: |
| 338 | properties-file: '/var/lib/jenkins/TestONOS.property' |
| 339 | script-content: | |
| 340 | echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property |
| 341 | echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property |
| 342 | echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property |
| 343 | |
| 344 | override-build-parameters: true |
| 345 | |
| 346 | builders: |
| 347 | |
| 348 | - shell: !include-raw-escape: cho-init.sh |
| 349 | |
| 350 | - job-template: |
| 351 | name: running-CHO |
| 352 | |
| 353 | <<: *test-free-job-boiler-plate |
| 354 | properties: |
| 355 | |
| 356 | - build-discarder: |
| 357 | num-to-keep: 30 |
| 358 | |
| 359 | parameters: |
| 360 | |
| 361 | - lf-infra-parameters: |
| 362 | project: '{project}' |
| 363 | branch: '{stream}' |
| 364 | stream: '{stream}' |
| 365 | lftools-version: '{lftools-version}' |
| 366 | |
| 367 | node: 'TestStation-CHOs' |
| 368 | triggers: |
| 369 | - reverse: |
| 370 | jobs: 'init-CHO' |
| 371 | result: 'failure' |
| 372 | |
| 373 | builders: |
| 374 | |
| 375 | - shell: !include-raw-escape: running-cho.sh |
| 376 | |
| 377 | - job-template: |
| 378 | name: post-CHO-master |
| 379 | |
| 380 | <<: *test-free-job-boiler-plate |
| 381 | properties: |
| 382 | - lf-infra-properties: |
| 383 | project: '{project}' |
| 384 | build-days-to-keep: 7 |
| 385 | |
| 386 | parameters: |
| 387 | |
| 388 | - lf-infra-parameters: |
| 389 | project: '{project}' |
| 390 | branch: '{stream}' |
| 391 | stream: '{stream}' |
| 392 | lftools-version: '{lftools-version}' |
| 393 | |
| 394 | node: 'TestStation-CHOs' |
| 395 | # triggers: |
| 396 | # - timed: 'H/60 * * * *' |
| 397 | wrappers: |
| 398 | - inject: |
| 399 | properties-file: '/var/lib/jenkins/TestONOS.property' |
| 400 | builders: |
| 401 | |
| 402 | - shell: !include-raw-escape: cho-post.sh |
| 403 | # plot data needed. |
| 404 | |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 405 | |
Devin Lim | 49200ec | 2018-01-19 16:17:41 -0800 | [diff] [blame] | 406 | #TODO LIST : DELTA -> perhaps change into pipeline?? , CHO_jobs, Check_style, Personal stations : necessary? |
| 407 | |
| 408 | - project: |
| 409 | name: post-result-jobs |
| 410 | project-name: post-result-jobs |
| 411 | |
| 412 | <<: *test-free-init-procedure-plate |
| 413 | <<: *init-station-plate |
| 414 | jobs: |
| 415 | - 'postjob-{station-type}' |
| 416 | |
| 417 | - project: |
| 418 | name: cleanup-jobs |
| 419 | project-name: cleanup-jobs |
| 420 | |
| 421 | <<: *test-free-init-procedure-plate |
| 422 | <<: *init-station-plate |
| 423 | jobs: |
| 424 | - 'test-station-log-cleanup-VM' |
| 425 | - 'test-station-log-cleanup-BM' |
| 426 | - 'test-station-log-cleanup-CHO' |
Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame] | 427 | |
| 428 | - project: |
| 429 | name: check-style |
| 430 | project-name: check-style |
| 431 | |
| 432 | <<: *test-free-init-procedure-plate |
| 433 | jobs: |
| 434 | - 'QA-check-style' |
| 435 | |
| 436 | - project: |
| 437 | name: delta-test |
| 438 | project-name: delta-test |
| 439 | |
| 440 | <<: *test-free-init-procedure-plate |
| 441 | jobs: |
| 442 | - 'delta-nightly' |
Devin Lim | 7d7cd99 | 2018-01-25 14:12:40 -0800 | [diff] [blame] | 443 | |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 444 | - project: |
| 445 | name: cho-tests |
| 446 | project-name: cho-tests |
| 447 | |
| 448 | <<: *test-free-init-procedure-plate |
| 449 | jobs: |
| 450 | - 'init-CHO' |
| 451 | - 'running-CHO' |
| 452 | - 'post-CHO-master' |