blob: cc8c9030327e3437e2fd357e6ead6941ca57ff79 [file] [log] [blame]
Kailash Khalasi8e12ccd2018-09-27 13:20:25 -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
15repos = params.repos.split(",")
Kailash Khalasif7608a62018-10-11 09:00:30 -070016echo repos[0]
Kailash Khalasi8e12ccd2018-09-27 13:20:25 -070017
18node ("${TestNodeName}") {
19 timeout (100) {
20 try {
21 stage ("Cleanup") {
22 sh returnStdout: true, script: "rm -rf *"
23 }
24 stage ("Check repositories") {
Kailash Khalasif7608a62018-10-11 09:00:30 -070025
26 for(int i=0; i < repos.size(); i++) {
27 checkRepo(repos[i])
28 }
Kailash Khalasi8e12ccd2018-09-27 13:20:25 -070029 }
30 currentBuild.result = 'SUCCESS'
31 } catch (err) {
32 currentBuild.result = 'FAILURE'
33 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
34 }
35 echo "RESULT: ${currentBuild.result}"
36 }
37}
38
39def checkRepo(repo) {
Kailash Khalasi8e12ccd2018-09-27 13:20:25 -070040 withCredentials([sshUserPrivateKey(credentialsId: '315e1f56-7193-464e-8af1-97bf7b1ee541', keyFileVariable: 'KEY')]) {
41 sh returnStdout: true, script: """
42 chmod 600 $KEY && eval `ssh-agent -s` && ssh-add $KEY &&
43 ssh-keyscan -p 29418 gerrit.opencord.org >> ~/.ssh/known_hosts &&
44 git clone -b ${branch} ssh://mcord-private@gerrit.opencord.org:29418/${repo}
45 """
46 }
Kailash Khalasif7608a62018-10-11 09:00:30 -070047 hub_detect("--detect.source.path=${repo} --detect.project.name=${prefix}-${repo} --detect.project.version.name=${branch} --snippet-matching --full-snippet-scan")
Kailash Khalasi8e12ccd2018-09-27 13:20:25 -070048}