简体   繁体   中英

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

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).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM