Can we use and stash and unstash to copy artifacts from one job to another

1,504 views
Skip to first unread message

sirisha sai

unread,
Jul 1, 2019, 4:37:40 AM7/1/19
to Jenkins Users
Hi,

Currently I am working on a .net project.I have a scenario,Job 1 output(dll's) needs to be copied to Job 2 Jenkins workspace and then run the corresponding sln(solution) file of Job 2.In this case can I use stash and unstash to copy the files or should I use copy artifacts plugin.I am currently using jenkins pipeline script.Please suggest 
any references or docs.


Thanks,
Saisirisha

Emilio Escobar Reyero

unread,
Jul 1, 2019, 7:29:43 AM7/1/19
to jenkins...@googlegroups.com
No, you cannot use stash/unstash for copying files from one job to another but for sharing files between workspaces of the same build. Probably https://jenkins.io/doc/pipeline/steps/copyartifact/ is what you are looking for.

--
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/948d608d-b9bb-4c54-b745-5c213c2984bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Emilio Escobar
Software Engineer

CloudBees, Inc.

CloudBees-Logo.png


E: eescoba...@cloudbees.com
Skype: escoem

sirisha sai

unread,
Jul 1, 2019, 8:06:33 AM7/1/19
to Jenkins Users
Hi,

Thank you for your reply. Is there any way to share files between workspaces of different builds.The output dll's of Job 1 should be copied in 2 locations in Jenkins workspace of build 2.Is there a way to implement this via Jenkins pipeline.

Saisirisha


On Monday, July 1, 2019 at 7:29:43 PM UTC+8, Emilio Escobar Reyero wrote:
No, you cannot use stash/unstash for copying files from one job to another but for sharing files between workspaces of the same build. Probably https://jenkins.io/doc/pipeline/steps/copyartifact/ is what you are looking for.

On Mon, Jul 1, 2019 at 10:37 AM sirisha sai <saisiri...@gmail.com> wrote:
Hi,

Currently I am working on a .net project.I have a scenario,Job 1 output(dll's) needs to be copied to Job 2 Jenkins workspace and then run the corresponding sln(solution) file of Job 2.In this case can I use stash and unstash to copy the files or should I use copy artifacts plugin.I am currently using jenkins pipeline script.Please suggest 
any references or docs.


Thanks,
Saisirisha

--
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 jenkins...@googlegroups.com.

Emilio Escobar Reyero

unread,
Jul 1, 2019, 8:44:05 AM7/1/19
to jenkins...@googlegroups.com
Hi,

Job 2 might use https://jenkins.io/doc/pipeline/steps/copyartifact/ to grab the files from job1

Something like that:

job1

archiveArtifacts '*.dll'
build 'job2'

job2
 
copyArtifacts projectName: 'job1', selector: upstream()

On Mon, Jul 1, 2019 at 2:06 PM sirisha sai <saisiri...@gmail.com> wrote:
Hi,

Thank you for your reply. Is there any way to share files between workspaces of different builds.The output dll's of Job 1 should be copied in 2 locations in Jenkins workspace of build 2.Is there a way to implement this via Jenkins pipeline.

Saisirisha

On Monday, July 1, 2019 at 7:29:43 PM UTC+8, Emilio Escobar Reyero wrote:
No, you cannot use stash/unstash for copying files from one job to another but for sharing files between workspaces of the same build. Probably https://jenkins.io/doc/pipeline/steps/copyartifact/ is what you are looking for.

On Mon, Jul 1, 2019 at 10:37 AM sirisha sai <saisiri...@gmail.com> wrote:
Hi,

Currently I am working on a .net project.I have a scenario,Job 1 output(dll's) needs to be copied to Job 2 Jenkins workspace and then run the corresponding sln(solution) file of Job 2.In this case can I use stash and unstash to copy the files or should I use copy artifacts plugin.I am currently using jenkins pipeline script.Please suggest 
any references or docs.


Thanks,
Saisirisha

--
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 jenkins...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/948d608d-b9bb-4c54-b745-5c213c2984bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Emilio Escobar
Software Engineer

CloudBees, Inc.

CloudBees-Logo.png


--
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/e62bdfa9-ddf6-4f6b-af4f-3a251bb0196e%40googlegroups.com.

sirisha sai

unread,
Jul 1, 2019, 8:51:00 AM7/1/19
to jenkins...@googlegroups.com
Hi,

I will go through the docs and give this a try.Thank you for the help.I will let you know the output once it is done.

Saisirisha 

Message has been deleted

sirisha sai

unread,
Jul 2, 2019, 5:36:36 AM7/2/19
to Jenkins Users
Hi,

If I publish the Job 1 build artifacts(dll's) to Nexus repository,how can I reference these dll's in the Job 2,for java apps we reference it in build.gradle,likewise for MSBuild where do we reference it.

Thanks,
Saisirisha

Martin d'Anjou

unread,
Jul 2, 2019, 10:28:41 AM7/2/19
to Jenkins Users
You can use the external workspace manager for this purpose. No copies are made, just reuse the same workspace between jobs. Examples are provided in the README.

sirisha sai

unread,
Jul 2, 2019, 8:39:53 PM7/2/19
to jenkins...@googlegroups.com
Hi,

As of now our organization will not support downloading plugins, so they asked me to publish Job 1 dll’s to nexus repository and reference these dll’s from nexus in the Job 2.For java apps we can put the dependency jars in build.gradle dependency section but in case of msbuild how do we reference it?please suggest any docs/ideas on this.

Thanks,
Saisirisha 

--
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/2064e1ad-e614-4714-ae79-dba11cf5e9a5%40googlegroups.com.

Slide

unread,
Jul 2, 2019, 8:58:39 PM7/2/19
to Jenkins User Mailing List
I would recommend using a local number repo, then using nuget restore with that as a source. There are lots of examples online.

sirisha sai

unread,
Jul 2, 2019, 10:24:39 PM7/2/19
to jenkins...@googlegroups.com
Hi,

In my case Job 1 and Job 2 contains different workspaces, but job2 should refer the build artifacts (dll’s) from job 1 and run the sln file which is in job 2 workspace.

So I want to publish these artifacts to nexus and refer it from there.I am not sure in which file should I refer these dll’s in the Job 2 ,in Jenkinsfile or sln file or any other file.

Please advise on this.

Thanks,
Saisirisha 

kapook kapookna

unread,
Apr 15, 2020, 9:00:54 PM4/15/20
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages