3
votes

I'm trying to set up a step to archive artifacts and I want to archive everything however specifying * does not work. Jenkins comes up with ‘*’ doesn’t match anything

if I run the job regardless the job fails and logs show: ERROR: No artifacts found that match the file pattern "". Configuration error? ERROR: ‘’ doesn’t match anything

I tried using ** too but that came back with the same errors

3
Refer to issues.jenkins-ci.org/browse/JENKINS-17351 It states that artifacts outside the workspace cannot be archived - salsinga

3 Answers

6
votes

Here is what to check for:

  • archive artifacts will only work in the workspace and fails outside

  • the path should be a relative path in the workspace and doesnt start with "." :

    archiveArtifacts artifacts: "build/**"
    archiveArtifacts artifacts: "./build/**"   // Fails
    archiveArtifacts artifacts: "$workspace/build/**"    // Fails
    
  • " *" matches any file in the directory, ** will match everything including dir and subdirectories, **/.log will matches all files in all subdirectories with potfix

  • depending on if it s a windows or linux node, you will want to express your path differently

4
votes

* only matches any files in workspace, if the artifacts you want to archive is in some subdirectories, you need the pattern like **/*.sh to match all files in all subdirectories with postfix .sh.

4
votes

If you run Jenkins on Windows host, you must use *.* for everything