blob: e5d974370c0e2e95932b6f6f8e3552c671f5dc84 [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"
Adam Tenglercac28de2017-08-22 15:52:00 +020029 currentBuild.description = e.message
Jakub Josefc5a223a2017-03-01 14:40:08 +010030 throw e
31 } finally {
32 common.sendNotification(currentBuild.result,"",["slack"])
33 }
34}