Artifactory seems to automatically generate properties for RPMs, Python wheels etc. Can I extend this function for my own file formats?
I've read the documentation and this talks about the REST API etc but I want to have Artifactory pull properties straight out of the file that I'm uploading.
None yet - I'm asking how.
The logic that automatically generates properties for RPMs etc is hardcoded into each package type Artifactory supports, and you can't add custom repository types.
What you can do is write a user plugin which runs whenever a file is uploaded, reads the file, and adds the appropriate properties. For example:
storage {
afterCreate { item ->
if (!item.isFolder() && item.name.endsWith(".customext")) {
def fstream = repositories.getContent(item.repoPath).inputStream
// read fstream and generate properties
repositories.setProperty(item.repoPath, propName, propVal)
}
}
}
Some notes: