blob: 1928e4cc63ebadd60a6e366cfda191c6105640c8 [file] [log] [blame]
Jakub Josefc5a223a2017-03-01 14:40:08 +01001def common = new com.mirantis.mk.Common()
2def gerrit = new com.mirantis.mk.Gerrit()
Filip Pytloun38005aa2017-03-06 10:26:38 +01003def ssh = new com.mirantis.mk.Ssh()
4def git = new com.mirantis.mk.Git()
Jakub Josefc5a223a2017-03-01 14:40:08 +01005
6node("python") {
7 try{
8 stage("checkout") {
9 gerrit.gerritPatchsetCheckout ([
10 credentialsId : CREDENTIALS_ID
11 ])
Filip Pytloun38005aa2017-03-06 10:26:38 +010012
13 if (fileExists('classes/system') {
14 ssh.prepareSshAgentKey(CREDENTIALS_ID)
15 dir('classes/system') {
16 remoteUrl = git.getGitRemote()
17 ssh.ensureKnownHosts(remoteUrl)
18 }
19 ssh.agentSh("git submodule init; git submodule sync; git submodule update --recursive")
20 }
Jakub Josefc5a223a2017-03-01 14:40:08 +010021 }
22 stage("test") {
23 wrap([$class: 'AnsiColorBuildWrapper']) {
24 sh("make test")
25 }
26 }
27 } catch (Throwable e) {
28 // If there was an error or exception thrown, the build failed
29 currentBuild.result = "FAILURE"
30 throw e
31 } finally {
32 common.sendNotification(currentBuild.result,"",["slack"])
33 }
Filip Pytloun38005aa2017-03-06 10:26:38 +010034}