diff --git a/Makefile b/Makefile index 5539e45bb..e693c6c8a 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ -.PHONY: vendor docs release +.PHONY: vendor docs build release PACKAGES = $(shell go list ./... | grep -v /vendor/) +ifneq ($(shell uname), Darwin) + EXTLDFLAGS = -extldflags "-static" $(null) +else + EXTLDFLAGS = +endif + all: gen build_static deps: @@ -40,7 +46,7 @@ test_postgres: build: build_static build_cross build_tar build_sha build_static: - go build --ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=$(DRONE_BUILD_NUMBER)' -o release/drone github.com/drone/drone/drone + go build --ldflags '${EXTLDFLAGS}-X github.com/drone/drone/version.VersionDev=$(DRONE_BUILD_NUMBER)' -o release/drone github.com/drone/drone/drone # TODO this is getting moved to a shell script, do not alter build_cross: diff --git a/drone/server.go b/drone/server.go index 3ff2bab00..402af75ec 100644 --- a/drone/server.go +++ b/drone/server.go @@ -80,7 +80,7 @@ var serverCmd = cli.Command{ EnvVar: "DRONE_DATABASE_DRIVER,DATABASE_DRIVER", Name: "driver", Usage: "database driver", - Value: "sqite3", + Value: "sqlite3", }, cli.StringFlag{ EnvVar: "DRONE_DATABASE_DATASOURCE,DATABASE_CONFIG", diff --git a/queue/queue.go b/queue/queue.go index 3399d1987..0cdf2e6fc 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -44,7 +44,7 @@ func Remove(c context.Context, w *Work) error { return FromContext(c).Remove(w) } -// PullClose retrieves and removes the head of this queue, +// Pull retrieves and removes the head of this queue, // waiting if necessary until work becomes available. func Pull(c context.Context) *Work { return FromContext(c).Pull() diff --git a/remote/github/github.go b/remote/github/github.go index df3d25a2d..6bf806a0f 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -53,7 +53,7 @@ func New(opts Opts) (remote.Remote, error) { URL: defaultURL, Client: opts.Client, Secret: opts.Secret, - Scope: strings.Join(opts.Scopes, ","), + Scopes: opts.Scopes, PrivateMode: opts.PrivateMode, SkipVerify: opts.SkipVerify, MergeRef: opts.MergeRef, @@ -73,7 +73,7 @@ type client struct { API string Client string Secret string - Scope string + Scopes []string Machine string Username string Password string @@ -261,6 +261,7 @@ func (c *client) newConfig(redirect string) *oauth2.Config { return &oauth2.Config{ ClientID: c.Client, ClientSecret: c.Secret, + Scopes: c.Scopes, Endpoint: oauth2.Endpoint{ AuthURL: fmt.Sprintf("%s/login/oauth/authorize", c.URL), TokenURL: fmt.Sprintf("%s/login/oauth/access_token", c.URL), @@ -349,8 +350,18 @@ func (c *client) Status(u *model.User, r *model.Repo, b *model.Build, link strin } func repoStatus(client *github.Client, r *model.Repo, b *model.Build, link string) error { + context := "continuous-integration/drone" + switch b.Event { + case model.EventPull: + context += "/pr" + default: + if len(b.Event) > 0 { + context += "/" + b.Event + } + } + data := github.RepoStatus{ - Context: github.String("continuous-integration/drone"), + Context: github.String(context), State: github.String(convertStatus(b.Status)), Description: github.String(convertDesc(b.Status)), TargetURL: github.String(link), diff --git a/router/middleware/remote.go b/router/middleware/remote.go index 529f64217..69efb1d6a 100644 --- a/router/middleware/remote.go +++ b/router/middleware/remote.go @@ -48,7 +48,7 @@ func setupRemote(c *cli.Context) (remote.Remote, error) { func setupBitbucket(c *cli.Context) (remote.Remote, error) { return bitbucket.New( c.String("bitbucket-client"), - c.String("bitbucket-server"), + c.String("bitbucket-secret"), ), nil } diff --git a/static/images/dummy.png b/static/images/dummy.png index f8b12dcd8..2b428fa16 100644 Binary files a/static/images/dummy.png and b/static/images/dummy.png differ diff --git a/static/images/favicon.png b/static/images/favicon.png index c91951dc2..5ff57c620 100644 Binary files a/static/images/favicon.png and b/static/images/favicon.png differ