Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No files included in stash exception

I am using stash command in groovy script. I am getting:

Caught: hudson.AbortException: No files included in stash

However the logs before the exception says:

Stashed 1 file(s)
[Pipeline] stash
Stashed 1 file(s)

can you please advise

like image 587
Ashok Simson Avatar asked Mar 03 '17 06:03

Ashok Simson


2 Answers

I'm guessing based on your log you're doing more than one stash, perhaps you do have one that doesn't have any files, in that case you need allowEmpty: true

stash allowEmpty: true, includes: 'foo', name: 'bar'
like image 90
Glen Avatar answered Oct 17 '22 03:10

Glen


I had this problem. I was making a mistake by specifying multiple files by name without comma separator. Correct way is:

stash includes: "a.bin,a.log", name: "<name>"

Please use "Pipeline Syntax" link to generate command and read description of fields you want to use.

like image 1
Mohammad Azim Avatar answered Oct 17 '22 03:10

Mohammad Azim