0

I am just beginning with Jenkins but I could not find how I can zip the package of the master branch after the checkout and save it with the build number version. Could you please assist what should be added to make a ZIP? Job is executed on Docker agent

pipeline {
    agent any
    stages {
        stage ('ZIP stage') {
            steps {
                echo "Building the zip package"

            }
        }
    }
}
}

Thank you very much for kind assistance!

vel
  • 1,000
  • 1
  • 13
  • 35
  • Maybe as help: What linux system is your docker agent? How can you install zip? How do you have to call zip to zip your content? – Michael Kemmerzell Nov 16 '21 at 15:37
  • You know about [`zip`](https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#zip-create-zip-file) step? – zett42 Nov 16 '21 at 15:56
  • @zett42 do I need to install some Plugin for this? or this is available? could you please provide me answer with example how to zip current directory with build version? It would mean a lot to me to understand everything better with full example. Thanks – vel Nov 16 '21 at 16:15
  • You need [Pipeline Utility Steps](https://plugins.jenkins.io/pipeline-utility-steps/) plugin. – zett42 Nov 16 '21 at 16:27
  • Does this answer your question? [Jenkins Pipeline Utility Steps - zip zipFile](https://stackoverflow.com/questions/48352443/jenkins-pipeline-utility-steps-zip-zipfile) – zett42 Nov 16 '21 at 16:27
  • do I need to perform "sudo yum install zip" as well? How I can automate this? I have docker container so this can be problematic am I right? Can I add BUILD_VERSION in the name as well? – vel Nov 16 '21 at 17:02
  • @zett42 I wouldn't like to define static name of the folder that would be zip but I would like to take all the content of the master branch and to put it into the zip along with the build version... please suggest me if you can how this can be done... thanks – vel Nov 16 '21 at 22:20

0 Answers0