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

Strip components when unzipping an archive

XMLWordPrintable

      Since checking out some repositories takes longer, we download some of the release archives from GitHub. In our Dockerfile, we use the following for this purpose:

      wget -nv -O- https://github.com/OSGeo/gdal/releases/download/v${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz | tar xz --strip-components=1
      

      For our Windows machine, which is not currently based on Docker, I would like to do something equivalent.

      httpRequest outputFile: 'gdal.tar.gz', url: "https://github.com/OSGeo/gdal/releases/download/v${params.version}/gdal-${params.version}.tar.gz"
      untar file: 'gdal.tar.gz'
      

      But this contains an unneeded sub directory (e.g., "gdal-3.11.3"). So an option to strip an directory would be nice.

            rsandell rsandell
            sunblack sunblack
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: