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 build 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 **/.*
Update: my goal is to copy compiler artifacts and fetched dependencies from build to build to speed up the execution time. For builds of all branches. We are using only one node so far.