Switch MCPArtifactoy.moveItem() function to use doPost() instead for curl
And now it returns result of request to artifactory API
Related-To: PRODX-10445
Change-Id: I930d0c478e344ad39df4d2cd3ccd2e9d83f037be
diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index 272b1bc..1cdb315 100644
--- a/src/com/mirantis/mcp/MCPArtifactory.groovy
+++ b/src/com/mirantis/mcp/MCPArtifactory.groovy
@@ -139,14 +139,8 @@
*/
def moveItem (String artifactoryURL, String sourcePath, String dstPath, boolean copy = false, boolean dryRun = false) {
def url = "${artifactoryURL}/api/${copy ? 'copy' : 'move'}/${sourcePath}?to=/${dstPath}&dry=${dryRun ? '1' : '0'}"
- withCredentials([
- [$class : 'UsernamePasswordMultiBinding',
- credentialsId : 'artifactory',
- passwordVariable: 'ARTIFACTORY_PASSWORD',
- usernameVariable: 'ARTIFACTORY_LOGIN']
- ]) {
- sh "bash -c \"curl -X POST -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} \'${url}\'\""
- }
+ def http = new com.mirantis.mk.Http()
+ return http.doPost(url, 'artifactory')
}
/**