Kailash | 94ff809 | 2019-02-13 10:56:42 -0800 | [diff] [blame] | 1 | // 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 | |
| 13 | repos = params.repos.split(",") |
| 14 | |
| 15 | node ("${TestNodeName}") { |
| 16 | timeout (100) { |
| 17 | try { |
| 18 | stage ("Cleanup") { |
| 19 | sh returnStdout: true, script: "rm -rf *" |
| 20 | } |
Kailash | 94ff809 | 2019-02-13 10:56:42 -0800 | [diff] [blame] | 21 | 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 | |
| 35 | def checkRepo(repo) { |
Luca Prete | e1e14ab | 2019-02-14 09:50:54 -0800 | [diff] [blame] | 36 | 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 |
Kailash | 94ff809 | 2019-02-13 10:56:42 -0800 | [diff] [blame] | 40 | git clone -b ${branch} git@github.com:omec-project/${repo}.git |
Luca Prete | e1e14ab | 2019-02-14 09:50:54 -0800 | [diff] [blame] | 41 | """ |
| 42 | } |
Kailash | 94ff809 | 2019-02-13 10:56:42 -0800 | [diff] [blame] | 43 | hub_detect("--detect.source.path=${repo} --detect.project.name=${prefix}-${repo} --detect.project.version.name=${branch} --snippet-matching --full-snippet-scan") |
| 44 | } |