jdoe
jdoe

Reputation: 201

jenkins - archive artifacts ‘*’ doesn’t match anything

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

Upvotes: 8

Views: 31854

Answers (3)

erudash
erudash

Reputation: 123

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

Upvotes: 12

riverfall
riverfall

Reputation: 840

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

Upvotes: 5

shizhz
shizhz

Reputation: 12531

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

Upvotes: 4

Related Questions