Skip to content

orrc/jenkins-filepath-untar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins FilePath Download Test

I'm having difficulty with the FilePath#installIfNecessary API in Jenkins.

This is a pretty minimal reproduction attempt, which fails outside of Jenkins in the same way that it does from my plugin.

What this repo does

It implements a tool which uses the FilePath API to download a .tar.gz file and extract it to a temporary directory. This is essentially what a tool installer does in Jenkins.

Problem

Using this API seems to fail with a certain set of .tar.gz files, regardless of where the file is downloaded from (the official Google distribution server, a personal server of mine, or from localhost).

The error message is usually Failed to unpack <url> (153358 bytes read of total 76218682), where the number of bytes read can vary between multiple runs with the same URL.

These files can be downloaded (and subsequently extracted) successfully with wget, but fail when downloaded using FilePath.

The following URLs of Go distributions have been tested with this program:

Go version Status
1.6.2 Fails
1.6.1 Fails
1.6 Fails
1.5.4 Fails
1.5.3 Fails
1.5.2 Fails
1.5.1 Succeeds
1.5 Succeeds
1.4.3 Fails
1.4.2 Succeeds
1.4.1 Succeeds
1.4 Succeeds

The same results have been achieved on both OS X 10.11.4 and Ubuntu 14.04.3.

Usage

To run with a default URL (Go 1.6.2):
./gradlew run

To run with a custom URL:
./gradlew run -Pargs=https://example.com/some-file.tgz