Strip components when unzipping an archive

This issue is archived. You can view it, but you can't modify it. Learn more

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.

            Assignee:
            rsandell
            Reporter:
            sunblack
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: