Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upload a file with metadata to jfrog artifactory with curl

I upload a file like this:

curl -u ${CREDS} --upload-file ${file} ${url}

Is there a way to add a body or headers that will set some metadata for the file? Like build number.

like image 620
Amir Mehler Avatar asked Aug 30 '25 17:08

Amir Mehler


2 Answers

You can actually deploy artifacts with properties to Artifactory OSS using matrix parameters, for example:

curl -uadmin:password -T file.tar "http://localhost:8081/artifactory/generic-local/file.tar;foo=bar;"

And get the artifact properties using REST API, for example:

curl -uadmin:password "http://localhost:8081/artifactory/api/storage/generic-local/file.tar?properties"

Viewing properties from the UI and other features are limited to the Pro edition.

like image 104
Dror Bereznitsky Avatar answered Sep 04 '25 01:09

Dror Bereznitsky


Seems this is a pro feature. Documentation: Set Item Properties

PUT /api/storage/{repoKey}{itemPath}?properties=p1=v1[,v2][|p2=v3][&recursive=1]

Not helping me :-/

like image 40
Amir Mehler Avatar answered Sep 04 '25 00:09

Amir Mehler