2

We have a Jenkins pipeline and I want to zip multiple files(.py and .cfg) located in multiple directories within my workspace. Is there a way we can pass multiple values to dir option of the zip method?

zip (zipFile: "package.zip", dir: "${WORKSPACE}/infra/folder1/")

P.S: I can add an additional stage before zip process and move all the required files to a folder and archive that folder using above zip method, but I would like to avoid an additional step/stage

sun_dare
  • 1,146
  • 2
  • 13
  • 33
  • just an idea here... you could pass the workspace as your `dir` and play with`glob` parameter to specify the file names that start with the folders that you want – Pedreiro Jun 12 '19 at 02:26

1 Answers1

0

I have looked at the sources for that JENKINS Pipeline Utility Steps Plugin in jenkinsci/pipeline-utility-steps-plugin:

Nothing suggests you could:

  • pass multiple directories
  • execute the zip step multiple times for one archive, appending folders to an existing archive

So you have to:

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250