Jenkins packagecloud plugin - upload of a package ex .deb failed if it already exist

蓝咒 提交于 2019-12-25 07:46:24

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/42494099/jenkins-packagecloud-plugin-upload-of-a-package-ex-deb-failed-if-it-already-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!