I see multiple usages of unarchive
in the tutorial of the Jenkins workflow plugin.
But I'm not able to find any documentation about its syntax and options.
2 Answers
There is a usage blurb in the snippet generator:
May take a
mapping
parameter which is a map from artifact names (files, directories ending in/
, or any other Ant patternsets), to workspace destination names.For example to copy one file:
unarchive mapping: ['target/my.war': 'here.war']
To copy a whole directory:
unarchive mapping: ['dir/' : '.']
-
It would be useful to provide some version context as well, "As of v1.X of the Workflow plugin..." Apr 20, 2015 at 15:55
-
thanks, with that I also found why I was not able to see find the step in the Snippet generator - the name is just so different from what I have expected. github.com/jenkinsci/workflow-plugin/blob/…– domiApr 20, 2015 at 15:59
-
Step titles definitely need to be reviewed in batch. Have not gotten to it yet. Apr 21, 2015 at 16:43
-
Note that the snippet generator now just shows the step names, rather than the descriptions. Apr 11, 2018 at 19:13
As of 1.10 this step is deprecated. You should now use stash
and unstash
, which have a simpler syntax.
-
20What if you want to create a permanent archive after a build step but before a deploy step. Wouldn't it better to use 'archive/unarchive' for that, since the "stash" is removed at the end up the pipeline? Nov 11, 2016 at 20:20
-
5Or to access files from a previous build for comparison. [un]stash satisfies a common usage for [un]archive, but not persistence or sharing files between jobs. Jan 23, 2018 at 13:47
-
-
I want to retrieve an archived build from a previous run, as i may not have created the item i need in the current run. I can't do that with [un]stash. [un]archive was there for that purpose. Why was it deprecated? Mar 3, 2020 at 20:19
-
1Answering my own comment from above, the right command would be
copyArtifact
. Mar 6, 2020 at 16:26