blob: 4b75770b0f05ffa82efd5a2ccc1ab96b3102365b [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 }
21 stage ("Add private keys") {
22 withCredentials([sshUserPrivateKey(credentialsId: '315e1f56-7193-464e-8af1-97bf7b1ee541', keyFileVariable: 'KEY')]) {
23 sh returnStdout: true, script: """
24 chmod 600 $KEY && eval `ssh-agent -s` && ssh-add $KEY &&
25 ssh-keyscan github.com >> ~/.ssh/known_hosts
26 """
27 }
28 }
29 for(int i=0; i < repos.size(); i++) {
30 stage ("Check repos ${repos[i]}") {
31 checkRepo(repos[i])
32 }
33 }
34 currentBuild.result = 'SUCCESS'
35 } catch (err) {
36 currentBuild.result = 'FAILURE'
37 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
38 }
39 echo "RESULT: ${currentBuild.result}"
40 }
41}
42
43def checkRepo(repo) {
44 sh returnStdout: true, script: """
45 git clone -b ${branch} git@github.com:omec-project/${repo}.git
46 """
47 hub_detect("--detect.source.path=${repo} --detect.project.name=${prefix}-${repo} --detect.project.version.name=${branch} --snippet-matching --full-snippet-scan")
48}
49
50