| Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 1 | def common = new com.mirantis.mk.Common() | 
|  | 2 | def aptly = new com.mirantis.mk.Aptly() | 
| chnyda | 6a3553e | 2017-03-21 13:20:15 +0100 | [diff] [blame] | 3 |  | 
|  | 4 |  | 
|  | 5 | def packages | 
|  | 6 | try { | 
|  | 7 | packages = PACKAGES | 
|  | 8 | } catch (MissingPropertyException e) { | 
|  | 9 | packages = "" | 
|  | 10 | } | 
|  | 11 |  | 
|  | 12 | def components | 
|  | 13 | try { | 
|  | 14 | components = COMPONENTS | 
|  | 15 | } catch (MissingPropertyException e) { | 
|  | 16 | components = "" | 
|  | 17 | } | 
|  | 18 |  | 
| Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 19 | node() { | 
|  | 20 | try{ | 
|  | 21 | stage("promote") { | 
|  | 22 | lock("aptly-api") { | 
|  | 23 | wrap([$class: 'AnsiColorBuildWrapper']) { | 
| chnyda | 6a3553e | 2017-03-21 13:20:15 +0100 | [diff] [blame] | 24 | aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY) | 
| Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 25 | } | 
|  | 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 | } |