blob: c3123e8845ba9a89672695cf9d8fc1e996bccb8d [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'
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070032 }
33 stage ('Build packages and libraries') {
Luca Prete08e6f802018-04-17 11:49:45 -070034 sh returnStdout: true, script: '/bin/bash -c make prereq'
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070035 sh returnStdout: true, script: '/bin/bash -c make'
36 }
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070037 stage ('Create Debian file') {
Luca Prete3e7db1f2018-05-14 10:51:48 -070038 sh returnStdout: true, script: '/bin/bash -c make deb'
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070039 }
Luca Prete3e7db1f2018-05-14 10:51:48 -070040 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 Khalasi3d9f5a72018-04-16 16:27:15 -070046 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