Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 1 | def common = new com.mirantis.mk.Common() |
| 2 | def gerrit = new com.mirantis.mk.Gerrit() |
Filip Pytloun | 38005aa | 2017-03-06 10:26:38 +0100 | [diff] [blame^] | 3 | def ssh = new com.mirantis.mk.Ssh() |
| 4 | def git = new com.mirantis.mk.Git() |
Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 5 | |
| 6 | node("python") { |
| 7 | try{ |
| 8 | stage("checkout") { |
| 9 | gerrit.gerritPatchsetCheckout ([ |
| 10 | credentialsId : CREDENTIALS_ID |
| 11 | ]) |
Filip Pytloun | 38005aa | 2017-03-06 10:26:38 +0100 | [diff] [blame^] | 12 | |
| 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 Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 21 | } |
| 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 Pytloun | 38005aa | 2017-03-06 10:26:38 +0100 | [diff] [blame^] | 34 | } |