mirror of
https://github.com/drone/drone-cli.git
synced 2024-09-26 22:10:46 +02:00
commit
297de8e13c
@ -36,6 +36,14 @@ var repoUpdateCmd = cli.Command{
|
||||
Name: "config",
|
||||
Usage: "repository configuration path (e.g. .drone.yml)",
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "build-counter",
|
||||
Usage: "repository starting build number",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "unsafe",
|
||||
Usage: "validate updating the build-counter is unsafe",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -57,6 +65,8 @@ func repoUpdate(c *cli.Context) error {
|
||||
timeout = c.Duration("timeout")
|
||||
trusted = c.Bool("trusted")
|
||||
gated = c.Bool("gated")
|
||||
buildCounter = c.Int("build-counter")
|
||||
unsafe = c.Bool("unsafe")
|
||||
)
|
||||
|
||||
patch := new(drone.RepoPatch)
|
||||
@ -79,6 +89,12 @@ func repoUpdate(c *cli.Context) error {
|
||||
patch.Visibility = &visibility
|
||||
}
|
||||
}
|
||||
if c.IsSet("build-counter") && !unsafe {
|
||||
fmt.Printf("Setting the build counter is an unsafe operation that could put your repository in an inconsistent state. Please use --unsafe to proceed")
|
||||
}
|
||||
if c.IsSet("build-counter") && unsafe {
|
||||
patch.BuildCounter = &buildCounter
|
||||
}
|
||||
|
||||
if _, err := client.RepoPatch(owner, name, patch); err != nil {
|
||||
return err
|
||||
|
1
vendor/github.com/drone/drone-go/drone/types.go
generated
vendored
1
vendor/github.com/drone/drone-go/drone/types.go
generated
vendored
@ -46,6 +46,7 @@ type (
|
||||
AllowPush *bool `json:"allow_push,omitempty"`
|
||||
AllowDeploy *bool `json:"allow_deploy,omitempty"`
|
||||
AllowTag *bool `json:"allow_tag,omitempty"`
|
||||
BuildCounter *int `json:"build_counter,omitempty"`
|
||||
}
|
||||
|
||||
// Build defines a build object.
|
||||
|
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
@ -273,10 +273,10 @@
|
||||
"revisionTime": "2017-05-14T17:21:45Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "qLAnM1gmgrZfYrGCNE+nKYFrJAY=",
|
||||
"checksumSHA1": "b7aKujxkg1kYWPvSrHFKNRC3MWU=",
|
||||
"path": "github.com/drone/drone-go/drone",
|
||||
"revision": "327c9594f784216a651dbaed30731600e496dd4e",
|
||||
"revisionTime": "2017-08-01T19:17:01Z"
|
||||
"revision": "b78c6c108686d1fb224c3d9e44c33addd129bd8b",
|
||||
"revisionTime": "2017-08-13T04:37:16Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "pjMV8mwWcQ0Kk9cbLWweTGiqYPk=",
|
||||
|
Loading…
Reference in New Issue
Block a user