blob: eb10f400e327dac382d0bfb0d62f5343f18cb724 [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") {
Ruslan Kamaldinov310ffc02017-08-08 16:07:42 +040023 aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY)
Jakub Josefc5a223a2017-03-01 14:40:08 +010024 }
25 }
26 } catch (Throwable e) {
27 // If there was an error or exception thrown, the build failed
28 currentBuild.result = "FAILURE"
Jakub Josefd2efd7d2017-08-22 17:49:57 +020029 currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
Jakub Josefc5a223a2017-03-01 14:40:08 +010030 throw e
31 } finally {
32 common.sendNotification(currentBuild.result,"",["slack"])
33 }
Jakub Josefd2efd7d2017-08-22 17:49:57 +020034}