mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51:02 +00:00
Merge remote-tracking branch 'upstream/master'
# Conflicts: # Makefile
This commit is contained in:
commit
cfd5e076e8
7 changed files with 25 additions and 8 deletions
10
Makefile
10
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:
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 366 B |
Loading…
Reference in a new issue