Efficient way to copy artifacts(with symlinks) across workspace

18 views
Skip to first unread message

Jenkinsnewbie

unread,
Jan 13, 2015, 11:33:09 AM1/13/15
to jenkins...@googlegroups.com
I have a very specific issue. Problem is: I need to copy artifacts from one directory in workspace to another. some of the artifacts  contain symlinks. I use the solution as provided in: https://github.com/jenkinsci/jenkins/commit/e15b2e19e394f5d63183f01a2e72a14115a0c370 i.e. taring the source and untaring at destination. But it sometimes fail at the slaves.

Does anyone have a better solution?

Thanks!

John Mellor

unread,
Jan 13, 2015, 12:35:39 PM1/13/15
to jenkins...@googlegroups.com

“tar” functionality does not nicely handle links, and never has.  How about using “cpio –pdum” or “pax” to copy the directory?

--
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/48986b25-2c9b-48dd-a588-d1c9a66ff6bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jenkinsnewbie

unread,
Jan 13, 2015, 1:10:06 PM1/13/15
to jenkins...@googlegroups.com, john....@esentire.com
Will "cpio -dum" work in Windows?

Jason Pyeron

unread,
Jan 13, 2015, 1:13:06 PM1/13/15
to jenkins...@googlegroups.com, john....@esentire.com
> -----Original Message-----
> From: Jenkinsnewbie
> Sent: Tuesday, January 13, 2015 13:10
>
> Will "cpio -dum" work in Windows?

With cygwin, how were you handling links before on windows?

>
> On Tuesday, 13 January 2015 18:35:39 UTC+1, John Mellor wrote:
>
> "tar" functionality does not nicely handle links, and
> never has. How about using "cpio -pdum" or "pax" to copy the
> directory?
>
>
>
> From: jenkins...@googlegroups.com <javascript:>
> [mailto:jenkins...@googlegroups.com <javascript:> ] On Behalf
> Of Jenkinsnewbie
> Sent: January-13-15 11:33
> To: jenkins...@googlegroups.com <javascript:>
> Subject: Efficient way to copy artifacts(with symlinks)
> across workspace
>
>
>
> I have a very specific issue. Problem is: I need to
> copy artifacts from one directory in workspace to another.
> some of the artifacts contain symlinks. I use the solution
> as provided in:
> https://github.com/jenkinsci/jenkins/commit/e15b2e19e394f5d631
> 83f01a2e72a14115a0c370
> <https://github.com/jenkinsci/jenkins/commit/e15b2e19e394f5d63
> 183f01a2e72a14115a0c370> i.e. taring the source and untaring
> at destination. But it sometimes fail at the slaves.
>
>
>
> Does anyone have a better solution?
>
>
>
> Thanks!
>
> --
> 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 <javascript:> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/48986b25-2c9
b-48dd-a588-d1c9a66ff6bd%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/48986b25-2c
9b-48dd-a588-d1c9a66ff6bd%40googlegroups.com?> utm_medium=email&utm_source=footer> .
> For more options, visit
> https://groups.google.com/d/optout
> <https://groups.google.com/d/optout> .
>
> --
> 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/fe1351f6-fef
0-403d-9359-891f209fa67e%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/fe1351f6-fe
f0-403d-9359-891f209fa67e%40googlegroups.com?> utm_medium=email&utm_source=footer> .
> For more options, visit https://groups.google.com/d/optout.
>
>
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

Jenkinsnewbie

unread,
Jan 13, 2015, 1:20:53 PM1/13/15
to jenkins...@googlegroups.com, john....@esentire.com
I am not sure if Windows supports symlinks.
But the current requirement  is to support at least Linux and may be Windows.

John Mellor

unread,
Jan 13, 2015, 1:28:40 PM1/13/15
to jenkins...@googlegroups.com

Ø  Will "cpio -dum" work in Windows?

 

Pax is implemented natively on Windows, so use it by preference.  It will understand that it will need to follow symlinks on Windows, seeing as windows has no concept of symlinks.

 

Cpio and tar are also present in the Cygwin toolkit, so if you are using unix tools, install Cygwin.

Jason Pyeron

unread,
Jan 13, 2015, 1:30:02 PM1/13/15
to jenkins...@googlegroups.com, john....@esentire.com
> -----Original Message-----
> From: Jenkinsnewbie
> Sent: Tuesday, January 13, 2015 13:21
>
> I am not sure if Windows supports symlinks.
> But the current requirement is to support at least Linux and
> may be Windows.
>

If you can run tar, then you can run cpio. We use cygwin for that on windows.
Reply all
Reply to author
Forward
0 new messages