mirror of
https://github.com/drone/drone-cli.git
synced 2024-09-27 06:21:48 +02:00
commit
297de8e13c
@ -36,6 +36,14 @@ var repoUpdateCmd = cli.Command{
|
|||||||
Name: "config",
|
Name: "config",
|
||||||
Usage: "repository configuration path (e.g. .drone.yml)",
|
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",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +60,13 @@ func repoUpdate(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
visibility = c.String("visibility")
|
visibility = c.String("visibility")
|
||||||
config = c.String("config")
|
config = c.String("config")
|
||||||
timeout = c.Duration("timeout")
|
timeout = c.Duration("timeout")
|
||||||
trusted = c.Bool("trusted")
|
trusted = c.Bool("trusted")
|
||||||
gated = c.Bool("gated")
|
gated = c.Bool("gated")
|
||||||
|
buildCounter = c.Int("build-counter")
|
||||||
|
unsafe = c.Bool("unsafe")
|
||||||
)
|
)
|
||||||
|
|
||||||
patch := new(drone.RepoPatch)
|
patch := new(drone.RepoPatch)
|
||||||
@ -79,6 +89,12 @@ func repoUpdate(c *cli.Context) error {
|
|||||||
patch.Visibility = &visibility
|
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 {
|
if _, err := client.RepoPatch(owner, name, patch); err != nil {
|
||||||
return err
|
return err
|
||||||
|
19
vendor/github.com/drone/drone-go/drone/types.go
generated
vendored
19
vendor/github.com/drone/drone-go/drone/types.go
generated
vendored
@ -37,15 +37,16 @@ type (
|
|||||||
|
|
||||||
// RepoPatch defines a repository patch request.
|
// RepoPatch defines a repository patch request.
|
||||||
RepoPatch struct {
|
RepoPatch struct {
|
||||||
Config *string `json:"config_file,omitempty"`
|
Config *string `json:"config_file,omitempty"`
|
||||||
IsTrusted *bool `json:"trusted,omitempty"`
|
IsTrusted *bool `json:"trusted,omitempty"`
|
||||||
IsGated *bool `json:"gated,omitempty"`
|
IsGated *bool `json:"gated,omitempty"`
|
||||||
Timeout *int64 `json:"timeout,omitempty"`
|
Timeout *int64 `json:"timeout,omitempty"`
|
||||||
Visibility *string `json:"visibility"`
|
Visibility *string `json:"visibility"`
|
||||||
AllowPull *bool `json:"allow_pr,omitempty"`
|
AllowPull *bool `json:"allow_pr,omitempty"`
|
||||||
AllowPush *bool `json:"allow_push,omitempty"`
|
AllowPush *bool `json:"allow_push,omitempty"`
|
||||||
AllowDeploy *bool `json:"allow_deploy,omitempty"`
|
AllowDeploy *bool `json:"allow_deploy,omitempty"`
|
||||||
AllowTag *bool `json:"allow_tag,omitempty"`
|
AllowTag *bool `json:"allow_tag,omitempty"`
|
||||||
|
BuildCounter *int `json:"build_counter,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build defines a build object.
|
// 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"
|
"revisionTime": "2017-05-14T17:21:45Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "qLAnM1gmgrZfYrGCNE+nKYFrJAY=",
|
"checksumSHA1": "b7aKujxkg1kYWPvSrHFKNRC3MWU=",
|
||||||
"path": "github.com/drone/drone-go/drone",
|
"path": "github.com/drone/drone-go/drone",
|
||||||
"revision": "327c9594f784216a651dbaed30731600e496dd4e",
|
"revision": "b78c6c108686d1fb224c3d9e44c33addd129bd8b",
|
||||||
"revisionTime": "2017-08-01T19:17:01Z"
|
"revisionTime": "2017-08-13T04:37:16Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "pjMV8mwWcQ0Kk9cbLWweTGiqYPk=",
|
"checksumSHA1": "pjMV8mwWcQ0Kk9cbLWweTGiqYPk=",
|
||||||
|
Loading…
Reference in New Issue
Block a user