blob: 9a5da58990c8a5a41ba99972277dbf071f743575 [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
chnyda5626fc92017-11-28 17:34:06 +010019def storages
20try {
21 storages = STORAGES.tokenize(',')
22} catch (MissingPropertyException e) {
23 storages = ['local']
24}
25
Jakub Josefc5a223a2017-03-01 14:40:08 +010026node() {
27 try{
28 stage("promote") {
29 lock("aptly-api") {
chnyda5626fc92017-11-28 17:34:06 +010030 for (storage in storages) {
31 aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY, '-d --timeout 600', DUMP_PUBLISH.toBoolean(), storage)
32 }
Jakub Josefc5a223a2017-03-01 14:40:08 +010033 }
34 }
35 } catch (Throwable e) {
36 // If there was an error or exception thrown, the build failed
37 currentBuild.result = "FAILURE"
Jakub Josefd2efd7d2017-08-22 17:49:57 +020038 currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
Jakub Josefc5a223a2017-03-01 14:40:08 +010039 throw e
40 } finally {
41 common.sendNotification(currentBuild.result,"",["slack"])
42 }
Jakub Josefd2efd7d2017-08-22 17:49:57 +020043}