-
Bug
-
Resolution: Unresolved
-
Minor
-
None
It appears that the zip step prepends an absolute path to the zip file name when trying to upload, resulting in an error if you passed in an absolute path.
In scripted jenkinsfile:
zip zipFile: "${WORKSPACE}/my.zip", archive: true, dir: "${WORKSPACE}/some/dir"
Console output:
... [Pipeline] zip Writing zip file of /var/build/workspace/job_branch-123random123/some/dir to /var/build/workspace/job_branch-123random123/my.zip Zipped 7 entries. Archiving /var/build/workspace/job_branch-123random123/my.zip Retrying upload after: java.io.FileNotFoundException: /var/build/workspace/job_branch-123random123/var/build/workspace/job_branch-123random123/my.zip (No such file or directory) ### Retry repeats many times ### Retrying upload after: java.io.FileNotFoundException: /var/build/workspace/job_branch-123random123/var/build/workspace/job_branch-123random123/my.zip (No such file or directory) Aborted by User Name [Pipeline] } ...
I just stumbled over this as well, but in the meantime the problem has changed:
The culprit code seems to be that:
Leads to this build log:
and only "relative-hello.zip" is archived, but NOT "absolute-hello.zip"!
(Update: Fix groovy syntax for gstring interpolation)