使用API​​的Bintray Debian存储库创建和上传文件

时间:2017-08-04 22:47:34

标签: curl debian bintray

我按照以下步骤和答案进行操作 Debian repository on Bintray multiple errors and unexpected behavior

但是,我的Bintray Debian文件上传尝试仍然失败了:

{"message":"Unable to upload files: Debian distribution, component and architecture were not found on repo and were not specified"}

这是我的curl命令:

curl -T libterm-screencolor-perl_1.09-1_all.deb -umyid:mybintraykey https://api.bintray.com/content/myid/myrepo/libterm-screencolor-perl/1.09-1/pool/main/l/libterm-screencolor-perl_1.09-1_all.deb;deb_distribution=all;deb_component=main;deb_architecture=i386,amd64;override=1

基本上我得到了完全相同的错误 Debian repository on Bintray multiple errors and unexpected behavior 出于同样的原因。

所以我决定从头开始,首先创建Bintray Debian存储库,via API。 这是我的代码:

curl -umyid:mybintraykey https://api.bintray.com/repos/myid/deb -d '{"name":"deb","type":"debian","default_debian_architecture":"amd64","default_debian_distribution":"all","default_debian_component":"main","private":false,"desc":"This repo...","business_unit":"businessUnit1","labels":["label1","label2"],"gpg_sign_metadata":false,"gpg_sign_files":false,"gpg_use_owner_key":false}'

我没有错误,但也没有回应。当我从Bintray Web UI检查时,未创建存储库。尝试向JSON添加"version_update_max_days" : 60也无济于事。

出了什么问题?

1 个答案:

答案 0 :(得分:5)

上传文件:
您的curl命令需要引号,请参阅此answer

创建存储库:
您的curl命令缺少媒体类型,在这种情况下应为-H "Content-Type: application/json"。以详细模式curl

运行-v命令总是好的

以下是curl命令的外观:

curl -umyid:mybintraykey https://api.bintray.com/repos/myid/deb -H "Content-Type: application/json" -d '{"name":"deb","type":"debian","default_debian_architecture":"amd64","default_debian_distribution":"all","default_debian_component":"main","private":false,"desc":"This repo...","business_unit":"businessUnit1","labels":["label1","label2"],"gpg_sign_metadata":false,"gpg_sign_files":false,"gpg_use_owner_key":false}' -v