blob: 7c1cd427be44f1229f6cfa856834fdbc9abc6ea5 [file] [log] [blame]
Jakub Josefc5a223a2017-03-01 14:40:08 +01001def common = new com.mirantis.mk.Common()
2def aptly = new com.mirantis.mk.Aptly()
chnyda6a3553e2017-03-21 13:20:15 +01003
4
5def packages
6try {
7 packages = PACKAGES
8} catch (MissingPropertyException e) {
9 packages = ""
10}
11
12def components
13try {
14 components = COMPONENTS
15} catch (MissingPropertyException e) {
16 components = ""
17}
18
Jakub Josefc5a223a2017-03-01 14:40:08 +010019node() {
20 try{
21 stage("promote") {
22 lock("aptly-api") {
23 wrap([$class: 'AnsiColorBuildWrapper']) {
chnyda6a3553e2017-03-21 13:20:15 +010024 aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY)
Jakub Josefc5a223a2017-03-01 14:40:08 +010025 }
26 }
27 }
28 } catch (Throwable e) {
29 // If there was an error or exception thrown, the build failed
30 currentBuild.result = "FAILURE"
31 throw e
32 } finally {
33 common.sendNotification(currentBuild.result,"",["slack"])
34 }
35}