Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Jenkinsfile archive step: allow missing artifacts

Writer Sophia Terry

Under the regular UI defined jobs I can select "Do not fail build if archiving returns nothing". How do I achieve the equivalent in pipeline code?

E.g. currently I have something along these lines:

archive 'screenshots/**', 'build/test/results/*.xml'

and it is OK if there are no screenshots since there would be none if all tests pass.

1 Answer

Use the new archiveArtifacts command, like this:

archiveArtifacts artifacts: 'screenshots/**,build/test/results/*.xml', allowEmptyArchive: true

Find the complete documentation of this command at

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy