Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 1 | /* voltha-atest-provisioning pipeline */ |
| 2 | |
| 3 | pipeline { |
| 4 | |
| 5 | /* no label, executor is determined by JJB */ |
| 6 | agent { |
| 7 | label "${params.executorNode}" |
| 8 | } |
| 9 | |
| 10 | stages { |
| 11 | |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 12 | stage ('Clean up') { |
| 13 | steps { |
| 14 | sh ''' |
Kailash | b30eb04 | 2019-01-23 12:14:10 -0800 | [diff] [blame] | 15 | sudo rm -rf * |
Kailash | e51b637 | 2018-11-16 11:38:13 -0800 | [diff] [blame] | 16 | sudo rm -rf /home/cord/cord* |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 17 | ''' |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | stage('Voltha Repo') { |
Oleg Polyakov | 9e76f5d | 2018-06-18 17:21:33 -0400 | [diff] [blame] | 22 | steps { |
| 23 | checkout(changelog: false, \ |
| 24 | poll: false, |
| 25 | scm: [$class: 'RepoScm', \ |
| 26 | manifestRepositoryUrl: "${params.manifestUrl}", \ |
| 27 | manifestBranch: "${params.manifestBranch}", \ |
| 28 | currentBranch: true, \ |
| 29 | destinationDir: 'cord', \ |
| 30 | forceSync: true, |
| 31 | resetFirst: true, \ |
| 32 | quiet: true, \ |
| 33 | jobs: 4, \ |
| 34 | showAllChanges: true] \ |
| 35 | ) |
| 36 | } |
| 37 | } |
| 38 | |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 39 | stage ('Build Voltha and ONOS') { |
Kailash | 74eed21 | 2019-05-07 09:57:59 -0700 | [diff] [blame] | 40 | when { expression { return params.BuildVoltha } } |
Oleg Polyakov | 9e76f5d | 2018-06-18 17:21:33 -0400 | [diff] [blame] | 41 | steps { |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 42 | sh ''' |
Kailash Khalasi | aa35cd3 | 2018-11-12 12:30:08 -0800 | [diff] [blame] | 43 | sudo service docker restart |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 44 | cd $WORKSPACE/cord/incubator/voltha |
Kailash | c24db75 | 2019-05-07 14:01:40 -0700 | [diff] [blame] | 45 | repo download "${GERRIT_PROJECT}" "${gerritChangeNumber}/${gerritPatchsetNumber}" |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 46 | chmod +x env.sh |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 47 | source env.sh |
Kailash Khalasi | f072012 | 2018-11-08 10:18:24 -0800 | [diff] [blame] | 48 | make fetch |
| 49 | make clean |
| 50 | make build |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 51 | ''' |
| 52 | } |
| 53 | } |
Oleg Polyakov | 9e76f5d | 2018-06-18 17:21:33 -0400 | [diff] [blame] | 54 | |
Kailash | 74eed21 | 2019-05-07 09:57:59 -0700 | [diff] [blame] | 55 | stage ('Build BBSIM') { |
| 56 | when { expression { return params.BuildBbsim } } |
| 57 | steps { |
| 58 | sh ''' |
| 59 | sudo service docker restart |
| 60 | cd $WORKSPACE/cord/incubator/voltha-bbsim |
Kailash | 3ae2617 | 2019-05-08 11:12:21 -0700 | [diff] [blame] | 61 | repo download "${GERRIT_PROJECT}" "${gerritChangeNumber}/${gerritPatchsetNumber}" |
Kailash | 8690172 | 2019-08-01 11:12:06 -0700 | [diff] [blame^] | 62 | make docker-build |
Kailash | 74eed21 | 2019-05-07 09:57:59 -0700 | [diff] [blame] | 63 | docker images | grep bbsim |
| 64 | ''' |
| 65 | } |
| 66 | } |
| 67 | |
Kailash | b30eb04 | 2019-01-23 12:14:10 -0800 | [diff] [blame] | 68 | stage ('Start Voltha Test Suite') { |
Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 69 | steps { |
Kailash | 4a4f047 | 2019-05-08 09:42:46 -0700 | [diff] [blame] | 70 | sh """ |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 71 | cd $WORKSPACE/cord/incubator/voltha/tests/atests/common/ |
Kailash | 74eed21 | 2019-05-07 09:57:59 -0700 | [diff] [blame] | 72 | ./run_robot.sh jenkinstest ${params.adapter} || true |
Kailash | 4a4f047 | 2019-05-08 09:42:46 -0700 | [diff] [blame] | 73 | """ |
Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 74 | } |
| 75 | } |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 76 | |
| 77 | stage('Publish') { |
| 78 | steps { |
| 79 | sh """ |
| 80 | if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs |
| 81 | cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/ ./RobotLogs |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 82 | cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/voltha_test_results/*.log $WORKSPACE/ |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 83 | """ |
| 84 | |
| 85 | step([$class: 'RobotPublisher', |
| 86 | disableArchiveOutput: false, |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 87 | logFileName: 'RobotLogs/jenkinstest/log*.html', |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 88 | otherFiles: '', |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 89 | outputFileName: 'RobotLogs/jenkinstest/output*.xml', |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 90 | outputPath: '.', |
| 91 | passThreshold: 100, |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 92 | reportFileName: 'RobotLogs/jenkinstest/report*.html', |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 93 | unstableThreshold: 0]); |
| 94 | } |
| 95 | } |
Kailash | 45b2e8d | 2018-11-05 09:17:00 -0800 | [diff] [blame] | 96 | } |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 97 | |
Kailash | 45b2e8d | 2018-11-05 09:17:00 -0800 | [diff] [blame] | 98 | post { |
| 99 | always { |
Kailash | 45b2e8d | 2018-11-05 09:17:00 -0800 | [diff] [blame] | 100 | archiveArtifacts artifacts: '*.log' |
| 101 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "gdepatie@northforgeinc.com, kailash@opennetworking.org", sendToIndividuals: false]) |
| 102 | } |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 103 | } |
Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 104 | } |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 105 | |
| 106 | |