Zack Williams | f173e4f | 2019-08-30 17:15:24 -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 | def jdkDistro = '${jdkDistro}' |
| 16 | |
Kailash Khalasi | c323b1a | 2018-04-19 15:49:48 -0700 | [diff] [blame] | 17 | node ('ubuntu16.04-basebuild-1c-2g') { |
Luca Prete | aee36ad | 2018-11-26 14:00:01 -0800 | [diff] [blame] | 18 | timeout (100) { |
| 19 | try { |
Matteo Scandolo | 5729dae | 2019-03-14 14:25:41 -0700 | [diff] [blame] | 20 | stage ('Checkout code') { |
Luca Prete | aee36ad | 2018-11-26 14:00:01 -0800 | [diff] [blame] | 21 | checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true]) |
| 22 | } |
Matteo Scandolo | 5729dae | 2019-03-14 14:25:41 -0700 | [diff] [blame] | 23 | stage ('Build and Publish apps') { |
Zack Williams | f173e4f | 2019-08-30 17:15:24 -0700 | [diff] [blame] | 24 | |
| 25 | // Set the JDK version |
| 26 | sh 'echo Using JDK distribution: ' + jdkDistro |
| 27 | sh 'sudo update-java-alternatives --set ' +jdkDistro |
| 28 | sh 'echo Java Version:' |
| 29 | sh 'java -version' |
| 30 | |
Luca Prete | aee36ad | 2018-11-26 14:00:01 -0800 | [diff] [blame] | 31 | configFileProvider([configFile(fileId: 'onoscord-apps', variable: 'MAVEN_SETTINGS')]) { |
Matteo Scandolo | 5729dae | 2019-03-14 14:25:41 -0700 | [diff] [blame] | 32 | sh 'export _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true && cd onos-apps/apps && mvn -s $MAVEN_SETTINGS -e clean deploy' |
Luca Prete | aee36ad | 2018-11-26 14:00:01 -0800 | [diff] [blame] | 33 | } |
| 34 | } |
| 35 | currentBuild.result = 'SUCCESS' |
| 36 | } catch (err) { |
| 37 | currentBuild.result = 'FAILURE' |
| 38 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
Kailash Khalasi | 8879d66 | 2018-04-20 13:37:05 -0700 | [diff] [blame] | 39 | } |
Luca Prete | aee36ad | 2018-11-26 14:00:01 -0800 | [diff] [blame] | 40 | echo "RESULT: ${currentBuild.result}" |
| 41 | } |
alshabib | 3e48815 | 2016-10-06 11:42:36 -0700 | [diff] [blame] | 42 | } |