如何使用curl将包含元数据的文件上传到jfrog artifactory

时间:2021-09-20 07:00:14

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.

有没有办法添加一个或多个将为文件设置元数据的标题?喜欢内部版本号。

2 个解决方案

#1


3  

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

您实际上可以使用矩阵参数将具有属性的工件部署到Artifactory OSS,例如:

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:

并使用REST API获取工件属性,例如:

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.

从UI和其他功能查看属性仅限于专业版。

#2


0  

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

没有帮助我: - /

#1


3  

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

您实际上可以使用矩阵参数将具有属性的工件部署到Artifactory OSS,例如:

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:

并使用REST API获取工件属性,例如:

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.

从UI和其他功能查看属性仅限于专业版。

#2


0  

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

没有帮助我: - /