Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 1 | // Copyright 2017-present Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Kailash Khalasi | 8b348b6 | 2018-05-25 10:17:12 -0700 | [diff] [blame^] | 15 | node ('openolt_deb_onf_agent') { |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 16 | timeout (time: 240) { |
| 17 | try { |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 18 | dir ('openolt') { |
Luca Prete | adc88cc | 2018-05-16 15:10:52 -0700 | [diff] [blame] | 19 | stage ('Pull latest code') { |
| 20 | sh returnStdout: true, script: 'git pull' |
| 21 | } |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 22 | stage ('Copy over SDK, BAL, patch files and DEB generators') { |
| 23 | sh returnStdout: true, script: 'cp ../../build-files/SW-BCM68620_2_4_3_6.zip download' |
| 24 | sh returnStdout: true, script: 'cp ../../build-files/sdk-all-6.5.7.tar.gz download' |
| 25 | sh returnStdout: true, script: 'cp ../../build-files/ACCTON_BAL_2.4.3.6-V201710131639.patch download' |
| 26 | sh returnStdout: true, script: 'cp ../../build-files/OPENOLT_BAL_2.4.3.6.patch download' |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 27 | } |
| 28 | stage ('Build packages and libraries') { |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 29 | sh returnStdout: true, script: '/bin/bash -c make' |
| 30 | } |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 31 | stage ('Create Debian file') { |
Luca Prete | c8ccca3 | 2018-05-17 09:30:05 -0700 | [diff] [blame] | 32 | sh returnStdout: true, script: '/bin/bash -c "make deb"' |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 33 | } |
Luca Prete | 3e7db1f | 2018-05-14 10:51:48 -0700 | [diff] [blame] | 34 | stage ('Publish executables and DEB package to web server') { |
| 35 | sh returnStdout: true, script: 'sudo mkdir -p /var/www/voltha-bal/executables' |
| 36 | sh returnStdout: true, script: 'sudo cp build/*.tar.gz /var/www/voltha-bal/executables/' |
Luca Prete | adc88cc | 2018-05-16 15:10:52 -0700 | [diff] [blame] | 37 | sh returnStdout: true, script: 'sudo cp build/openolt /var/www/voltha-bal/executables/' |
Luca Prete | 3e7db1f | 2018-05-14 10:51:48 -0700 | [diff] [blame] | 38 | sh returnStdout: true, script: 'sudo cp build/libgrpc++_reflection.so.1 /var/www/voltha-bal/executables/' |
| 39 | sh returnStdout: true, script: 'sudo cp build/libgrpc++.so.1 /var/www/voltha-bal/executables/' |
| 40 | sh returnStdout: true, script: 'sudo cp /usr/local/lib/libgrpc.so.6 /var/www/voltha-bal/executables/' |
Luca Prete | adc88cc | 2018-05-16 15:10:52 -0700 | [diff] [blame] | 41 | sh returnStdout: true, script: 'sudo cp build/openolt.deb /var/www/voltha-bal' |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 42 | } |
| 43 | } |
| 44 | currentBuild.result = 'SUCCESS' |
| 45 | } catch (err) { |
| 46 | currentBuild.result = 'FAILURE' |
| 47 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 48 | } finally { |
| 49 | echo "RESULT: ${currentBuild.result}" |
| 50 | } |
| 51 | } |
| 52 | } |