1
votes

We are using the "Generic-Artifactory Integration" (with legacy pattern) in our Jenkins jobs to upload artifacts.

Is it somehow possible to upload the artifacts even if the build fails?

I don't seem to find an option on the configuration page (Freestyle build).

1

1 Answers

1
votes

It isn't a good practice to upload an artifact if your build fail. I recomend you to create a new pipeline or to edit your actual pipeline.

If your artifact is building sucessfully but your pipeline if failing you can upload it using Jfrog Cli with this command in your pipeline code:

For packed (jar, zip...) artifact:

jfrog rt upload "JENKINS_PATH_TO_YOUR_ARTIFACT/*" YOUR_ARTIFACTORY_REPO/

For unzip or unpacked artifact:

jfrog rt upload --flat=false "JENKINS_PATH_TO_YOUR_ARTIFACT/*" YOUR_ARTIFACTORY_REPO/

Check Jfrog Cli manual: Jfrog Cli

Check my post with similar task using Bamboo: Upload artifact to Jfrog Artifactory using Jfrog CLI