blob: 00d41b80f9a3a8d1b8ec93f563ab15b6d505b285 [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"
29 throw e
30 } finally {
31 common.sendNotification(currentBuild.result,"",["slack"])
32 }
33}