blob: 31390b019c4c183b6fa7bef1ecb955caaac28507 [file] [log] [blame]
def common = new com.mirantis.mk.Common()
def aptly = new com.mirantis.mk.Aptly()
def packages
try {
packages = PACKAGES
} catch (MissingPropertyException e) {
packages = ""
}
def components
try {
components = COMPONENTS
} catch (MissingPropertyException e) {
components = ""
}
def storages
try {
storages = STORAGES.tokenize(',')
} catch (MissingPropertyException e) {
storages = ['local']
}
timeout(time: 12, unit: 'HOURS') {
node() {
try{
stage("promote") {
lock("aptly-api") {
for (storage in storages) {
if (storage == "local") {
storage = ""
}
aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY, '-d --timeout 600', DUMP_PUBLISH.toBoolean(), storage)
}
}
}
} catch (Throwable e) {
// If there was an error or exception thrown, the build failed
currentBuild.result = "FAILURE"
currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
throw e
} finally {
common.sendNotification(currentBuild.result,"",["slack"])
def _extra_descr = "${SOURCE}=>${TARGET}:\n${COMPONENTS} ${packages}"
currentBuild.description = currentBuild.description ? _extra_descr + " " + currentBuild.description : _extra_descr
}
}
}