Setup a working pipeline

* add tests to ensure function even after switching docker client api version
* switch docker client api version to remove import of Sirupsen and get rid of the casing workaround
* migrate from glide to dep to go modules
* rewrite ci workflow
  * only run publish on version tags
  * only run build on branches
  * update goreleaser config
  * disable automated latest tag push
* remove dependency to v2tec/docker-gobuilder
* remove dead code and files
* add golands .idea folder to gitignore
* add label to released docker images
* add test reporting, add some unit tests
* change test output dir
* fix goreleaser versions
* add debug output for circleci and goreleaser
* disable cgo
This commit is contained in:
Simon Aronsson 2019-04-04 23:08:44 +02:00
parent 98f916f29a
commit 1b82da1ab7
16 changed files with 450 additions and 362 deletions

View file

@ -5,12 +5,12 @@ import (
"os"
"strings"
"github.com/docker/cli/cli/command"
cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/config/credentials"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/reference"
"github.com/docker/docker/cli/command"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/cliconfig/configfile"
"github.com/docker/docker/cliconfig/credentials"
log "github.com/sirupsen/logrus"
)
@ -67,12 +67,15 @@ func EncodedConfigAuth(ref string) (string, error) {
return EncodeAuth(auth)
}
// ParseServerAddress extracts the server part from a container image ref
func ParseServerAddress(ref string) (string, error) {
repository, _, err := reference.Parse(ref)
parsedRef, err := reference.Parse(ref)
if err != nil {
return ref, err
}
parts := strings.Split(repository, "/")
parts := strings.Split(parsedRef.String(), "/")
return parts[0], nil
}