Fix uploadBinariesToArtifactory function
Change-Id: I51eac8b39d772dc84a6166f5d66c7e8f316afe41
diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index 8d76d8a..ad3cb82 100644
--- a/src/com/mirantis/mcp/MCPArtifactory.groovy
+++ b/src/com/mirantis/mcp/MCPArtifactory.groovy
@@ -1,5 +1,8 @@
package com.mirantis.mcp
+import org.jfrog.hudson.pipeline.types.ArtifactoryServer
+import org.jfrog.hudson.pipeline.types.buildInfo.BuildInfo
+
/**
* Return string of mandatory build properties for binaries
* User can also add some custom properties.
@@ -177,8 +180,8 @@
* uploaded or downloaded and the target path
* @param publishInfo Boolean, whether publish a build-info object to Artifactory
*/
-def uploadBinariesToArtifactory(uploadSpec, buildInfo, publishInfo=false) {
- def server = Artifactory.server('mcp-ci')
+def uploadBinariesToArtifactory (ArtifactoryServer server, BuildInfo buildInfo, String uploadSpec,
+ Boolean publishInfo = false) {
buildInfo.append(server.upload(uploadSpec))
if ( publishInfo ) {
@@ -187,7 +190,6 @@
buildInfo.env.filter.addExclude("*PASSWORD*")
buildInfo.env.filter.addExclude("*password*")
buildInfo.env.collect()
-
server.publishBuildInfo(buildInfo)
}
}