Add deleteArtifact flag to artifac upload
Related-prod: PRODX-3226
Change-Id: Ic0b6941ff6687e042cbf10fd141c305c39052176
diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index b988183..c9556f0 100644
--- a/src/com/mirantis/mcp/MCPArtifactory.groovy
+++ b/src/com/mirantis/mcp/MCPArtifactory.groovy
@@ -415,6 +415,11 @@
def common = new com.mirantis.mk.Common()
def artifactsDescription = ''
def artifactoryServer
+
+ if (!config.containsKey('deleteArtifacts')) {
+ config.deleteArtifacts = true // default behavior before add the flag
+ }
+
try {
artifactoryServer = Artifactory.server(config.get('artifactory'))
} catch (Exception e) {
@@ -460,7 +465,9 @@
throw e
}
} finally {
- deleteDir()
+ if (config.deleteArtifacts) {
+ deleteDir()
+ }
}
}
return artifactsDescription