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' |
| 32 | sh returnStdout: true, script: 'cp -r ../../build-files/mkdebian .' |
| 33 | } |
| 34 | stage ('Build packages and libraries') { |
| 35 | sh returnStdout: true, script: '/bin/bash -c make' |
| 36 | } |
| 37 | stage ('Copy ASFvOLT16 release file to mkdebian folder') { |
| 38 | sh returnStdout: true, script: 'cp build/*.tar.gz mkdebian/debian/release_asfvolt16.tar.gz' |
| 39 | } |
| 40 | stage ('Copy OpenOLT to mkdebian folder') { |
| 41 | sh returnStdout: true, script: 'cp build/openolt mkdebian/debian' |
| 42 | } |
| 43 | stage ('Copy gRPC to mkdebian folder') { |
| 44 | sh returnStdout: true, script: 'cp build/libgrpc++_reflection.so.1 mkdebian/debian' |
| 45 | sh returnStdout: true, script: 'cp build/libgrpc++.so.1 mkdebian/debian' |
| 46 | sh returnStdout: true, script: 'cp /usr/local/lib/libgrpc.so.6 mkdebian/debian' |
| 47 | } |
| 48 | stage ('Create Debian file') { |
| 49 | sh returnStdout: true, script: '#!/bin/bash \n cd mkdebian; ./build_asfvolt16_deb.sh' |
| 50 | } |
| 51 | stage ('Publish Voltha BAL driver DEB package') { |
| 52 | sh returnStdout: true, script: 'sudo cp *.deb /var/www/voltha-bal/voltha-bal.deb' |
| 53 | } |
| 54 | } |
| 55 | currentBuild.result = 'SUCCESS' |
| 56 | } catch (err) { |
| 57 | currentBuild.result = 'FAILURE' |
| 58 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 59 | } finally { |
| 60 | echo "RESULT: ${currentBuild.result}" |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |