Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34122

Pipeline-utilities step zip step includes output zip file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • jenkins 1.642.4
      pipeline 2.0
      pipeline-utility-steps 1.1.4

      If the zip file that you are creating is in the directory that you are zipping then you get an incomplete version of the output zip inside the archive.

      example pipeline DSL.

      node {
          deleteDir()
          touch file: 'afile.txt', timestamp: 0
          touch file: 'bfile.txt', timestamp: 0
          zip dir: '', glob: '', zipFile: 'thing.zip'
          dir ('directory') {
              touch file: 'cfile.txt', timestamp: 0
          }
          v = unzip dir: '', glob: '', read: true, zipFile: 'thing.zip'
          println v
      }
      

      Console output

      Extracting from c:\j\jobs\MyPipeline\ws\thing.zip
      Reading: afile.txt
      Reading: bfile.txt
      Reading: thing.zip
      [Pipeline] echo
      {afile.txt=, bfile.txt=, thing.zip=PK!	afile.txtPKPK!	bfile.txtPKPKNcˆH	thing.zip}
      

            rsandell rsandell
            rg Russell Gallop
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: