24

I've just started using Jenkins and need some advice.

After a successful build I would like to have the resulting directory packaged into a zip file and stored in workspace so later I can send to Artifactory.

At the moment I'm using a program that I wrote for that purpose which I run in a batch file as the last step of a build, but I wonder if there is a way of having Jenkins do that.

Mig82
  • 4,856
  • 4
  • 40
  • 63
coder
  • 327
  • 2
  • 3
  • 7

2 Answers2

7

The file operations plugin has a zip operation.

Used with ${GIT_BRANCH} to create a zip file of the successful build.

https://wiki.jenkins.io/display/JENKINS/File+Operations+Plugin

Mig82
  • 4,856
  • 4
  • 40
  • 63
scranley
  • 188
  • 1
  • 4
  • 20
1

I you use a pipeline job (wheter that's declarative or scripted) you can use the zipFile step and give it the directory path that you want to be zipped.

https://jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#zip-create-zip-file

Mig82
  • 4,856
  • 4
  • 40
  • 63