Search code examples
jenkinsartifactoryrpm-spec

Add property to folder


I have a spec file in Jenkins uploading artifacts to Artifactory repository path test-local/web/develop/web-DEVELOP-12/ where 12 is the build number from Jenkins.

All artifacts are uploaded under web-DEVELOP-XX. I would like this folder to have the same properties as the artifacts such as vcs.revision, build.timestamp, build.name, build.number. Here I only get those properties in the artifact files under web-DEVELOP-XX folder, but I would like to also have those properties to the folder web-DEVELOP-XX.

Is it possible to do this from Jenkins?


Solution

  • you're correct that currently Properties set using a file spec are not set on the root folder. you can add (at the end of your current set props) a simple curl command to set the properties on the folder. For ex, this will set a property a=b on "all-my-frogs" folder under my-local-repo repository:

    PUT http://rtserver:port/artifactory/api/storage/my-local-repo/all-my-frogs?properties=a=b&recursive=0
    

    note: recursive=1 will set the properties on all files under the folder as well as the folder itself, so you can consider that as your solution (instead of spec)