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') { |
Oleg Polyakov | 9e76f5d | 2018-06-18 17:21:33 -0400 | [diff] [blame] | 40 | steps { |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 41 | sh ''' |
Kailash Khalasi | aa35cd3 | 2018-11-12 12:30:08 -0800 | [diff] [blame] | 42 | sudo service docker restart |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 43 | cd $WORKSPACE/cord/incubator/voltha |
Kailash | aca74b9 | 2018-11-16 10:55:47 -0800 | [diff] [blame] | 44 | repo download voltha "${gerritChangeNumber}/${gerritPatchsetNumber}" |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 45 | chmod +x env.sh |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 46 | source env.sh |
Kailash Khalasi | f072012 | 2018-11-08 10:18:24 -0800 | [diff] [blame] | 47 | make fetch |
| 48 | make clean |
| 49 | make build |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 50 | ''' |
| 51 | } |
| 52 | } |
Oleg Polyakov | 9e76f5d | 2018-06-18 17:21:33 -0400 | [diff] [blame] | 53 | |
Kailash | b30eb04 | 2019-01-23 12:14:10 -0800 | [diff] [blame] | 54 | stage ('Start Voltha Test Suite') { |
Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 55 | steps { |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 56 | sh ''' |
| 57 | cd $WORKSPACE/cord/incubator/voltha/tests/atests/common/ |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 58 | ./run_robot.sh jenkinstest || true |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 59 | ''' |
Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 60 | } |
| 61 | } |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 62 | |
| 63 | stage('Publish') { |
| 64 | steps { |
| 65 | sh """ |
| 66 | if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs |
| 67 | cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/ ./RobotLogs |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 68 | cp -r $WORKSPACE/cord/incubator/voltha/jenkinstest/voltha_test_results/*.log $WORKSPACE/ |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 69 | """ |
| 70 | |
| 71 | step([$class: 'RobotPublisher', |
| 72 | disableArchiveOutput: false, |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 73 | logFileName: 'RobotLogs/jenkinstest/log*.html', |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 74 | otherFiles: '', |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 75 | outputFileName: 'RobotLogs/jenkinstest/output*.xml', |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 76 | outputPath: '.', |
| 77 | passThreshold: 100, |
Kailash | 3bba5fe | 2018-11-06 10:48:25 -0800 | [diff] [blame] | 78 | reportFileName: 'RobotLogs/jenkinstest/report*.html', |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 79 | unstableThreshold: 0]); |
| 80 | } |
| 81 | } |
Kailash | 45b2e8d | 2018-11-05 09:17:00 -0800 | [diff] [blame] | 82 | } |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 83 | |
Kailash | 45b2e8d | 2018-11-05 09:17:00 -0800 | [diff] [blame] | 84 | post { |
| 85 | always { |
Kailash | 45b2e8d | 2018-11-05 09:17:00 -0800 | [diff] [blame] | 86 | archiveArtifacts artifacts: '*.log' |
| 87 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "gdepatie@northforgeinc.com, kailash@opennetworking.org", sendToIndividuals: false]) |
| 88 | } |
Oleg Polyakov | d9de903 | 2018-06-28 11:42:32 -0400 | [diff] [blame] | 89 | } |
Oleg Polyakov | 4d45436 | 2018-06-15 10:52:52 -0400 | [diff] [blame] | 90 | } |
Kailash Khalasi | cdb4667 | 2018-10-30 12:55:16 -0700 | [diff] [blame] | 91 | |
| 92 | |