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