blob: 0058ef33c19032e07a9f3f37faec9667679ee56c [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
Filip Pytlounb1037a62017-03-06 11:27:13 +010013 if (fileExists('classes/system')) {
Filip Pytloun38005aa2017-03-06 10:26:38 +010014 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") {
Filip Pytloun3f3829d2017-03-06 12:13:14 +010023 timeout(10800) {
24 wrap([$class: 'AnsiColorBuildWrapper']) {
25 sh("make test")
26 }
Jakub Josefc5a223a2017-03-01 14:40:08 +010027 }
28 }
29 } catch (Throwable e) {
30 // If there was an error or exception thrown, the build failed
31 currentBuild.result = "FAILURE"
32 throw e
33 } finally {
34 common.sendNotification(currentBuild.result,"",["slack"])
35 }
Filip Pytloun38005aa2017-03-06 10:26:38 +010036}