Right now the code looks weird because the defaults
of a pipe are far away of the implementation of the pipe.
the intend of this PR is to bring them closer by having a
Defaulter interface.
I also renamed the Pipe interface to Piper, and removed
the Description method in favor for fmt.Stringer.
Three new unit tests added:
- TestRunPipe_NoFile: Checks the error if the file for the
upload is not there
- TestRunPipe_UnparsableTarget: Checks that an error will
be thrown if the target is not parsable
- TestRunPipe_DirUpload: Checks that an error will be
thrown when we try to upload a directory
We are able to define multiple Artifactory instances.
In the former implementation, we continue once one instance upload
was failing. Now we stop and throw the error.
In a former commit we respected the error of the Close()
call for a HTTP response. The fix was to introduce named
return values (e.g. err for error).
The problem: We defered the resp.Close() via
err = resp.Close()
This had the effect of always overwrite the real error
that happen when the HTTP call failes (due to checkResponse func).
When the upload target is not resolvable by tcp (e.g. unknown host)
no response object will be generated.
In an error case the response object is used (it was assumed that
this will be there at every point in time).
This commit fixes this behaviour
Artifactory is an universal Artifact Repository Manager by
JFrog. See https://www.jfrog.com/artifactory/
It is available in an OSS and Enterprise version.
Many companies using this internally to store, manage and
distribute binaries within their internal infrastructure.
It adds basic support to push all generated binaries into an
Artifactory. Basic means only the built artifacts. Without
checksums or archives.
As an authentication only Basic auth is supported by this Pipe.
See #344
Previous code was handling only main.go as the main build file, but
the main function can actually be in any file.
Now, if a specific file (*.go) is passed, that file will be checked
for the main function.
If a folder is passed, the package will be scanned for the main
function.
Rather than using a conditional to check if `bindir` has been set,
use the defaults pipe to set it to `/usr/local/bin` if it has not
been set in the config file.
Some packagers may want to put binaries in a location other than
/usr/local/bin. This allows one to override the destination for
binaries when using fpm, using the `fpm.bindir` config key.
FPM would randomly fail to build deb and rpm packages. It apparently
happens because fpm (or some tool it uses) shares state between runs
(possibly by overriding files that are going inside the archive).
The error `file changed as we read it` was happening, which is a `tar`
error.
I don't know how to fix this, but, in order to make goreleaser more
stable, I'll disable the concurrency here for now.
closes#333