blob: 052f0d94104f505b59675b004cde2e6650c9c9c5 [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
Kailash Khalasi8b348b62018-05-25 10:17:12 -070015node ('openolt_deb_onf_agent') {
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070016 timeout (time: 240) {
17 try {
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070018 dir ('openolt') {
Luca Preteadc88cc2018-05-16 15:10:52 -070019 stage ('Pull latest code') {
20 sh returnStdout: true, script: 'git pull'
21 }
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070022 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 Khalasi3d9f5a72018-04-16 16:27:15 -070027 }
28 stage ('Build packages and libraries') {
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070029 sh returnStdout: true, script: '/bin/bash -c make'
30 }
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070031 stage ('Create Debian file') {
Luca Pretec8ccca32018-05-17 09:30:05 -070032 sh returnStdout: true, script: '/bin/bash -c "make deb"'
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070033 }
Luca Prete3e7db1f2018-05-14 10:51:48 -070034 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 Preteadc88cc2018-05-16 15:10:52 -070037 sh returnStdout: true, script: 'sudo cp build/openolt /var/www/voltha-bal/executables/'
Luca Prete3e7db1f2018-05-14 10:51:48 -070038 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 Preteadc88cc2018-05-16 15:10:52 -070041 sh returnStdout: true, script: 'sudo cp build/openolt.deb /var/www/voltha-bal'
Kailash Khalasi3d9f5a72018-04-16 16:27:15 -070042 }
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}