fix: comment

This commit is contained in:
Bo-Yi Wu 2017-05-02 09:09:36 +08:00
parent 568e8f85d2
commit c018f1a475
No known key found for this signature in database
GPG key ID: 0F84B2110C500B1F
2 changed files with 6 additions and 5 deletions

View file

@ -234,7 +234,7 @@ var Command = cli.Command{
EnvVar: "DRONE_GITEA_URL", EnvVar: "DRONE_GITEA_URL",
Name: "gitea-server", Name: "gitea-server",
Usage: "gitea server address", Usage: "gitea server address",
Value: "https://github.com", Value: "https://try.gitea.io",
}, },
cli.StringFlag{ cli.StringFlag{
EnvVar: "DRONE_GITEA_GIT_USERNAME", EnvVar: "DRONE_GITEA_GIT_USERNAME",

View file

@ -8,10 +8,9 @@ import (
"net/url" "net/url"
"strings" "strings"
"code.gitea.io/sdk/gitea"
"github.com/drone/drone/model" "github.com/drone/drone/model"
"github.com/drone/drone/remote" "github.com/drone/drone/remote"
"code.gitea.io/sdk/gitea"
) )
// Opts defines configuration options. // Opts defines configuration options.
@ -56,6 +55,8 @@ func getStatus(status string) gitea.StatusState {
return gitea.StatusFailure return gitea.StatusFailure
case model.StatusKilled: case model.StatusKilled:
return gitea.StatusFailure return gitea.StatusFailure
case model.StatusDeclined:
return gitea.StatusWarning
default: default:
return gitea.StatusFailure return gitea.StatusFailure
} }
@ -165,7 +166,7 @@ func (c *client) Auth(token, secret string) (string, error) {
return "", fmt.Errorf("Not Implemented") return "", fmt.Errorf("Not Implemented")
} }
// Teams is not supported by the Gitea driver. // Teams is supported by the Gitea driver.
func (c *client) Teams(u *model.User) ([]*model.Team, error) { func (c *client) Teams(u *model.User) ([]*model.Team, error) {
client := c.newClientToken(u.Token) client := c.newClientToken(u.Token)
orgs, err := client.ListMyOrgs() orgs, err := client.ListMyOrgs()
@ -254,7 +255,7 @@ func (c *client) FileRef(u *model.User, r *model.Repo, ref, f string) ([]byte, e
return c.newClientToken(u.Token).GetFile(r.Owner, r.Name, ref, f) return c.newClientToken(u.Token).GetFile(r.Owner, r.Name, ref, f)
} }
// Status is not supported by the Gitea driver. // Status is supported by the Gitea driver.
func (c *client) Status(u *model.User, r *model.Repo, b *model.Build, link string) error { func (c *client) Status(u *model.User, r *model.Repo, b *model.Build, link string) error {
client := c.newClientToken(u.Token) client := c.newClientToken(u.Token)