blob: 2ba8d6fd99ed90d0c4109b7dcc1c9d24b702d378 [file] [log] [blame]
Zack Williamsf173e4f2019-08-30 17:15:24 -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
15def jdkDistro = '${jdkDistro}'
16
Kailash Khalasic323b1a2018-04-19 15:49:48 -070017node ('ubuntu16.04-basebuild-1c-2g') {
Luca Preteaee36ad2018-11-26 14:00:01 -080018 timeout (100) {
19 try {
Matteo Scandolo5729dae2019-03-14 14:25:41 -070020 stage ('Checkout code') {
Luca Preteaee36ad2018-11-26 14:00:01 -080021 checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
22 }
Matteo Scandolo5729dae2019-03-14 14:25:41 -070023 stage ('Build and Publish apps') {
Zack Williamsf173e4f2019-08-30 17:15:24 -070024
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 Preteaee36ad2018-11-26 14:00:01 -080031 configFileProvider([configFile(fileId: 'onoscord-apps', variable: 'MAVEN_SETTINGS')]) {
Matteo Scandolo5729dae2019-03-14 14:25:41 -070032 sh 'export _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true && cd onos-apps/apps && mvn -s $MAVEN_SETTINGS -e clean deploy'
Luca Preteaee36ad2018-11-26 14:00:01 -080033 }
34 }
35 currentBuild.result = 'SUCCESS'
36 } catch (err) {
37 currentBuild.result = 'FAILURE'
38 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
Kailash Khalasi8879d662018-04-20 13:37:05 -070039 }
Luca Preteaee36ad2018-11-26 14:00:01 -080040 echo "RESULT: ${currentBuild.result}"
41 }
alshabib3e488152016-10-06 11:42:36 -070042}