I use Jenkins Artifactory Plug-in for promotion. I try to create separate job to promote the artifact. Here the stage of promotion
stage('promote artifact') {
steps {
script {
String buildName = "${BUILD_NAME}"
String buildNumber = "${BUILD_NUMBER}"
def promotionConfig = [
//Mandatory parameters
'buildName' : buildName,
'buildNumber' : buildNumber,
'targetRepo' : "tst",
//Optional parameters
'comment' : "this is the promotion comment",
'sourceRepo' : "dev",
'status' : "Released",
'includeDependencies': true,
'failFast' : true,
'copy' : true
]
// Promote build
server.promote promotionConfig
}
}
}
As BUILD_NAME I try name of commit job and name of artifact at snapshot repository As BUILD_NUMBER I use number of build like 1 without version number like 1.0.0. But after all I got
Performing dry run promotion (no changes are made during dry run) ...
ERROR: Promotion failed during dry run (no change in Artifactory was done): HTTP/1.1 404 Not Found
{
"errors" : [ {
"status" : 404,
"message" : "Cannot find builds by the name 'artifact-name' and the number '1'."
} ]
}
Do you have some idea how to run it successfully? Or some flag to get more information about this error?