简体   繁体   中英

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.

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.

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 :-/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM