Zip a directory in Jenkins Pipeline
10,372
Try this:
pipeline {
agent any
stages {
stage("test.."){
steps{
script{
zip archive: true, dir: '', glob: '', zipFile: 'testz.zip'
}
}
}
}
}
Reference: https://jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#zip-create-zip-file
Author by
Idothisallday
Updated on June 04, 2022Comments
-
Idothisallday almost 2 years
I keep getting this error: "No signature of method: zip.call()"
This is the code i am running in Jenkins pipeline :
pipeline { agent any stages { stage("test..") { steps { zip dir: '', glob: '', zipFile: 'testz.zip' } } } }
I have the zip step appear in sample steps in pipeline syntax, so not sure why this failing. I need to zip my source code folder.
-
tim_yates almost 6 yearsHave you installed the "pipeline utility steps" plugin? stackoverflow.com/a/48386777/6509
-
Idothisallday almost 6 yearsYes, added image above
-
-
raviTeja almost 2 yearsDoes this work when we run a pipeline using a container ?