How to restore artifacts in Jenkins multibranch job?

48 views
Skip to first unread message

Yevhenii Kurtov

unread,
Jan 27, 2017, 9:54:33 PM1/27/17
to Jenkins Users
Hello,

my goal is to copy compiler artifacts and fetched dependencies between builds of all branches to speed up the execution time. 

I wrote two steps in Jenkinsfile to save and restore artifacts:


def buildCache    = 'packages-deps.tgz'
//...
stage
('Restore cache') {
  unarchive mapping
: [(buildCache): buildCache]
  sh
"[ -a ${buildCache}  ] && tar xf ${buildCache}"
}


stage
('Cache development libraries') {
  sh
'tar czf packages-deps.tgz _build node_modules deps'
  archiveArtifacts buildCache
}

It's 100% that artifacts was built and stored: I can see relevant messages in the build log


+ tar czf packages-deps.tgz _build node_modules deps
[Pipeline] step
Archiving artifacts


And file itself in the branch build index page http://d.pr/i/AHBE.jpg


But the "Restore cache" step is failing with the following error: hudson.AbortException: no artifacts to unarchive in packages-deps.tgz

I even tried wildcard unarchive mapping: ['**/.*': '.'] but that yielded the same result: hudson.AbortException: no artifacts to unarchive in **/.*

Reply all
Reply to author
Forward
0 new messages