1

I have a Declarative Pipeline where in one stage I build my code (jar file). In a following stage I need to to access the same jar file (for packaging purposes). currently I see that the first stage is working within a folder named after the job name (myjob).

Following stages in the same pipeline have different working directories (myjob@2 or myjob@2@tmp).

Is there a way to access/copy files produced by one stage in another stage (within the same pipeline) ?

Ebeid ElSayed
  • 1,126
  • 2
  • 15
  • 32
  • The pipeline does use that folder structure but, the $WORKSPACE variable should always have the current folder name. You can access it using the same variable. – Ravindranath Barathy Apr 20 '18 at 03:20
  • You can also try using stash and unstash for copying over files within the pipeline. An example: https://stackoverflow.com/questions/43050248/correct-usage-of-stash-unstash-into-a-different-directory – Ravindranath Barathy Apr 20 '18 at 03:34
  • It would probably be much easier if you included your pipeline code here, or at least a [mcve], so we know what you are working with. – bto Apr 20 '18 at 13:04

0 Answers0