Multiple `archiveArtifacts` commands in one Jenkins pipeline

896 views
Skip to first unread message

László Boros

unread,
Feb 13, 2019, 8:03:02 AM2/13/19
to jenkins...@googlegroups.com
Hi everyone!

We are facing some issues with our main Jenkins pipeline. It consists of multiple stages which are executed on different machines, and each stage can produce artifacts. We are trying to archive these all by calling the `archiveArtifacts` pipeline command after each stage, but it seems these calls are not playing well together, since each time it runs the previous artifacts (from the previous stage) are removed and as a consequence only the last stage has its artifacts archived, no matter which stage it is.
Is there a way to merge the results and disable the directory clearing when calling `archiveArtifacts`? We tried to use the deprecated `latestOnly` boolean parameter as well, but it did not work.

Thanks in advance!
Laci

László Boros

unread,
Feb 15, 2019, 8:01:33 AM2/15/19
to jenkins...@googlegroups.com
Anyone with a similar issue? I'd really appreciate any tip.

Thanks!
Laci

Adrien Lecharpentier

unread,
Feb 15, 2019, 8:48:46 AM2/15/19
to Jenkins Users
as a workaround, you could try to `stash` the binaries and `unstash` them all in the same node and archive them then. 

But for your problem, it's the first time I see this. Sorry.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/F826533E-4B3A-40D5-9FC9-494D9BE4293F%40skyscanner.net.
For more options, visit https://groups.google.com/d/optout.


--
Adrien Lecharpentier

Arnaud bourree

unread,
Feb 15, 2019, 9:35:10 AM2/15/19
to jenkins...@googlegroups.com
Hi,

I've "archiveArtifact" located in many stages in one single pipeline and that works for me on 2.150.2

Arnaud

Le ven. 15 févr. 2019 à 14:01, László Boros <laszlo...@skyscanner.net> a écrit :
--

László Boros

unread,
Feb 15, 2019, 12:33:49 PM2/15/19
to 'Kay J' via Jenkins Users
Yeah, we thought about that, but I'm not sure how stashing would work for parallel running stages, also we would want to minimize network traffic between the nodes. 

Right now I'm investigating where the artifacts are stored and hacking something in shell that could merge the results from different stages.

(AFAIK the artifacts themselves are stored on the master in the $JOBNAME/builds/$BUILD_NUMBER/archive.zip, so I'm playing with that file)

Also we are using a slightly outdated version (2.121.2), update is in the works, so that may solve the problem?

BR,
Laci

Reply all
Reply to author
Forward
0 new messages