artifactory-user-plugins icon indicating copy to clipboard operation
artifactory-user-plugins copied to clipboard

Passing exclusion property values in archiveOldartifacts user plugin

Open dsakilesh opened this issue 5 years ago • 1 comments

Hi Team,

We have the below requirement.

We have branches repos with property key 'branch' with values '' We have master repos with property key 'branch' with values 'master' and "type=protected" We have tags repos with property key 'branch' with values '1.1' and "type=protected"

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

dsakilesh avatar Feb 13 '20 12:02 dsakilesh

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

dsakilesh avatar Feb 14 '20 06:02 dsakilesh