Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins pipeline: can I share stashes between pipelines / workspaces?

I have declarative pipeline_a executing pipeline_b via build job. Problem is pipeline_b needs to use some files generated by pipeline_a. stash/unstash works for me to share data between stages but stashes saved in pipeline_a do not seem to be visible in pipeline_b.

  • Is this by design?
  • Should I be using some other Jenkins trick to share files between different jobs/pipelines?
like image 558
AlexanderF Avatar asked Oct 18 '25 13:10

AlexanderF


1 Answers

For share between jobs you can use Copy Artifacts plugin or archive() artifacts of pipeline_a and download it in pipeline_b:

Pipeline_a:

archive('artifactName')

Pipeline_b:

sh("wget ${env.JENKINS_URL}/job/$jobName/$buildNumber/artifact/$artifactName")
like image 107
FCh Avatar answered Oct 20 '25 09:10

FCh