From a7117600aa2ac88d50551889ac78b2e1b6b65919 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 8 Oct 2022 15:32:14 +0200 Subject: [PATCH] CI: add test (#26) Reviewed-on: https://codeberg.org/woodpecker-plugins/plugin-docker-buildx/pulls/26 Reviewed-by: anbraten Co-authored-by: 6543 <6543@obermui.de> Co-committed-by: 6543 <6543@obermui.de> --- .gitignore | 1 + .woodpecker/main.yml => .woodpecker.yml | 11 ++++++++++- plugin/impl.go | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) rename .woodpecker/main.yml => .woodpecker.yml (80%) diff --git a/.gitignore b/.gitignore index c5e9d24..afd7d10 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /release/ +/vendor/ plugin-docker-buildx diff --git a/.woodpecker/main.yml b/.woodpecker.yml similarity index 80% rename from .woodpecker/main.yml rename to .woodpecker.yml index f83ed32..6afccf2 100644 --- a/.woodpecker/main.yml +++ b/.woodpecker.yml @@ -2,9 +2,18 @@ branches: main variables: - &platforms 'linux/amd64,linux/arm64' + - &golang 'golang:1.18' pipeline: - dryrun: + vendor: + image: *golang + commands: go mod vendor + + test: + image: *golang + commands: go test -cover ./... + + publish-dryrun: image: woodpeckerci/plugin-docker-buildx:v20.10.18 settings: platforms: *platforms diff --git a/plugin/impl.go b/plugin/impl.go index 1d271b3..5866a14 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -130,7 +130,7 @@ func (p *Plugin) writeBuildkitConfig() error { caPath := fmt.Sprintf("/etc/docker/certs.d/%s/ca.crt", registry) ca, err := os.Open(caPath) if err != nil && !os.IsNotExist(err) { - logrus.Warnf("error reading %s: %w", caPath, err) + logrus.Warnf("error reading %s: %v", caPath, err) } else if err == nil { ca.Close() p.settings.Daemon.BuildkitConfig = fmt.Sprintf(buildkitConfigTemplate, registry, caPath)