Jenkinsfile archive step: allow missing artifacts
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: trueFind the complete documentation of this command at
2