This repository was archived by the owner on Aug 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +11
-19
lines changed
Expand file tree Collapse file tree 5 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import (
55 "os"
66
77 "github.com/joho/godotenv"
8+ "github.com/sirupsen/logrus"
89 "github.com/thegeeklab/drone-docker-buildx/plugin"
910 "github.com/urfave/cli/v2"
1011
11- "github.com/thegeeklab/drone-plugin-lib/errors"
12- "github.com/thegeeklab/drone-plugin-lib/urfave"
12+ "github.com/thegeeklab/drone-plugin-lib/v2/urfave"
1313)
1414
1515var (
@@ -37,7 +37,7 @@ func main() {
3737 }
3838
3939 if err := app .Run (os .Args ); err != nil {
40- errors . HandleExit (err )
40+ logrus . Fatal (err )
4141 }
4242}
4343
@@ -52,19 +52,11 @@ func run(settings *plugin.Settings) cli.ActionFunc {
5252 )
5353
5454 if err := plugin .Validate (); err != nil {
55- if e , ok := err .(errors.ExitCoder ); ok {
56- return e
57- }
58-
59- return errors .ExitMessagef ("validation failed: %w" , err )
55+ return fmt .Errorf ("validation failed: %w" , err )
6056 }
6157
6258 if err := plugin .Execute (); err != nil {
63- if e , ok := err .(errors.ExitCoder ); ok {
64- return e
65- }
66-
67- return errors .ExitMessagef ("execution failed: %w" , err )
59+ return fmt .Errorf ("execution failed: %w" , err )
6860 }
6961
7062 return nil
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require (
66 github.com/coreos/go-semver v0.3.0
77 github.com/joho/godotenv v1.4.0
88 github.com/sirupsen/logrus v1.8.1
9- github.com/thegeeklab/drone-plugin-lib v1 .0.0
9+ github.com/thegeeklab/drone-plugin-lib/v2 v2 .0.0
1010 github.com/urfave/cli/v2 v2.8.1
1111)
1212
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE
1414github.com/sirupsen/logrus v1.8.1 /go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0 =
1515github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w =
1616github.com/stretchr/testify v1.2.2 /go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs =
17- github.com/thegeeklab/drone-plugin-lib v1 .0.0 h1:PQeLnJa0q988rODYod/XtDy/f0cHHUhOA2Y8m5XRW4g =
18- github.com/thegeeklab/drone-plugin-lib v1 .0.0/go.mod h1:XAlZDTSNNJogOH1+nS5u0notdj5dO/gtKnU7guzE95g =
17+ github.com/thegeeklab/drone-plugin-lib/v2 v2 .0.0 h1:ejM1fIkGhn9sy7HTidRiQhZJuEfUNF6sO9ko090PYvM =
18+ github.com/thegeeklab/drone-plugin-lib/v2 v2 .0.0/go.mod h1:cXNc+dmGLA748rAnXVBsTFG1UO+A/0XlV5jUEf/ahgk =
1919github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4 =
2020github.com/urfave/cli/v2 v2.8.1 /go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY =
2121github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU =
Original file line number Diff line number Diff line change @@ -88,12 +88,12 @@ func (p *Plugin) Validate() error {
8888 p .settings .Build .TagsSuffix ,
8989 )
9090 if err != nil {
91- logrus .Printf ("cannot generate tags from %s, invalid semantic version" , p .settings .Build .Ref )
91+ logrus .Infof ("cannot generate tags from %s, invalid semantic version" , p .settings .Build .Ref )
9292 return err
9393 }
9494 p .settings .Build .Tags = * cli .NewStringSlice (tag ... )
9595 } else {
96- logrus .Printf ("skip auto-tagging for %s, not on default branch or tag" , p .settings .Build .Ref )
96+ logrus .Infof ("skip auto-tagging for %s, not on default branch or tag" , p .settings .Build .Ref )
9797 return nil
9898 }
9999 }
Original file line number Diff line number Diff line change 11package plugin
22
33import (
4- "github.com/thegeeklab/drone-plugin-lib/drone"
4+ "github.com/thegeeklab/drone-plugin-lib/v2/ drone"
55)
66
77// Plugin implements drone.Plugin to provide the plugin implementation.
You can’t perform that action at this time.
0 commit comments