Package the result of a build in Jenkins into a zip

喜你入骨 提交于 2020-02-21 08:20:02

问题


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 an 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 to do that.


回答1:


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




回答2:


There is a Jenkins plug-in for that:

https://wiki.jenkins-ci.org/display/JENKINS/Compress+Artifacts+Plugin




回答3:


I you use Jenkinsfile(declarative) you can use zipFile and give the directory name that you want to be zipped

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



来源:https://stackoverflow.com/questions/16725989/package-the-result-of-a-build-in-jenkins-into-a-zip

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!