| 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") { | 
| Ruslan Kamaldinov | 310ffc0 | 2017-08-08 16:07:42 +0400 | [diff] [blame] | 23 | aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY) | 
| Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 24 | } | 
|  | 25 | } | 
|  | 26 | } catch (Throwable e) { | 
|  | 27 | // If there was an error or exception thrown, the build failed | 
|  | 28 | currentBuild.result = "FAILURE" | 
| Jakub Josef | d2efd7d | 2017-08-22 17:49:57 +0200 | [diff] [blame] | 29 | currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message | 
| Jakub Josef | c5a223a | 2017-03-01 14:40:08 +0100 | [diff] [blame] | 30 | throw e | 
|  | 31 | } finally { | 
|  | 32 | common.sendNotification(currentBuild.result,"",["slack"]) | 
|  | 33 | } | 
| Jakub Josef | d2efd7d | 2017-08-22 17:49:57 +0200 | [diff] [blame] | 34 | } |