Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions cmd/drone-downstream/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,9 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
EnvVars: []string{"PLUGIN_TOKEN", "DRONE_TOKEN", "DOWNSTREAM_TOKEN"},
Destination: &settings.Token,
},
&cli.BoolFlag{
Name: "wait",
Usage: "Wait for any currently running builds to finish",
EnvVars: []string{"PLUGIN_WAIT"},
Destination: &settings.Wait,
},
&cli.DurationFlag{
Name: "timeout",
Value: time.Duration(60) * time.Second,
Usage: "How long to wait on any currently running builds",
EnvVars: []string{"PLUGIN_WAIT_TIMEOUT"},
Destination: &settings.Timeout,
},
Comment on lines -36 to -48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Believe @bradrydzewski 's initial ask was that wait and timeout would apply to the triggered build so should probably modify that accordingly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will try.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See @bradrydzewski ''s comments below at #73 (comment)

&cli.BoolFlag{
Name: "last-successful",
Usage: "Trigger last successful build",
Usage: "Deploy last successful build",
EnvVars: []string{"PLUGIN_LAST_SUCCESSFUL"},
Destination: &settings.LastSuccessful,
},
Expand All @@ -66,7 +53,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
},
&cli.StringFlag{
Name: "deploy",
Usage: "Environment to trigger deploy for the respective build",
Usage: "Environment to trigger deploy to",
EnvVars: []string{"PLUGIN_DEPLOY"},
Destination: &settings.Deploy,
},
Expand All @@ -77,11 +64,11 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
Destination: &settings.Block,
},
&cli.DurationFlag{
Name: "blockTimeout",
Name: "timeout",
Value: time.Duration(60) * time.Minute,
Usage: "How long to block until the triggered build is finished",
EnvVars: []string{"PLUGIN_BLOCK_TIMEOUT"},
Destination: &settings.BlockTimeout,
Destination: &settings.Timeout,
},
}
}
11 changes: 7 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module github.com/drone-plugins/drone-downstream

go 1.14
go 1.15

require (
github.com/drone-plugins/drone-plugin-lib v0.3.1
github.com/drone/drone-go v1.3.1
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/drone-plugins/drone-plugin-lib v0.4.0
github.com/drone/drone-go v1.4.0
github.com/joho/godotenv v1.3.0
github.com/stretchr/testify v1.4.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tboerger do you have any preferences on go testing modules? I don't have any strong opinions on it all.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion on that, but isn't the standard library enough?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do without it, but it does make error checking in tests far less verbose.

github.com/urfave/cli/v2 v2.2.0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/net v0.0.0-20200923182212-328152dc79b1 // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
)
Loading