artifactory-user-plugins
artifactory-user-plugins copied to clipboard
Passing exclusion property values in archiveOldartifacts user plugin
Hi Team,
We have the below requirement.
We have branches repos with property key 'branch' with values '
So we need to exclude the archival for tags artifacts and archive only master branch artifacts alone. So could you please provide me the format for the above requirement. Note : tags artifacts property key 'branch' artifacts have values like 1.1 , 1.2, 1.3 etc
Please provide the Curl command for exclusion
curl -X POST -vvv -u username:password "https://xyz.com/artifactory/api/plugins/execute/archive_old_artifacts?params=srcRepo=SourceXYZ;ageDays=1;archiveRepo=XYZ-archive;excludePropertySet=branch=master,type=protected"
as well as the value to be set in the groovy file
"def excludePropertySet = params['excludePropertySet'] ? params['excludePropertySet'][0] as String : "
Thanks in advance!
Regards, Akilesh D S
I have tried below line in groovy file but it deletes all the repos in the srcRepo. def excludePropertySet = params['excludePropertySet'] ? params['excludePropertySet'][0] as String : 'type[:protected[;branch]]'
and through the command line we tried below lines, this also deletes all the repos in sourceRepo.
"https://xyz.com/artifactory/api/plugins/execute/archive_old_artifacts?params=srcRepo=SourceXYZ;ageDays=1;archiveRepo=XYZ-archive;excludePropertySet=branch:master;type=protected"
...........;excludePropertySet=branch=master;type=protected"
...........;excludePropertySet=branch:master,type=protected"
etc
But it deletes all the artifacts in the srcRepo.
Could you please provide a proper format for the deletion of feature branches?
Thanks in advance