blob: 9c098ed805de299d4e427662c708757af4edacbb [file] [log] [blame]
Kailash94ff8092019-02-13 10:56:42 -08001// Licensed under the Apache License, Version 2.0 (the "License");
2// you may not use this file except in compliance with the License.
3// You may obtain a copy of the License at
4//
5// http://www.apache.org/licenses/LICENSE-2.0
6//
7// Unless required by applicable law or agreed to in writing, software
8// distributed under the License is distributed on an "AS IS" BASIS,
9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10// See the License for the specific language governing permissions and
11// limitations under the License.
12
13repos = params.repos.split(",")
14
15node ("${TestNodeName}") {
16 timeout (100) {
17 try {
18 stage ("Cleanup") {
19 sh returnStdout: true, script: "rm -rf *"
20 }
Kailash94ff8092019-02-13 10:56:42 -080021 for(int i=0; i < repos.size(); i++) {
22 stage ("Check repos ${repos[i]}") {
23 checkRepo(repos[i])
24 }
25 }
26 currentBuild.result = 'SUCCESS'
27 } catch (err) {
28 currentBuild.result = 'FAILURE'
29 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
30 }
31 echo "RESULT: ${currentBuild.result}"
32 }
33}
34
35def checkRepo(repo) {
Luca Pretee1e14ab2019-02-14 09:50:54 -080036 withCredentials([sshUserPrivateKey(credentialsId: '315e1f56-7193-464e-8af1-97bf7b1ee541', keyFileVariable: 'KEY')]) {
37 sh returnStdout: true, script: """
38 chmod 600 $KEY && eval `ssh-agent -s` && ssh-add $KEY &&
39 ssh-keyscan github.com >> ~/.ssh/known_hosts
Kailash94ff8092019-02-13 10:56:42 -080040 git clone -b ${branch} git@github.com:omec-project/${repo}.git
Luca Pretee1e14ab2019-02-14 09:50:54 -080041 """
42 }
Kailash94ff8092019-02-13 10:56:42 -080043 hub_detect("--detect.source.path=${repo} --detect.project.name=${prefix}-${repo} --detect.project.version.name=${branch} --snippet-matching --full-snippet-scan")
44}