Make uploadJobArtifactsToArtifactory more universal
Related-prod: PRODX-3226
Change-Id: I4207afcaa03e4f69395f8aa6b5be3e06f43b197d
diff --git a/src/com/mirantis/mcp/MCPArtifactory.groovy b/src/com/mirantis/mcp/MCPArtifactory.groovy
index 6f3780a..b988183 100644
--- a/src/com/mirantis/mcp/MCPArtifactory.groovy
+++ b/src/com/mirantis/mcp/MCPArtifactory.groovy
@@ -425,7 +425,7 @@
return "Artifactory server is not found. Can't save artifacts in Artifactory."
}
}
- def artifactDir = 'cur_build_artifacts'
+ def artifactDir = config.get('artifactDir') ?: 'cur_build_artifacts'
def user = ''
wrap([$class: 'BuildUser']) {
user = env.BUILD_USER_ID
@@ -435,13 +435,14 @@
unarchive(mapping: ['**/*' : '.'])
// Mandatory and additional properties
def properties = getBinaryBuildProperties(config.get('buildProps', []) << "buildUser=${user}")
+ def pattern = config.get('artifactPattern') ?: '*'
// Build Artifactory spec object
def uploadSpec = """{
"files":
[
{
- "pattern": "*",
+ "pattern": "${pattern}",
"target": "${config.get('artifactoryRepo')}/",
"flat": false,
"props": "${properties}"