Share files between pipelines?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Share files between pipelines?

ZillaYT
I posted this in Stackoverflow but i thought I'd post it here too, since this is a Jenkins specific group

https://stackoverflow.com/questions/63923156/sharing-files-between-jenkins-pipelines

 I want to share a file between two different pipelines, running on 2 different nodes.

I tried to use the Copy Artifacts plugin like so

Pipeline1:
node {'linux-0') { 
  stage("Create file") { 
     sh "echo \"hello world\" > hello.txt"
     archiveArtifacts artifact: 'hello.txt', fingerprint: true
   }
 }

Pipeline2:
node('linux-1') { 
  stage("Copy form first pipeline") { 
    copyArtifacts projectName: 'Pipeline1',
                  fingerprintArtifacts: true,
                  filter: 'hello.txt' 
   }
}

and I get the following error for Pipeline2

ERROR: Unable to find project for artifact copy: Pipeline1 This may be due to incorrect project name or permission settings; see help for project name in job configuration. Finished: FAILURE

What am I missing?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5cca613a-0880-4260-a89a-4b0543ed00e5n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Share files between pipelines?

Gianluca
The error is very verbose.
So ... or the project name is incorrect ... or the user running Pipeline2 doesn't permission to see "Pipeline1".

You can check the project name by looking at the Jenkins user interface for "Full project name: .... "
See screenshot.

Ah ... remember that you have to escape the "/" with "%2F" in the pipeline code.


Il giorno mercoledì 16 settembre 2020 alle 16:48:35 UTC+1 [hidden email] ha scritto:
I posted this in Stackoverflow but i thought I'd post it here too, since this is a Jenkins specific group


 I want to share a file between two different pipelines, running on 2 different nodes.

I tried to use the Copy Artifacts plugin like so

Pipeline1:
node {'linux-0') { 
  stage("Create file") { 
     sh "echo \"hello world\" > hello.txt"
     archiveArtifacts artifact: 'hello.txt', fingerprint: true
   }
 }

Pipeline2:
node('linux-1') { 
  stage("Copy form first pipeline") { 
    copyArtifacts projectName: 'Pipeline1',
                  fingerprintArtifacts: true,
                  filter: 'hello.txt' 
   }
}

and I get the following error for Pipeline2

ERROR: Unable to find project for artifact copy: Pipeline1 This may be due to incorrect project name or permission settings; see help for project name in job configuration. Finished: FAILURE

What am I missing?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c01c68fd-81fe-4d10-9ca5-2709323512fdn%40googlegroups.com.

Screenshot_20200916_165422.png (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Share files between pipelines?

ZillaYT
Thanks.

On Wednesday, September 16, 2020 at 11:55:53 AM UTC-4 Gianluca wrote:
The error is very verbose.
So ... or the project name is incorrect ... or the user running Pipeline2 doesn't permission to see "Pipeline1".

You can check the project name by looking at the Jenkins user interface for "Full project name: .... "
See screenshot.

Ah ... remember that you have to escape the "/" with "%2F" in the pipeline code.


Il giorno mercoledì 16 settembre 2020 alle 16:48:35 UTC+1 [hidden email] ha scritto:
I posted this in Stackoverflow but i thought I'd post it here too, since this is a Jenkins specific group


 I want to share a file between two different pipelines, running on 2 different nodes.

I tried to use the Copy Artifacts plugin like so

Pipeline1:
node {'linux-0') { 
  stage("Create file") { 
     sh "echo \"hello world\" > hello.txt"
     archiveArtifacts artifact: 'hello.txt', fingerprint: true
   }
 }

Pipeline2:
node('linux-1') { 
  stage("Copy form first pipeline") { 
    copyArtifacts projectName: 'Pipeline1',
                  fingerprintArtifacts: true,
                  filter: 'hello.txt' 
   }
}

and I get the following error for Pipeline2

ERROR: Unable to find project for artifact copy: Pipeline1 This may be due to incorrect project name or permission settings; see help for project name in job configuration. Finished: FAILURE

What am I missing?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/52b6b978-b75f-413f-880f-16f06e9c81b8n%40googlegroups.com.