blob: 9a2a13f397edf09d64a316bfc9d93daa27cc9c58 [file] [log] [blame]
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -07001// 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
15import groovy.json.JsonSlurperClassic
16
17node ('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') {
Luca Prete08e6f802018-04-17 11:49:45 -070035 sh returnStdout: true, script: '/bin/bash -c make prereq'
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070036 sh returnStdout: true, script: '/bin/bash -c make'
37 }
38 stage ('Copy ASFvOLT16 release file to mkdebian folder') {
39 sh returnStdout: true, script: 'cp build/*.tar.gz mkdebian/debian/release_asfvolt16.tar.gz'
40 }
41 stage ('Copy OpenOLT to mkdebian folder') {
42 sh returnStdout: true, script: 'cp build/openolt mkdebian/debian'
43 }
44 stage ('Copy gRPC to mkdebian folder') {
45 sh returnStdout: true, script: 'cp build/libgrpc++_reflection.so.1 mkdebian/debian'
46 sh returnStdout: true, script: 'cp build/libgrpc++.so.1 mkdebian/debian'
47 sh returnStdout: true, script: 'cp /usr/local/lib/libgrpc.so.6 mkdebian/debian'
48 }
49 stage ('Create Debian file') {
50 sh returnStdout: true, script: '#!/bin/bash \n cd mkdebian; ./build_asfvolt16_deb.sh'
51 }
52 stage ('Publish Voltha BAL driver DEB package') {
53 sh returnStdout: true, script: 'sudo cp *.deb /var/www/voltha-bal/voltha-bal.deb'
54 }
55 }
56 currentBuild.result = 'SUCCESS'
57 } catch (err) {
58 currentBuild.result = 'FAILURE'
59 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
60 } finally {
61 echo "RESULT: ${currentBuild.result}"
62 }
63 }
64}
65