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 | |
| 15 | import groovy.json.JsonSlurperClassic |
| 16 | |
| 17 | node ('olt-agent-onf') { |
| 18 | timeout (time: 240) { |
| 19 | try { |
| 20 | stage ('Clean up') { |
| 21 | sh returnStdout: true, script: 'sudo rm -rf openolt' |
| 22 | } |
| 23 | stage ('Clone OpenOLT') { |
| 24 | sh returnStdout: true, script: 'git clone https://gerrit.opencord.org/openolt' |
| 25 | } |
| 26 | dir ('openolt') { |
| 27 | stage ('Copy over SDK, BAL, patch files and DEB generators') { |
| 28 | sh returnStdout: true, script: 'cp ../../build-files/SW-BCM68620_2_4_3_6.zip download' |
| 29 | sh returnStdout: true, script: 'cp ../../build-files/sdk-all-6.5.7.tar.gz download' |
| 30 | sh returnStdout: true, script: 'cp ../../build-files/ACCTON_BAL_2.4.3.6-V201710131639.patch download' |
| 31 | 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] | 32 | } |
| 33 | stage ('Build packages and libraries') { |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 34 | sh returnStdout: true, script: '/bin/bash -c make prereq' |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 35 | sh returnStdout: true, script: '/bin/bash -c make' |
| 36 | } |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 37 | stage ('Create Debian file') { |
Luca Prete | 3e7db1f | 2018-05-14 10:51:48 -0700 | [diff] [blame] | 38 | sh returnStdout: true, script: '/bin/bash -c make deb' |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 39 | } |
Luca Prete | 3e7db1f | 2018-05-14 10:51:48 -0700 | [diff] [blame] | 40 | stage ('Publish executables and DEB package to web server') { |
| 41 | sh returnStdout: true, script: 'sudo mkdir -p /var/www/voltha-bal/executables' |
| 42 | sh returnStdout: true, script: 'sudo cp build/*.tar.gz /var/www/voltha-bal/executables/' |
| 43 | sh returnStdout: true, script: 'sudo cp build/libgrpc++_reflection.so.1 /var/www/voltha-bal/executables/' |
| 44 | sh returnStdout: true, script: 'sudo cp build/libgrpc++.so.1 /var/www/voltha-bal/executables/' |
| 45 | sh returnStdout: true, script: 'sudo cp /usr/local/lib/libgrpc.so.6 /var/www/voltha-bal/executables/' |
Kailash Khalasi | 3d9f5a7 | 2018-04-16 16:27:15 -0700 | [diff] [blame] | 46 | sh returnStdout: true, script: 'sudo cp *.deb /var/www/voltha-bal/voltha-bal.deb' |
| 47 | } |
| 48 | } |
| 49 | currentBuild.result = 'SUCCESS' |
| 50 | } catch (err) { |
| 51 | currentBuild.result = 'FAILURE' |
| 52 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 53 | } finally { |
| 54 | echo "RESULT: ${currentBuild.result}" |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |