0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-21 13:50:39 +00:00

fix(deps): update module github.com/thegeeklab/drone-plugin-lib to v2

This commit is contained in:
Robert Kaussow 2022-06-02 15:00:33 +02:00
parent d297a380ee
commit db4c4bee72
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
5 changed files with 11 additions and 19 deletions

View File

@ -5,11 +5,11 @@ import (
"os"
"github.com/joho/godotenv"
"github.com/sirupsen/logrus"
"github.com/thegeeklab/drone-docker-buildx/plugin"
"github.com/urfave/cli/v2"
"github.com/thegeeklab/drone-plugin-lib/errors"
"github.com/thegeeklab/drone-plugin-lib/urfave"
"github.com/thegeeklab/drone-plugin-lib/v2/urfave"
)
var (
@ -37,7 +37,7 @@ func main() {
}
if err := app.Run(os.Args); err != nil {
errors.HandleExit(err)
logrus.Fatal(err)
}
}
@ -52,19 +52,11 @@ func run(settings *plugin.Settings) cli.ActionFunc {
)
if err := plugin.Validate(); err != nil {
if e, ok := err.(errors.ExitCoder); ok {
return e
}
return errors.ExitMessagef("validation failed: %w", err)
return fmt.Errorf("validation failed: %w", err)
}
if err := plugin.Execute(); err != nil {
if e, ok := err.(errors.ExitCoder); ok {
return e
}
return errors.ExitMessagef("execution failed: %w", err)
return fmt.Errorf("execution failed: %w", err)
}
return nil

2
go.mod
View File

@ -6,7 +6,7 @@ require (
github.com/coreos/go-semver v0.3.0
github.com/joho/godotenv v1.4.0
github.com/sirupsen/logrus v1.8.1
github.com/thegeeklab/drone-plugin-lib v1.0.0
github.com/thegeeklab/drone-plugin-lib/v2 v2.0.0
github.com/urfave/cli/v2 v2.8.1
)

4
go.sum
View File

@ -14,8 +14,8 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/thegeeklab/drone-plugin-lib v1.0.0 h1:PQeLnJa0q988rODYod/XtDy/f0cHHUhOA2Y8m5XRW4g=
github.com/thegeeklab/drone-plugin-lib v1.0.0/go.mod h1:XAlZDTSNNJogOH1+nS5u0notdj5dO/gtKnU7guzE95g=
github.com/thegeeklab/drone-plugin-lib/v2 v2.0.0 h1:ejM1fIkGhn9sy7HTidRiQhZJuEfUNF6sO9ko090PYvM=
github.com/thegeeklab/drone-plugin-lib/v2 v2.0.0/go.mod h1:cXNc+dmGLA748rAnXVBsTFG1UO+A/0XlV5jUEf/ahgk=
github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4=
github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=

View File

@ -88,12 +88,12 @@ func (p *Plugin) Validate() error {
p.settings.Build.TagsSuffix,
)
if err != nil {
logrus.Printf("cannot generate tags from %s, invalid semantic version", p.settings.Build.Ref)
logrus.Infof("cannot generate tags from %s, invalid semantic version", p.settings.Build.Ref)
return err
}
p.settings.Build.Tags = *cli.NewStringSlice(tag...)
} else {
logrus.Printf("skip auto-tagging for %s, not on default branch or tag", p.settings.Build.Ref)
logrus.Infof("skip auto-tagging for %s, not on default branch or tag", p.settings.Build.Ref)
return nil
}
}

View File

@ -1,7 +1,7 @@
package plugin
import (
"github.com/thegeeklab/drone-plugin-lib/drone"
"github.com/thegeeklab/drone-plugin-lib/v2/drone"
)
// Plugin implements drone.Plugin to provide the plugin implementation.