Jenkins packagecloud插件-如果.deb包已经存在,则上传失败 [英] Jenkins packagecloud plugin - upload of a package ex .deb failed if it already exist

查看:172
本文介绍了Jenkins packagecloud插件-如果.deb包已经存在,则上传失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用:

Jenkins: 2.7.2

PackageCloud插件: 1.11

使用Jenkins PackageCloud插件将工件上传到PackageCloud. /p>

我的Jenkins作业创建了一个.deb包wfcli_5.0.10-2_amd64.deb,使用此插件,我可以成功地将工件上传到我创建的私有PackageCloud存储库中.

如果我重新运行该作业,它将创建相同的包.deb文件名,并尝试将工件上传到PackageCloud,并显示以下消息,并将构建标记为失败.

19:07:07 2017-02-27T19:07:07.812+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] wfcli_5.0.10-2_amd64.deb: Sent 118303133 bytes
19:07:07 2017-02-27T19:07:07.812+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] wfcli_5.0.10-2_amd64.deb: Sent 118303135 bytes
19:07:16 2017-02-27T19:07:16.081+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] ERROR  HTTP/1.1 422 Unprocessable Entity:
19:07:16 {"filename":["has already been taken"]}
19:07:16 2017-02-27T19:07:16.081+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] Done
19:07:16 Build step 'Push to packagecloud.io' changed build result to FAILURE
19:07:16 Finished: FAILURE

如何解决此问题.如果此插件中有一个选项可以忽略此错误,并且不要将构建标记为失败/使用新的时间戳覆盖包文件,则将是很好的.如果我要构建的工件已经存在于PackageCloud中,我不想先从PackageCloud中检查/删除工件.我也不能为包创建唯一的文件名,因为如果我为相同版本的软件包遵循命名标准的情况下有多个软件包,则apt-get不会喜欢它.

相关POST: Jenkins PackageCloud上传-缺少工件-指纹-没有此类文件或目录

解决方案

jenkins/packagecloud插件作者在这里-

感谢您的反馈!我们的后端不支持任何形式的包覆盖,但是我们的命令行客户端具有--skip-errors标志,该标志将忽略任何错误并继续上载作为参数给出的所有有效软件包.

我创建了一个内部票证将此功能添加到jenkins插件.但是,在更新之前,我建议暂时将命令行客户端与--skip-errors标志一起使用.

Using:

Jenkins: 2.7.2

PackageCloud Plugin: 1.11

Uploading an artifact to PackageCloud using Jenkins PackageCloud Plugin.

My Jenkins job created a .deb package wfcli_5.0.10-2_amd64.deb and using this plugin, I'm successfully able to upload an artifact to my private PackageCloud repository that I created.

If I rerun the job, it creates the same package .deb filename and tries to upload the artifact to PackageCloud and giving me the following message and marking the build as failed.

19:07:07 2017-02-27T19:07:07.812+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] wfcli_5.0.10-2_amd64.deb: Sent 118303133 bytes
19:07:07 2017-02-27T19:07:07.812+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] wfcli_5.0.10-2_amd64.deb: Sent 118303135 bytes
19:07:16 2017-02-27T19:07:16.081+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] ERROR  HTTP/1.1 422 Unprocessable Entity:
19:07:16 {"filename":["has already been taken"]}
19:07:16 2017-02-27T19:07:16.081+0000 [org.jenkinsci.plugins.packagecloud.ArtifactPublisher] Done
19:07:16 Build step 'Push to packagecloud.io' changed build result to FAILURE
19:07:16 Finished: FAILURE

How can I fix this issue. It would be good if there's an option within this plugin to IGNORE this error and don't mark the build as failed / OVERWRITE the package file with the new timestamp. I don't want to check/remove the artifact first from PackageCloud if the one I'm building already exist in PackageCloud. I also can't create unique filename for package as then apt-get won't like it if I have more than 1 package for the same version as it follows a naming standard.

Related POST: Jenkins PackageCloud upload - Missing artifact - fingerprint - No such file or directory

解决方案

jenkins/packagecloud plugin author here --

Thanks for this feedback! Our backend does not support any kind of overwriting of packages, but our command line client has a --skip-errors flag that will ignore any errors and continue uploading all valid packages given as arguments.

I've created an internal ticket to add this feature to the jenkins plugin. However, until that is updated, I recommend using the command line client with the --skip-errors flag for now.

这篇关于Jenkins packagecloud插件-如果.deb包已经存在,则上传失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆