Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package the result of a build in Jenkins into a zip

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.

like image 360
coder Avatar asked May 24 '13 00:05

coder


2 Answers

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

like image 190
scranley Avatar answered Nov 06 '22 21:11

scranley


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

like image 31
startprogramming Avatar answered Nov 06 '22 23:11

startprogramming