From a9304030316b18022a34954ecb58a4f38d40ecb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=83=E7=82=9C?= Date: Fri, 29 Sep 2017 09:49:56 +0800 Subject: [PATCH 01/91] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84874de6a8..338ce8f12d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Drone is a Continuous Delivery system built on container technology. Drone uses a simple yaml configuration file, a superset of docker-compose, to define and execute Pipelines inside Docker containers. +Drone is a Continuous Delivery system built on container technology. Drone uses a simple YAML configuration file, a superset of docker-compose, to define and execute Pipelines inside Docker containers.
From 96734122b95430a01f063d78268691013c832c55 Mon Sep 17 00:00:00 2001 From: Pavlo Kerestey Date: Thu, 12 Oct 2017 12:32:17 +0200 Subject: [PATCH 02/91] Fix typo of gogs pull request synchronized action --- remote/gogs/parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/gogs/parse.go b/remote/gogs/parse.go index 6b3c1b60d6..a9ac0788e1 100644 --- a/remote/gogs/parse.go +++ b/remote/gogs/parse.go @@ -14,7 +14,7 @@ const ( hookPullRequest = "pull_request" actionOpen = "opened" - actionSync = "synchronize" + actionSync = "synchronized" stateOpen = "open" From 517c003af2d9043f4cdd0fb280cb4776250d3f0f Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 12 Oct 2017 14:33:25 +0200 Subject: [PATCH 03/91] Urgent fix for changed auth behavior on Gitea Within the PR https://github.com/go-gitea/gitea/pull/2184 on Gitea the project dropped the standard behavior to use x-auth-basic personal access token. So we should use a proper username and the token from now on to support Gitea >= 1.2.0. Since this driver anyway only supports Gitea >= 1.2.0 this won't be a breaking change on Drone side, the only breaking change is on side of Gitea! --- remote/gitea/gitea.go | 4 ++-- remote/gitea/gitea_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/remote/gitea/gitea.go b/remote/gitea/gitea.go index e9d1fa2d25..30e3cdd2eb 100644 --- a/remote/gitea/gitea.go +++ b/remote/gitea/gitea.go @@ -271,8 +271,8 @@ func (c *client) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) { }, nil } return &model.Netrc{ - Login: u.Token, - Password: "x-oauth-basic", + Login: u.Login, + Password: u.Token, Machine: c.Machine, }, nil } diff --git a/remote/gitea/gitea_test.go b/remote/gitea/gitea_test.go index 15f00e0a7c..d0502c8858 100644 --- a/remote/gitea/gitea_test.go +++ b/remote/gitea/gitea_test.go @@ -55,8 +55,8 @@ func Test_gitea(t *testing.T) { }) netrc, _ := remote.Netrc(fakeUser, nil) g.Assert(netrc.Machine).Equal("gitea.com") - g.Assert(netrc.Login).Equal(fakeUser.Token) - g.Assert(netrc.Password).Equal("x-oauth-basic") + g.Assert(netrc.Login).Equal(fakeUser.Login) + g.Assert(netrc.Password).Equal(fakeUser.Token) }) g.It("Should return a netrc with the machine account", func() { remote, _ := New(Opts{ From 7c1b1c6d9528cdd04db9a1103d8a0bae54b68221 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 17 Oct 2017 16:51:30 +0800 Subject: [PATCH 04/91] fix wrong filter variable. Signed-off-by: Bo-Yi Wu --- cmd/drone-agent/agent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/drone-agent/agent.go b/cmd/drone-agent/agent.go index 21341c95e0..2a7ad59824 100644 --- a/cmd/drone-agent/agent.go +++ b/cmd/drone-agent/agent.go @@ -33,7 +33,7 @@ func loop(c *cli.Context) error { Labels: map[string]string{ "platform": c.String("platform"), }, - Expr: c.String("drone-filter"), + Expr: c.String("filter"), } hostname := c.String("hostname") From 8ad98fa42b1dbad17bdd33a26864328291e17487 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 17 Oct 2017 23:47:53 +0800 Subject: [PATCH 05/91] add missing filter expr content. Signed-off-by: Bo-Yi Wu --- server/rpc.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/rpc.go b/server/rpc.go index ba747e95bb..bb294f25c4 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -527,6 +527,7 @@ func (s *DroneServer) Next(c oldcontext.Context, req *proto.NextRequest) (*proto } filter := rpc.Filter{ Labels: req.GetFilter().GetLabels(), + Expr: req.GetFilter().GetExpr(), } res := new(proto.NextReply) From 0c972d8fc5960c7c9d3d9f8b9538b27c74dbef2d Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sat, 21 Oct 2017 10:29:14 -0700 Subject: [PATCH 06/91] Create BUILDING [CI SKIP] --- BUILDING | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 BUILDING diff --git a/BUILDING b/BUILDING new file mode 100644 index 0000000000..0e51069af8 --- /dev/null +++ b/BUILDING @@ -0,0 +1,13 @@ +1. Install go 1.9 or later +2. Install dependencies + + go get -u github.com/drone/drone-ui/dist + go get -u golang.org/x/net/context + go get -u golang.org/x/net/context/ctxhttp + go get -u github.com/golang/protobuf/proto + go get -u github.com/golang/protobuf/protoc-gen-go + +3. Install binaries to $GOPATH/bin + + go install github.com/drone/drone/cmd/drone-agent + go install github.com/drone/drone/cmd/drone-server From 2a2ff0550c12bb59ea6b44a93cf742f120bb0d31 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 4 Nov 2017 23:06:37 +0800 Subject: [PATCH 07/91] fix missing commit sha and wrong tag link. Signed-off-by: Bo-Yi Wu --- remote/gitea/helper.go | 4 ++-- remote/gitea/types.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/remote/gitea/helper.go b/remote/gitea/helper.go index d625dc0407..587daf3831 100644 --- a/remote/gitea/helper.go +++ b/remote/gitea/helper.go @@ -100,9 +100,9 @@ func buildFromTag(hook *pushHook) *model.Build { return &model.Build{ Event: model.EventTag, - Commit: hook.After, + Commit: hook.Sha, Ref: fmt.Sprintf("refs/tags/%s", hook.Ref), - Link: fmt.Sprintf("%s/src/%s", hook.Repo.URL, hook.Ref), + Link: fmt.Sprintf("%s/src/tag/%s", hook.Repo.URL, hook.Ref), Branch: fmt.Sprintf("refs/tags/%s", hook.Ref), Message: fmt.Sprintf("created tag %s", hook.Ref), Avatar: avatar, diff --git a/remote/gitea/types.go b/remote/gitea/types.go index f648f8de12..1671bd8128 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -1,6 +1,7 @@ package gitea type pushHook struct { + Sha string `json:"sha"` Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"` From 837ed7b84c308ddc57b9914f533413ed40363934 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 4 Nov 2017 23:19:01 +0800 Subject: [PATCH 08/91] Add testing. Signed-off-by: Bo-Yi Wu --- remote/gitea/fixtures/hooks.go | 1 + remote/gitea/helper_test.go | 31 ++++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/remote/gitea/fixtures/hooks.go b/remote/gitea/fixtures/hooks.go index 0765a8c07d..8f79ff3e2b 100644 --- a/remote/gitea/fixtures/hooks.go +++ b/remote/gitea/fixtures/hooks.go @@ -53,6 +53,7 @@ const HookPush = ` // HookPushTag is a sample Gitea tag hook const HookPushTag = `{ + "sha": "ef98532add3b2feb7a137426bba1248724367df5", "secret": "l26Un7G7HXogLAvsyf2hOA4EMARSTsR3", "ref": "v1.0.0", "ref_type": "tag", diff --git a/remote/gitea/helper_test.go b/remote/gitea/helper_test.go index 4bdcdc41bd..3ff0d8c94d 100644 --- a/remote/gitea/helper_test.go +++ b/remote/gitea/helper_test.go @@ -44,6 +44,7 @@ func Test_parse(t *testing.T) { hook, err := parsePush(buf) g.Assert(err == nil).IsTrue() g.Assert(hook.Ref).Equal("v1.0.0") + g.Assert(hook.Sha).Equal("ef98532add3b2feb7a137426bba1248724367df5") g.Assert(hook.Repo.Name).Equal("hello-world") g.Assert(hook.Repo.URL).Equal("http://gitea.golang.org/gordon/hello-world") g.Assert(hook.Repo.FullName).Equal("gordon/hello-world") @@ -105,6 +106,18 @@ func Test_parse(t *testing.T) { g.Assert(repo.Link).Equal(hook.Repo.URL) }) + g.It("Should return a Build struct from a tag hook", func() { + buf := bytes.NewBufferString(fixtures.HookPushTag) + hook, _ := parsePush(buf) + build := buildFromTag(hook) + g.Assert(build.Event).Equal(model.EventTag) + g.Assert(build.Commit).Equal(hook.Sha) + g.Assert(build.Ref).Equal("refs/tags/v1.0.0") + g.Assert(build.Branch).Equal("refs/tags/v1.0.0") + g.Assert(build.Link).Equal("http://gitea.golang.org/gordon/hello-world/src/tag/v1.0.0") + g.Assert(build.Message).Equal("created tag v1.0.0") + }) + g.It("Should return a Build struct from a pull_request hook", func() { buf := bytes.NewBufferString(fixtures.HookPullRequest) hook, _ := parsePullRequest(buf) @@ -132,9 +145,21 @@ func Test_parse(t *testing.T) { g.It("Should return a Perm struct from a Gitea Perm", func() { perms := []gitea.Permission{ - {true, true, true}, - {true, true, false}, - {true, false, false}, + { + Admin: true, + Push: true, + Pull: true, + }, + { + Admin: true, + Push: true, + Pull: false, + }, + { + Admin: true, + Push: false, + Pull: false, + }, } for _, from := range perms { perm := toPerm(&from) From 238e916fa08913da44c1fcfee22a4425195d09c4 Mon Sep 17 00:00:00 2001 From: Mark Spicer Date: Tue, 14 Nov 2017 17:01:07 -0500 Subject: [PATCH 09/91] Redirect HTTP to HTTPS when SSL is enabled. In our current drone setup, we are not using a proxy, thus letting drone handle SSL termination. In addition, we are not exposing port 80 (effectively disabling insecure drone access). When new engineers join and attempt to access drone, they are not sent a 301 and often complain that they either do not have access or that drone is broken (when in reality they are just accessing drone via the incorrect protocol/port). This commit changes the default behavior when running drone with a server-cert by only sending redirects on port 80 rather than allowing both secure and insecure access. --- cmd/drone-server/server.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index d2eb604898..c53488b8e9 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -536,7 +536,7 @@ func server(c *cli.Context) error { // start the server with tls enabled if c.String("server-cert") != "" { g.Go(func() error { - return http.ListenAndServe(":http", handler) + return http.ListenAndServe(":http", http.HandlerFunc(redirect)) }) g.Go(func() error { serve := &http.Server{ @@ -675,6 +675,15 @@ func (a *authorizer) authorize(ctx context.Context) error { return errors.New("missing agent token") } +func redirect(w http.ResponseWriter, req *http.Request) { + var serverHost string = droneserver.Config.Server.Host + serverHost = strings.TrimPrefix(serverHost, "http://") + serverHost = strings.TrimPrefix(serverHost, "https://") + req.URL.Scheme = "https" + req.URL.Host = serverHost + http.Redirect(w, req, req.URL.String(), http.StatusMovedPermanently) +} + func cacheDir() string { const base = "golang-autocert" if xdg := os.Getenv("XDG_CACHE_HOME"); xdg != "" { From 8476c90bbf84496f1d05c1bfbf875d2b77cf01b1 Mon Sep 17 00:00:00 2001 From: Mark Spicer Date: Wed, 15 Nov 2017 23:27:57 -0500 Subject: [PATCH 10/91] Set the redirect handler for lets encrypt. This commit sets the http handler to the redirect function for let's encrypt enabled drone instances. In addition, the `Strict-Transport-Security` header is added to the redirect given `header.Secure` will only be added for gin routes. This commit resolves #2261. --- cmd/drone-server/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index c53488b8e9..d9c081ff80 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -565,7 +565,7 @@ func server(c *cli.Context) error { // start the server with lets encrypt enabled // listen on ports 443 and 80 g.Go(func() error { - return http.ListenAndServe(":http", handler) + return http.ListenAndServe(":http", http.HandlerFunc(redirect)) }) g.Go(func() error { @@ -681,6 +681,9 @@ func redirect(w http.ResponseWriter, req *http.Request) { serverHost = strings.TrimPrefix(serverHost, "https://") req.URL.Scheme = "https" req.URL.Host = serverHost + + w.Header().Set("Strict-Transport-Security", "max-age=31536000") + http.Redirect(w, req, req.URL.String(), http.StatusMovedPermanently) } From 956418cae9bef51fb5855c6a7bd881ceeb4fa801 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 17 Nov 2017 14:49:01 -0800 Subject: [PATCH 11/91] add sysctls to yaml --- .../pipeline/backend/docker/convert.go | 1 + .../cncd/pipeline/pipeline/backend/types.go | 1 + .../pipeline/pipeline/frontend/metadata.go | 3 +- .../frontend/yaml/compiler/convert.go | 1 + .../pipeline/frontend/yaml/container.go | 1 + .../pipeline/frontend/yaml/linter/linter.go | 3 + .../pipeline/rpc/client_grpc_health.go | 63 +++++ .../cncd/pipeline/pipeline/rpc/health.go | 11 + .../pipeline/pipeline/rpc/proto/drone.pb.go | 240 ++++++++++++++---- .../pipeline/pipeline/rpc/proto/drone.proto | 17 ++ vendor/vendor.json | 68 ++--- 11 files changed, 321 insertions(+), 88 deletions(-) create mode 100644 vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc_health.go create mode 100644 vendor/github.com/cncd/pipeline/pipeline/rpc/health.go diff --git a/vendor/github.com/cncd/pipeline/pipeline/backend/docker/convert.go b/vendor/github.com/cncd/pipeline/pipeline/backend/docker/convert.go index 0b7b5231df..724ad09534 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/backend/docker/convert.go +++ b/vendor/github.com/cncd/pipeline/pipeline/backend/docker/convert.go @@ -49,6 +49,7 @@ func toHostConfig(proc *backend.Step) *container.HostConfig { }, Privileged: proc.Privileged, ShmSize: proc.ShmSize, + Sysctls: proc.Sysctls, } // if len(proc.VolumesFrom) != 0 { diff --git a/vendor/github.com/cncd/pipeline/pipeline/backend/types.go b/vendor/github.com/cncd/pipeline/pipeline/backend/types.go index 01d092344a..e9132d41ba 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/backend/types.go +++ b/vendor/github.com/cncd/pipeline/pipeline/backend/types.go @@ -47,6 +47,7 @@ type ( AuthConfig Auth `json:"auth_config,omitempty"` NetworkMode string `json:"network_mode,omitempty"` IpcMode string `json:"ipc_mode,omitempty"` + Sysctls map[string]string `json:"sysctls,omitempty"` } // Auth defines registry authentication credentials. diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/metadata.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/metadata.go index 574e6780fc..6c82514bdb 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/metadata.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/metadata.go @@ -33,6 +33,7 @@ type ( Remote string `json:"remote,omitempty"` Private bool `json:"private,omitempty"` Secrets []Secret `json:"secrets,omitempty"` + Branch string `json:"default_branch,omitempty"` } // Build defines runtime metadata for a build. @@ -181,7 +182,7 @@ func (m *Metadata) EnvironDrone() map[string]string { "DRONE_REPO_OWNER": owner, "DRONE_REPO_NAME": name, "DRONE_REPO_LINK": m.Repo.Link, - "DRONE_REPO_BRANCH": m.Curr.Commit.Branch, + "DRONE_REPO_BRANCH": m.Repo.Branch, "DRONE_REPO_PRIVATE": fmt.Sprintf("%v", m.Repo.Private), "DRONE_REPO_TRUSTED": "false", // TODO should this be added? "DRONE_REMOTE_URL": m.Repo.Remote, diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go index f815057086..ee39c9bc75 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/compiler/convert.go @@ -166,6 +166,7 @@ func (c *Compiler) createProcess(name string, container *yaml.Container, section MemSwapLimit: memSwapLimit, MemLimit: memLimit, ShmSize: shmSize, + Sysctls: container.Sysctls, CPUQuota: cpuQuota, CPUShares: cpuShares, CPUSet: cpuSet, diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/container.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/container.go index ffdebb625f..e5975e8c02 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/container.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/container.go @@ -55,6 +55,7 @@ type ( Ulimits libcompose.Ulimits `yaml:"ulimits,omitempty"` Volumes libcompose.Volumes `yaml:"volumes,omitempty"` Secrets Secrets `yaml:"secrets,omitempty"` + Sysctls libcompose.SliceorMap `yaml:"sysctls,omitempty"` Constraints Constraints `yaml:"when,omitempty"` Vargs map[string]interface{} `yaml:",inline"` } diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/linter/linter.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/linter/linter.go index 1facc16d45..a458e7e887 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/linter/linter.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/linter/linter.go @@ -127,6 +127,9 @@ func (l *Linter) lintTrusted(c *yaml.Container) error { if len(c.IpcMode) != 0 { return fmt.Errorf("Insufficient privileges to use ipc_mode") } + if len(c.Sysctls) != 0 { + return fmt.Errorf("Insufficient privileges to use sysctls") + } if c.Networks.Networks != nil && len(c.Networks.Networks) != 0 { return fmt.Errorf("Insufficient privileges to use networks") } diff --git a/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc_health.go b/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc_health.go new file mode 100644 index 0000000000..b2d9fc2091 --- /dev/null +++ b/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc_health.go @@ -0,0 +1,63 @@ +package rpc + +import ( + "context" + // "encoding/json" + "time" + + // "github.com/cncd/pipeline/pipeline/backend" + "github.com/cncd/pipeline/pipeline/rpc/proto" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" +) + +// generate protobuffs +// protoc --go_out=plugins=grpc,import_path=proto:. *.proto + +type healthClient struct { + client proto.HealthClient + conn *grpc.ClientConn +} + +// NewGrpcHealthClient returns a new grpc Client. +func NewGrpcHealthClient(conn *grpc.ClientConn) Health { + client := new(healthClient) + client.client = proto.NewHealthClient(conn) + client.conn = conn + return client +} + +func (c *healthClient) Close() error { + return c.conn.Close() +} + +func (c *healthClient) Check(ctx context.Context) (bool, error) { + var res *proto.HealthCheckResponse + var err error + req := new(proto.HealthCheckRequest) + + for { + res, err = c.client.Check(ctx, req) + if err == nil { + if res.GetStatus() == proto.HealthCheckResponse_SERVING { + return true, nil + } + return false, nil + } + switch grpc.Code(err) { + case + codes.Aborted, + codes.DataLoss, + codes.DeadlineExceeded, + codes.Internal, + codes.Unavailable: + // non-fatal errors + default: + return false, err + } + <-time.After(backoff) + } + + return true, nil +} diff --git a/vendor/github.com/cncd/pipeline/pipeline/rpc/health.go b/vendor/github.com/cncd/pipeline/pipeline/rpc/health.go new file mode 100644 index 0000000000..1adc02c1b0 --- /dev/null +++ b/vendor/github.com/cncd/pipeline/pipeline/rpc/health.go @@ -0,0 +1,11 @@ +package rpc + +import ( + "context" +) + +// Health defines a health-check connection. +type Health interface { + // Check returns if server is healthy or not + Check(c context.Context) (bool, error) +} diff --git a/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.pb.go b/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.pb.go index ae214962b3..b4dea7c17e 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.pb.go +++ b/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.pb.go @@ -13,6 +13,8 @@ It has these top-level messages: Line Filter Pipeline + HealthCheckRequest + HealthCheckResponse NextRequest NextReply InitRequest @@ -46,6 +48,32 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package +type HealthCheckResponse_ServingStatus int32 + +const ( + HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 + HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 + HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 +) + +var HealthCheckResponse_ServingStatus_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SERVING", + 2: "NOT_SERVING", +} +var HealthCheckResponse_ServingStatus_value = map[string]int32{ + "UNKNOWN": 0, + "SERVING": 1, + "NOT_SERVING": 2, +} + +func (x HealthCheckResponse_ServingStatus) String() string { + return proto1.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) +} +func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{6, 0} +} + type File struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Proc string `protobuf:"bytes,2,opt,name=proc" json:"proc,omitempty"` @@ -262,6 +290,38 @@ func (m *Pipeline) GetPayload() []byte { return nil } +type HealthCheckRequest struct { + Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` +} + +func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } +func (m *HealthCheckRequest) String() string { return proto1.CompactTextString(m) } +func (*HealthCheckRequest) ProtoMessage() {} +func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *HealthCheckRequest) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +type HealthCheckResponse struct { + Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=proto.HealthCheckResponse_ServingStatus" json:"status,omitempty"` +} + +func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } +func (m *HealthCheckResponse) String() string { return proto1.CompactTextString(m) } +func (*HealthCheckResponse) ProtoMessage() {} +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { + if m != nil { + return m.Status + } + return HealthCheckResponse_UNKNOWN +} + type NextRequest struct { Filter *Filter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` } @@ -269,7 +329,7 @@ type NextRequest struct { func (m *NextRequest) Reset() { *m = NextRequest{} } func (m *NextRequest) String() string { return proto1.CompactTextString(m) } func (*NextRequest) ProtoMessage() {} -func (*NextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (*NextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *NextRequest) GetFilter() *Filter { if m != nil { @@ -285,7 +345,7 @@ type NextReply struct { func (m *NextReply) Reset() { *m = NextReply{} } func (m *NextReply) String() string { return proto1.CompactTextString(m) } func (*NextReply) ProtoMessage() {} -func (*NextReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*NextReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *NextReply) GetPipeline() *Pipeline { if m != nil { @@ -302,7 +362,7 @@ type InitRequest struct { func (m *InitRequest) Reset() { *m = InitRequest{} } func (m *InitRequest) String() string { return proto1.CompactTextString(m) } func (*InitRequest) ProtoMessage() {} -func (*InitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*InitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *InitRequest) GetId() string { if m != nil { @@ -325,7 +385,7 @@ type WaitRequest struct { func (m *WaitRequest) Reset() { *m = WaitRequest{} } func (m *WaitRequest) String() string { return proto1.CompactTextString(m) } func (*WaitRequest) ProtoMessage() {} -func (*WaitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*WaitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *WaitRequest) GetId() string { if m != nil { @@ -342,7 +402,7 @@ type DoneRequest struct { func (m *DoneRequest) Reset() { *m = DoneRequest{} } func (m *DoneRequest) String() string { return proto1.CompactTextString(m) } func (*DoneRequest) ProtoMessage() {} -func (*DoneRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (*DoneRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *DoneRequest) GetId() string { if m != nil { @@ -365,7 +425,7 @@ type ExtendRequest struct { func (m *ExtendRequest) Reset() { *m = ExtendRequest{} } func (m *ExtendRequest) String() string { return proto1.CompactTextString(m) } func (*ExtendRequest) ProtoMessage() {} -func (*ExtendRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (*ExtendRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *ExtendRequest) GetId() string { if m != nil { @@ -382,7 +442,7 @@ type UploadRequest struct { func (m *UploadRequest) Reset() { *m = UploadRequest{} } func (m *UploadRequest) String() string { return proto1.CompactTextString(m) } func (*UploadRequest) ProtoMessage() {} -func (*UploadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (*UploadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *UploadRequest) GetId() string { if m != nil { @@ -406,7 +466,7 @@ type UpdateRequest struct { func (m *UpdateRequest) Reset() { *m = UpdateRequest{} } func (m *UpdateRequest) String() string { return proto1.CompactTextString(m) } func (*UpdateRequest) ProtoMessage() {} -func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } func (m *UpdateRequest) GetId() string { if m != nil { @@ -430,7 +490,7 @@ type LogRequest struct { func (m *LogRequest) Reset() { *m = LogRequest{} } func (m *LogRequest) String() string { return proto1.CompactTextString(m) } func (*LogRequest) ProtoMessage() {} -func (*LogRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +func (*LogRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } func (m *LogRequest) GetId() string { if m != nil { @@ -452,7 +512,7 @@ type Empty struct { func (m *Empty) Reset() { *m = Empty{} } func (m *Empty) String() string { return proto1.CompactTextString(m) } func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } func init() { proto1.RegisterType((*File)(nil), "proto.File") @@ -460,6 +520,8 @@ func init() { proto1.RegisterType((*Line)(nil), "proto.Line") proto1.RegisterType((*Filter)(nil), "proto.Filter") proto1.RegisterType((*Pipeline)(nil), "proto.Pipeline") + proto1.RegisterType((*HealthCheckRequest)(nil), "proto.HealthCheckRequest") + proto1.RegisterType((*HealthCheckResponse)(nil), "proto.HealthCheckResponse") proto1.RegisterType((*NextRequest)(nil), "proto.NextRequest") proto1.RegisterType((*NextReply)(nil), "proto.NextReply") proto1.RegisterType((*InitRequest)(nil), "proto.InitRequest") @@ -470,6 +532,7 @@ func init() { proto1.RegisterType((*UpdateRequest)(nil), "proto.UpdateRequest") proto1.RegisterType((*LogRequest)(nil), "proto.LogRequest") proto1.RegisterType((*Empty)(nil), "proto.Empty") + proto1.RegisterEnum("proto.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) } // Reference imports to suppress errors if they are not otherwise used. @@ -775,50 +838,121 @@ var _Drone_serviceDesc = grpc.ServiceDesc{ Metadata: "drone.proto", } +// Client API for Health service + +type HealthClient interface { + Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) +} + +type healthClient struct { + cc *grpc.ClientConn +} + +func NewHealthClient(cc *grpc.ClientConn) HealthClient { + return &healthClient{cc} +} + +func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { + out := new(HealthCheckResponse) + err := grpc.Invoke(ctx, "/proto.Health/Check", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Health service + +type HealthServer interface { + Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) +} + +func RegisterHealthServer(s *grpc.Server, srv HealthServer) { + s.RegisterService(&_Health_serviceDesc, srv) +} + +func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HealthCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthServer).Check(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Health/Check", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Health_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.Health", + HandlerType: (*HealthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Check", + Handler: _Health_Check_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "drone.proto", +} + func init() { proto1.RegisterFile("drone.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 661 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xed, 0x6a, 0xd4, 0x4c, - 0x14, 0x7e, 0xb3, 0xf9, 0xe8, 0xee, 0x49, 0xfb, 0x5a, 0x87, 0x2a, 0x71, 0x45, 0xba, 0x04, 0x84, - 0x55, 0x61, 0xc1, 0x55, 0xb0, 0x0a, 0x82, 0xd2, 0x0f, 0x10, 0xd6, 0x22, 0x23, 0xe2, 0x4f, 0x49, - 0x9b, 0xd3, 0x3a, 0x98, 0xcd, 0xc4, 0x64, 0x2a, 0x1b, 0x2f, 0xc1, 0x6b, 0xf0, 0xea, 0xbc, 0x07, - 0xff, 0xcb, 0x99, 0x99, 0xa4, 0xd9, 0x76, 0x2b, 0x48, 0x7f, 0xed, 0xf9, 0x78, 0x66, 0xce, 0x73, - 0x9e, 0x67, 0xb2, 0x10, 0xa6, 0xa5, 0xcc, 0x71, 0x52, 0x94, 0x52, 0x49, 0xe6, 0xeb, 0x9f, 0xf8, - 0x97, 0x03, 0xde, 0x81, 0xc8, 0x90, 0x31, 0xf0, 0xf2, 0x64, 0x8e, 0x91, 0x33, 0x72, 0xc6, 0x03, - 0xae, 0x63, 0xaa, 0x15, 0xa5, 0x3c, 0x8e, 0x7a, 0xa6, 0x46, 0x31, 0xd5, 0xe6, 0x62, 0x8e, 0x91, - 0x6b, 0x6a, 0x14, 0x53, 0x4d, 0x51, 0xcd, 0x1b, 0x39, 0x63, 0x97, 0xeb, 0x98, 0x6a, 0x95, 0xf8, - 0x8e, 0x91, 0x3f, 0x72, 0xc6, 0x3e, 0xd7, 0x31, 0xd5, 0xd2, 0x44, 0x25, 0x51, 0x30, 0x72, 0xc6, - 0xeb, 0x5c, 0xc7, 0xec, 0x01, 0x78, 0x73, 0x54, 0x49, 0xb4, 0x36, 0x72, 0xc7, 0xe1, 0xf4, 0x96, - 0x61, 0x37, 0x21, 0x4a, 0x93, 0xb7, 0xa8, 0x92, 0xfd, 0x5c, 0x95, 0x35, 0xd7, 0x90, 0xe1, 0x33, - 0x18, 0xb4, 0x25, 0xb6, 0x09, 0xee, 0x17, 0xac, 0x2d, 0x5d, 0x0a, 0xd9, 0x16, 0xf8, 0xdf, 0x92, - 0xec, 0x0c, 0x2d, 0x5d, 0x93, 0xbc, 0xe8, 0xed, 0x38, 0xf1, 0x4f, 0x07, 0xfc, 0xf7, 0x2a, 0x51, - 0xab, 0xb7, 0xbc, 0x0d, 0x01, 0x2e, 0x84, 0xc2, 0x54, 0x1f, 0xec, 0x73, 0x9b, 0xb1, 0xbb, 0x30, - 0xa0, 0xe8, 0xd3, 0xb1, 0x4c, 0xcd, 0xba, 0x3e, 0xef, 0x53, 0x61, 0x57, 0xa6, 0xc8, 0x22, 0x58, - 0xab, 0x54, 0x52, 0xd2, 0x29, 0xb3, 0x75, 0x93, 0xb2, 0x21, 0xf4, 0x4f, 0x44, 0x2e, 0xaa, 0xcf, - 0x98, 0xea, 0xe5, 0x5d, 0xde, 0xe6, 0x44, 0x11, 0xcb, 0x52, 0x96, 0x5a, 0x81, 0x01, 0x37, 0x49, - 0xcc, 0xc1, 0x9b, 0x89, 0xfc, 0x5c, 0x6e, 0x67, 0x59, 0x6e, 0x2d, 0x6d, 0xaf, 0x23, 0xed, 0x26, - 0xb8, 0x85, 0xac, 0x2c, 0x25, 0x0a, 0xa9, 0x22, 0xcf, 0x94, 0x66, 0x32, 0xe0, 0x14, 0xc6, 0x3f, - 0x1c, 0x08, 0x0e, 0x44, 0xa6, 0xb0, 0x64, 0x8f, 0x21, 0xc8, 0x92, 0x23, 0xcc, 0xaa, 0xc8, 0xd1, - 0x1a, 0xdf, 0x39, 0xd7, 0x58, 0x61, 0x39, 0x99, 0xe9, 0x9e, 0xd1, 0xd9, 0x02, 0x69, 0x2a, 0x2e, - 0x8a, 0xb2, 0x31, 0x9e, 0xe2, 0xe1, 0x73, 0x08, 0x3b, 0xd0, 0x7f, 0xd2, 0xff, 0x10, 0xfa, 0xef, - 0x44, 0x81, 0x19, 0x2d, 0xf9, 0x3f, 0xf4, 0x44, 0x6a, 0x8f, 0xf5, 0x44, 0x4a, 0x42, 0xd2, 0x52, - 0x44, 0xdf, 0xec, 0xd8, 0xa4, 0xd4, 0x29, 0x92, 0x3a, 0x93, 0x49, 0xaa, 0x57, 0x5d, 0xe7, 0x4d, - 0x1a, 0x3f, 0x85, 0xf0, 0x10, 0x17, 0x8a, 0xe3, 0xd7, 0x33, 0xac, 0x14, 0xbb, 0x0f, 0xc1, 0x89, - 0xde, 0x45, 0x5f, 0x1b, 0x4e, 0x37, 0x96, 0x16, 0xe4, 0xb6, 0x19, 0xef, 0xc0, 0xc0, 0x9c, 0x2a, - 0xb2, 0x9a, 0x3d, 0x82, 0x7e, 0x61, 0x29, 0xd9, 0x53, 0x37, 0xec, 0xa9, 0x86, 0x29, 0x6f, 0x01, - 0xf1, 0x6b, 0x08, 0xdf, 0xe4, 0xa2, 0x9d, 0x77, 0x71, 0x85, 0x18, 0xfc, 0x8a, 0x5e, 0x97, 0x5e, - 0x20, 0x9c, 0xae, 0xdb, 0x8b, 0xf4, 0x8b, 0xe3, 0xa6, 0x15, 0xdf, 0x83, 0xf0, 0x63, 0x72, 0xe5, - 0x15, 0x34, 0x61, 0x4f, 0xe6, 0x78, 0x9d, 0x09, 0xdb, 0xb0, 0xb1, 0xbf, 0x50, 0x98, 0xa7, 0x57, - 0xcd, 0x78, 0x05, 0x1b, 0x1f, 0x0a, 0xd2, 0xef, 0xaa, 0x29, 0xdb, 0xe0, 0x9d, 0x88, 0xac, 0x19, - 0x12, 0x76, 0x3e, 0x45, 0xae, 0x1b, 0xf1, 0x2e, 0xdd, 0x90, 0xd2, 0xcc, 0x6b, 0xf0, 0x7c, 0x09, - 0x30, 0x93, 0xa7, 0x7f, 0xe1, 0xa0, 0x3d, 0x59, 0xe6, 0x40, 0x9f, 0x07, 0xd7, 0x8d, 0x78, 0x0d, - 0xfc, 0xfd, 0x79, 0xa1, 0xea, 0xe9, 0xef, 0x1e, 0xf8, 0x7b, 0xf4, 0x87, 0xc6, 0x26, 0xe0, 0x91, - 0xb1, 0x8c, 0x59, 0x74, 0xe7, 0x6d, 0x0c, 0x37, 0x97, 0x6a, 0x45, 0x56, 0xc7, 0xff, 0xb1, 0x87, - 0xe0, 0x91, 0x9d, 0x2d, 0xbe, 0xe3, 0xed, 0xb0, 0xa1, 0xac, 0x67, 0x18, 0x2c, 0xf9, 0xd6, 0x62, - 0x3b, 0x26, 0xae, 0xc2, 0x92, 0x89, 0x2d, 0xb6, 0xe3, 0xe8, 0x25, 0xec, 0x04, 0x02, 0xe3, 0x16, - 0xdb, 0x6a, 0x3a, 0x5d, 0xf3, 0x56, 0xe1, 0x8d, 0xf4, 0x2d, 0x7e, 0xc9, 0x89, 0xd5, 0x78, 0x32, - 0xbb, 0x83, 0xef, 0x78, 0x7f, 0x09, 0x3f, 0x06, 0x77, 0x26, 0x4f, 0xd9, 0xcd, 0x46, 0xf0, 0xd6, - 0xa1, 0x8b, 0xc8, 0xa3, 0x40, 0xa7, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x21, 0xb6, - 0xce, 0x4e, 0x06, 0x00, 0x00, + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x5f, 0x4f, 0xd3, 0x50, + 0x14, 0xa7, 0x5b, 0xdb, 0x6d, 0xa7, 0x0c, 0xe6, 0x15, 0x4d, 0x99, 0x31, 0x2c, 0x4d, 0x4c, 0xa6, + 0x26, 0x4d, 0x9c, 0x26, 0x22, 0x89, 0x06, 0x03, 0x43, 0x88, 0x73, 0x98, 0x3b, 0x91, 0x47, 0x52, + 0xd6, 0x0b, 0x34, 0x74, 0x6d, 0x6d, 0xef, 0xc8, 0xe6, 0x47, 0xf0, 0xd5, 0x57, 0x3f, 0x9d, 0xdf, + 0xc1, 0x77, 0x73, 0xee, 0x6d, 0x4b, 0x07, 0x9b, 0x89, 0xe1, 0xa9, 0xe7, 0xcf, 0xef, 0xdc, 0x73, + 0xce, 0xef, 0xd7, 0x7b, 0xc1, 0x70, 0xe3, 0x30, 0x60, 0x76, 0x14, 0x87, 0x3c, 0x24, 0x9a, 0xf8, + 0x58, 0xbf, 0x15, 0x50, 0xf7, 0x3c, 0x9f, 0x11, 0x02, 0x6a, 0xe0, 0x8c, 0x98, 0xa9, 0xb4, 0x94, + 0x76, 0x8d, 0x0a, 0x1b, 0x63, 0x51, 0x1c, 0x0e, 0xcd, 0x92, 0x8c, 0xa1, 0x8d, 0xb1, 0x91, 0x37, + 0x62, 0x66, 0x59, 0xc6, 0xd0, 0xc6, 0x18, 0xc7, 0x98, 0xda, 0x52, 0xda, 0x65, 0x2a, 0x6c, 0x8c, + 0x25, 0xde, 0x77, 0x66, 0x6a, 0x2d, 0xa5, 0xad, 0x51, 0x61, 0x63, 0xcc, 0x75, 0xb8, 0x63, 0xea, + 0x2d, 0xa5, 0xbd, 0x4c, 0x85, 0x4d, 0x9e, 0x82, 0x3a, 0x62, 0xdc, 0x31, 0x2b, 0xad, 0x72, 0xdb, + 0xe8, 0x3c, 0x90, 0xd3, 0xd9, 0x38, 0x92, 0xfd, 0x89, 0x71, 0xa7, 0x1b, 0xf0, 0x78, 0x4a, 0x05, + 0xa4, 0xf9, 0x1a, 0x6a, 0x79, 0x88, 0x34, 0xa0, 0x7c, 0xc9, 0xa6, 0xe9, 0xb8, 0x68, 0x92, 0x35, + 0xd0, 0xae, 0x1c, 0x7f, 0xcc, 0xd2, 0x71, 0xa5, 0xb3, 0x55, 0xda, 0x54, 0xac, 0x5f, 0x0a, 0x68, + 0x03, 0xee, 0xf0, 0xf9, 0x5b, 0x3e, 0x04, 0x9d, 0x4d, 0x3c, 0xce, 0x5c, 0x51, 0x58, 0xa5, 0xa9, + 0x47, 0x1e, 0x41, 0x0d, 0xad, 0x93, 0x61, 0xe8, 0xca, 0x75, 0x35, 0x5a, 0xc5, 0xc0, 0x4e, 0xe8, + 0x32, 0x62, 0x42, 0x25, 0xe1, 0x4e, 0x8c, 0x55, 0x72, 0xeb, 0xcc, 0x25, 0x4d, 0xa8, 0x9e, 0x79, + 0x81, 0x97, 0x5c, 0x30, 0x57, 0x2c, 0x5f, 0xa6, 0xb9, 0x8f, 0x23, 0xb2, 0x38, 0x0e, 0x63, 0xc1, + 0x40, 0x8d, 0x4a, 0xc7, 0xa2, 0xa0, 0xf6, 0xbc, 0xe0, 0x9a, 0x6e, 0x65, 0x96, 0x6e, 0x41, 0x6d, + 0xa9, 0x40, 0x6d, 0x03, 0xca, 0x51, 0x98, 0xa4, 0x23, 0xa1, 0x89, 0x91, 0x70, 0xcc, 0xc5, 0x24, + 0x35, 0x8a, 0xa6, 0xf5, 0x43, 0x01, 0x7d, 0xcf, 0xf3, 0x39, 0x8b, 0xc9, 0x0b, 0xd0, 0x7d, 0xe7, + 0x94, 0xf9, 0x89, 0xa9, 0x08, 0x8e, 0xd7, 0xaf, 0x39, 0xe6, 0x2c, 0xb6, 0x7b, 0x22, 0x27, 0x79, + 0x4e, 0x81, 0xd8, 0x95, 0x4d, 0xa2, 0x38, 0x13, 0x1e, 0xed, 0xe6, 0x1b, 0x30, 0x0a, 0xd0, 0xff, + 0xe2, 0xbf, 0x0f, 0xd5, 0xcf, 0x5e, 0xc4, 0x7c, 0x5c, 0x72, 0x05, 0x4a, 0x9e, 0x9b, 0x96, 0x95, + 0x3c, 0x17, 0x89, 0xc4, 0xa5, 0x70, 0x7c, 0xb9, 0x63, 0xe6, 0x62, 0x26, 0x72, 0xa6, 0x7e, 0xe8, + 0xb8, 0x62, 0xd5, 0x65, 0x9a, 0xb9, 0x96, 0x0d, 0x64, 0x9f, 0x39, 0x3e, 0xbf, 0xd8, 0xb9, 0x60, + 0xc3, 0x4b, 0xca, 0xbe, 0x8d, 0x59, 0x22, 0xf0, 0x09, 0x8b, 0xaf, 0xbc, 0x61, 0x26, 0x6f, 0xe6, + 0x5a, 0x3f, 0x15, 0xb8, 0x3f, 0x53, 0x90, 0x44, 0x61, 0x90, 0x30, 0xb2, 0x0d, 0x7a, 0xc2, 0x1d, + 0x3e, 0x4e, 0x44, 0xc1, 0x4a, 0xa7, 0x9d, 0x32, 0x33, 0x07, 0x6b, 0x0f, 0xf0, 0xac, 0xe0, 0x7c, + 0x20, 0xf0, 0x34, 0xad, 0xb3, 0xb6, 0xa0, 0x3e, 0x93, 0x20, 0x06, 0x54, 0x8e, 0xfa, 0x1f, 0xfb, + 0x87, 0xc7, 0xfd, 0xc6, 0x12, 0x3a, 0x83, 0x2e, 0xfd, 0x7a, 0xd0, 0xff, 0xd0, 0x50, 0xc8, 0x2a, + 0x18, 0xfd, 0xc3, 0x2f, 0x27, 0x59, 0xa0, 0x64, 0xbd, 0x02, 0xa3, 0xcf, 0x26, 0x3c, 0x1b, 0xff, + 0x09, 0xe8, 0x67, 0x42, 0x11, 0x31, 0x8c, 0xd1, 0xa9, 0xcf, 0xc8, 0x44, 0xd3, 0xa4, 0xb5, 0x09, + 0x35, 0x59, 0x15, 0xf9, 0x53, 0xf2, 0x1c, 0xaa, 0x51, 0x4a, 0x6c, 0x5a, 0xb5, 0x9a, 0x56, 0x65, + 0x7c, 0xd3, 0x1c, 0x60, 0xbd, 0x07, 0xe3, 0x20, 0xf0, 0xf2, 0x7e, 0x37, 0x85, 0xb0, 0x40, 0xc3, + 0xa5, 0xa4, 0x7c, 0x46, 0x67, 0x39, 0x3d, 0x48, 0xdc, 0x1b, 0x2a, 0x53, 0xd6, 0x63, 0x30, 0x8e, + 0x9d, 0x85, 0x47, 0x60, 0x87, 0xdd, 0x30, 0x60, 0x77, 0xe9, 0xb0, 0x01, 0xf5, 0xee, 0x84, 0xb3, + 0xc0, 0x5d, 0xd4, 0x63, 0x1b, 0xea, 0x47, 0x11, 0xfe, 0x05, 0x8b, 0xba, 0x6c, 0x80, 0x7a, 0xe6, + 0xf9, 0x59, 0x13, 0xa3, 0xf0, 0xa0, 0x50, 0x91, 0xb0, 0x76, 0xf0, 0x04, 0x17, 0x7b, 0xde, 0x61, + 0xce, 0xb7, 0x00, 0xbd, 0xf0, 0xfc, 0x1f, 0x33, 0x08, 0x4d, 0x66, 0x67, 0xc0, 0x4b, 0x4e, 0x45, + 0xc2, 0xaa, 0x80, 0xd6, 0x1d, 0x45, 0x7c, 0xda, 0xf9, 0x53, 0x02, 0x6d, 0x17, 0x9f, 0x65, 0x62, + 0x83, 0x8a, 0xc2, 0x12, 0x92, 0xa2, 0x0b, 0xff, 0x46, 0xb3, 0x31, 0x13, 0x8b, 0xfc, 0xa9, 0xb5, + 0x44, 0x9e, 0x81, 0x8a, 0x72, 0xe6, 0xf8, 0x82, 0xb6, 0xcd, 0x6c, 0x64, 0xd1, 0x43, 0x62, 0x51, + 0xb7, 0x1c, 0x5b, 0x10, 0x71, 0x1e, 0x16, 0x45, 0xcc, 0xb1, 0x05, 0x45, 0x6f, 0x61, 0x6d, 0xd0, + 0xa5, 0x5a, 0x64, 0x2d, 0xcb, 0x14, 0xc5, 0x9b, 0x87, 0x97, 0xd4, 0xe7, 0xf8, 0x19, 0x25, 0xe6, + 0xe3, 0x51, 0xec, 0x02, 0xbe, 0xa0, 0xfd, 0x2d, 0x7c, 0x1b, 0xca, 0xbd, 0xf0, 0x9c, 0xdc, 0xcb, + 0x08, 0xcf, 0x15, 0xba, 0x89, 0xec, 0xec, 0x83, 0x2e, 0x6f, 0x39, 0x79, 0x07, 0x9a, 0xb8, 0xe9, + 0x64, 0x7d, 0xde, 0xed, 0x97, 0xd5, 0xcd, 0xc5, 0x0f, 0xc3, 0xa9, 0x2e, 0x52, 0x2f, 0xff, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x59, 0x78, 0xda, 0x5d, 0x5e, 0x07, 0x00, 0x00, } diff --git a/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.proto b/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.proto index 49ec122e66..97345e291e 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.proto +++ b/vendor/github.com/cncd/pipeline/pipeline/rpc/proto/drone.proto @@ -39,6 +39,19 @@ message Pipeline { bytes payload = 3; } +message HealthCheckRequest { + string service = 1; +} + +message HealthCheckResponse { + enum ServingStatus { + UNKNOWN = 0; + SERVING = 1; + NOT_SERVING = 2; + } + ServingStatus status = 1; +} + service Drone { rpc Next (NextRequest) returns (NextReply) {} rpc Init (InitRequest) returns (Empty) {} @@ -50,6 +63,10 @@ service Drone { rpc Log (LogRequest) returns (Empty) {} } +service Health { + rpc Check(HealthCheckRequest) returns (HealthCheckResponse); +} + // // next // diff --git a/vendor/vendor.json b/vendor/vendor.json index 3cf7bd4c55..2541178b77 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -195,80 +195,80 @@ { "checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=", "path": "github.com/cncd/pipeline/pipeline", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "gc+efbEPGdecp6I2ezd6J3+UL3o=", + "checksumSHA1": "iRKdpheRPBTP0DKTQH7zmE2PI34=", "path": "github.com/cncd/pipeline/pipeline/backend", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "IIuOItGMhYP6kLtlZWYBO+liSx4=", + "checksumSHA1": "EHJGG1USUliP8nzNWV/axO5KLzw=", "path": "github.com/cncd/pipeline/pipeline/backend/docker", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "2A3+CnkMfvvO4oRkjQKqi44no0g=", + "checksumSHA1": "HWV2BBLXS4gY5eLJeNIg7Z6nAOA=", "path": "github.com/cncd/pipeline/pipeline/frontend", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "VZEf4sUe0jVi3TPXE+gfjpKtXFA=", + "checksumSHA1": "a31aG4R3OK0t87whuZ5IWbSD1uc=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "Bso8L5AC/YA4k+YVfIg+m2bMLmU=", + "checksumSHA1": "cdjOSSSS5Gzx7gRLNvObQvNJWYg=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "tExCYtVZoTnfEkEQL7r/megor8I=", + "checksumSHA1": "Sj2VYU+asWToYriIqcinav5MJZo=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { "checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { "checksumSHA1": "L7Q5qJmPITNmvFEEaj5MPwCWFRk=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/types", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { "checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=", "path": "github.com/cncd/pipeline/pipeline/interrupt", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { "checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=", "path": "github.com/cncd/pipeline/pipeline/multipart", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "pyaqbQRdFkOGTE0mSNou27ikvfs=", + "checksumSHA1": "5oiGroE8hLXcj9hcZ+GGoBEm3o0=", "path": "github.com/cncd/pipeline/pipeline/rpc", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { - "checksumSHA1": "huYd+DhpBP/0kHMAC0mPZAZBmnw=", + "checksumSHA1": "N+3wNQ8hc/6yrh3FxbaxkEVwrkY=", "path": "github.com/cncd/pipeline/pipeline/rpc/proto", - "revision": "b7427ae1fb86bb04e2997e5f3a1eec75c4b056ef", - "revisionTime": "2017-09-14T17:45:32Z" + "revision": "82706703c87f88a632674484e095e494c0e30e34", + "revisionTime": "2017-11-17T22:46:28Z" }, { "checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=", From 63973955702b5d35c6250ec0c5b33ff2a35314cc Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 28 Nov 2017 11:36:22 -0800 Subject: [PATCH 12/91] Use 5s backoff with 1m timeout fetching .drone.yml --- remote/remote.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remote/remote.go b/remote/remote.go index bdd441fcc9..6af15ab80a 100644 --- a/remote/remote.go +++ b/remote/remote.go @@ -103,12 +103,12 @@ func Perm(c context.Context, u *model.User, owner, repo string) (*model.Perm, er // File fetches a file from the remote repository and returns in string format. func File(c context.Context, u *model.User, r *model.Repo, b *model.Build, f string) (out []byte, err error) { - for i := 0; i < 5; i++ { + for i := 0; i < 12; i++ { out, err = FromContext(c).File(u, r, b, f) if err == nil { return } - time.Sleep(1 * time.Second) + time.Sleep(5 * time.Second) } return } From b6a9645b31cb3469a66499a932a48816f82736dd Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 1 Dec 2017 12:24:19 +0800 Subject: [PATCH 13/91] fix(drone-server): missing default branch name in metadata. --- server/hook.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/hook.go b/server/hook.go index ba81fc4c99..9cf378cb9d 100644 --- a/server/hook.go +++ b/server/hook.go @@ -352,6 +352,7 @@ func metadataFromStruct(repo *model.Repo, build, last *model.Build, proc *model. Link: repo.Link, Remote: repo.Clone, Private: repo.IsPrivate, + Branch: repo.Branch, }, Curr: frontend.Build{ Number: build.Number, From 970080e444995bc529357c27251af2c01a3457ae Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 1 Dec 2017 09:22:30 -0800 Subject: [PATCH 14/91] use a backoff when fetching the yaml --- remote/remote.go | 15 +++++++++++++++ server/hook.go | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/remote/remote.go b/remote/remote.go index 6af15ab80a..929d8c3a23 100644 --- a/remote/remote.go +++ b/remote/remote.go @@ -154,3 +154,18 @@ func Refresh(c context.Context, u *model.User) (bool, error) { } return refresher.Refresh(u) } + +// FileBackoff fetches the file using an exponential backoff. +// TODO replace this with a proper backoff +func FileBackoff(remote Remote, u *model.User, r *model.Repo, b *model.Build, f string) (out []byte, err error) { + for i := 0; i < 5; i++ { + select { + case <-time.After(time.Second * time.Duration(i)): + out, err = remote.File(u, r, b, f) + if err == nil { + return + } + } + } + return +} diff --git a/server/hook.go b/server/hook.go index ba81fc4c99..67757466e4 100644 --- a/server/hook.go +++ b/server/hook.go @@ -143,7 +143,7 @@ func PostHook(c *gin.Context) { } // fetch the build file from the database - confb, err := remote_.File(user, repo, build, repo.Config) + confb, err := remote.FileBackoff(remote_, user, repo, build, repo.Config) if err != nil { logrus.Errorf("error: %s: cannot find %s in %s: %s", repo.FullName, repo.Config, build.Ref, err) c.AbortWithError(404, err) From cf3089804226dd4555a1d9eeefa4bafd302b24e5 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 1 Dec 2017 13:38:55 -0800 Subject: [PATCH 15/91] enable instance in when clause --- server/hook.go | 7 +++ .../pipeline/frontend/yaml/constraint.go | 1 + vendor/vendor.json | 54 +++++++++---------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/server/hook.go b/server/hook.go index 67757466e4..0b1b4ec1f4 100644 --- a/server/hook.go +++ b/server/hook.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "math/rand" + "net/url" "regexp" "strconv" "strings" @@ -346,6 +347,11 @@ func PostHook(c *gin.Context) { // return the metadata from the cli context. func metadataFromStruct(repo *model.Repo, build, last *model.Build, proc *model.Proc, link string) frontend.Metadata { + host := link + uri, err := url.Parse(link) + if err == nil { + host = uri.Host + } return frontend.Metadata{ Repo: frontend.Repo{ Name: repo.FullName, @@ -405,6 +411,7 @@ func metadataFromStruct(repo *model.Repo, build, last *model.Build, proc *model. Sys: frontend.System{ Name: "drone", Link: link, + Host: host, Arch: "linux/amd64", }, } diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go index ad193b286c..1b1c8b1293 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go @@ -45,6 +45,7 @@ func (c *Constraints) Match(metadata frontend.Metadata) bool { c.Branch.Match(metadata.Curr.Commit.Branch) && c.Repo.Match(metadata.Repo.Name) && c.Ref.Match(metadata.Curr.Commit.Ref) && + c.Instance.Match(metadata.Sys.Host) && c.Matrix.Match(metadata.Job.Matrix) } diff --git a/vendor/vendor.json b/vendor/vendor.json index 2541178b77..e450b6b95a 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -195,80 +195,80 @@ { "checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=", "path": "github.com/cncd/pipeline/pipeline", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "iRKdpheRPBTP0DKTQH7zmE2PI34=", "path": "github.com/cncd/pipeline/pipeline/backend", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "EHJGG1USUliP8nzNWV/axO5KLzw=", "path": "github.com/cncd/pipeline/pipeline/backend/docker", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "HWV2BBLXS4gY5eLJeNIg7Z6nAOA=", "path": "github.com/cncd/pipeline/pipeline/frontend", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { - "checksumSHA1": "a31aG4R3OK0t87whuZ5IWbSD1uc=", + "checksumSHA1": "ncGH2MfHDtM7/dNzj2i+lnXFnf4=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "cdjOSSSS5Gzx7gRLNvObQvNJWYg=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "Sj2VYU+asWToYriIqcinav5MJZo=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "L7Q5qJmPITNmvFEEaj5MPwCWFRk=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/types", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=", "path": "github.com/cncd/pipeline/pipeline/interrupt", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=", "path": "github.com/cncd/pipeline/pipeline/multipart", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "5oiGroE8hLXcj9hcZ+GGoBEm3o0=", "path": "github.com/cncd/pipeline/pipeline/rpc", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "N+3wNQ8hc/6yrh3FxbaxkEVwrkY=", "path": "github.com/cncd/pipeline/pipeline/rpc/proto", - "revision": "82706703c87f88a632674484e095e494c0e30e34", - "revisionTime": "2017-11-17T22:46:28Z" + "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", + "revisionTime": "2017-12-01T21:30:15Z" }, { "checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=", From 8ff7cdc6ecb17ba98b160ece42f1c21586700bf6 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 3 Dec 2017 11:08:11 -0800 Subject: [PATCH 16/91] bump minor version --- .drone.yml | 4 ++-- version/version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6511abb33c..bb3ab4c6c0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -118,7 +118,7 @@ pipeline: image: plugins/docker repo: drone/drone secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.2 ] + tag: [ 0.8, 0.8.3 ] when: event: tag @@ -127,7 +127,7 @@ pipeline: repo: drone/agent dockerfile: Dockerfile.agent secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.2 ] + tag: [ 0.8, 0.8.3 ] when: event: tag diff --git a/version/version.go b/version/version.go index d5a2ef11b3..f329dab173 100644 --- a/version/version.go +++ b/version/version.go @@ -8,7 +8,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner. VersionMinor int64 = 8 // VersionPatch is for backwards-compatible bug fixes. - VersionPatch int64 = 2 + VersionPatch int64 = 3 // VersionPre indicates prerelease. VersionPre string // VersionDev indicates development branch. Releases will be empty string. From ebe4c349ef9311eb84138e85e0a45bad32a6c319 Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Wed, 6 Dec 2017 09:30:40 +0100 Subject: [PATCH 17/91] Fallback yaml patch --- server/hook.go | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/server/hook.go b/server/hook.go index 0b1b4ec1f4..c6925f6929 100644 --- a/server/hook.go +++ b/server/hook.go @@ -31,6 +31,9 @@ import ( "github.com/cncd/pipeline/pipeline/rpc" "github.com/cncd/pubsub" "github.com/cncd/queue" + "net/http" + "os" + "io/ioutil" ) // @@ -53,6 +56,7 @@ func GetQueueInfo(c *gin.Context) { } func PostHook(c *gin.Context) { + remote_ := remote.FromContext(c) tmprepo, build, err := remote_.Hook(c.Request) @@ -143,13 +147,39 @@ func PostHook(c *gin.Context) { } } + var confb []byte // fetch the build file from the database - confb, err := remote.FileBackoff(remote_, user, repo, build, repo.Config) + repo_confb, err := remote.FileBackoff(remote_, user, repo, build, repo.Config) + if err != nil { - logrus.Errorf("error: %s: cannot find %s in %s: %s", repo.FullName, repo.Config, build.Ref, err) - c.AbortWithError(404, err) - return + // if failed, check if we have a fallback in the server config + if len(os.Getenv("DRONE_SERVER_YAML_FALLBACK")) > 0 { + // download it + resp, err := http.Get(fmt.Sprintf("%s?user=%s&repo=%s", + os.Getenv("DRONE_SERVER_YAML_FALLBACK"), user.Login, repo.FullName)) + if err != nil { + logrus.Errorf("failure to get build config for %s. %s", repo.FullName, err) + c.AbortWithError(404, err) + return + } + defer resp.Body.Close() + fallback_confb, err := ioutil.ReadAll(resp.Body) + + if err != nil { + logrus.Errorf("failure to get fallback build config %s for %s. %s", + os.Getenv("DRONE_SERVER_YAML_FALLBACK") , repo.FullName, err) + c.AbortWithError(404, err) + return + } + // Use fallback as config + confb = fallback_confb + } + } else { + // Use repo config + confb = repo_confb } + + // fetch the build file from the database sha := shasum(confb) conf, err := Config.Storage.Config.ConfigFind(repo, sha) if err != nil { From 453f415cc493e358c5cf0a7050e271059c51c072 Mon Sep 17 00:00:00 2001 From: Jesse Lang Date: Tue, 19 Dec 2017 20:08:55 -0600 Subject: [PATCH 18/91] Validate DRONE_HOST to ensure it contains a scheme and not a trailing slash --- cmd/drone-server/server.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index d9c081ff80..02fc150785 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -477,6 +477,18 @@ func server(c *cli.Context) error { logrus.Fatalln("DRONE_HOST is not properly configured") } + if !strings.Contains(c.String("server-host"), "://") { + logrus.Fatalln( + "DRONE_HOST must be :// format", + ) + } + + if !strings.HasSuffix(c.String("server-host"), "/") { + logrus.Fatalln( + "DRONE_HOST must not have trailing slash", + ) + } + remote_, err := SetupRemote(c) if err != nil { logrus.Fatal(err) From 296a4f1977deec5335579501c1046efb6dcb258d Mon Sep 17 00:00:00 2001 From: Elena Grahovac Date: Wed, 20 Dec 2017 12:12:38 +0100 Subject: [PATCH 19/91] Log the exact error in case of 'error setting commit status' --- server/build.go | 4 ++-- server/hook.go | 2 +- server/rpc.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/build.go b/server/build.go index 245467edc7..43d391d813 100644 --- a/server/build.go +++ b/server/build.go @@ -301,7 +301,7 @@ func PostApproval(c *gin.Context) { uri := fmt.Sprintf("%s/%s/%d", httputil.GetURL(c.Request), repo.FullName, build.Number) err = remote_.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } }() @@ -427,7 +427,7 @@ func PostDecline(c *gin.Context) { uri := fmt.Sprintf("%s/%s/%d", httputil.GetURL(c.Request), repo.FullName, build.Number) err = remote_.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } c.JSON(200, build) diff --git a/server/hook.go b/server/hook.go index 0a8d0dec97..d213b61932 100644 --- a/server/hook.go +++ b/server/hook.go @@ -247,7 +247,7 @@ func PostHook(c *gin.Context) { uri := fmt.Sprintf("%s/%s/%d", httputil.GetURL(c.Request), repo.FullName, build.Number) err = remote_.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } }() diff --git a/server/rpc.go b/server/rpc.go index ba747e95bb..36d9615661 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -428,7 +428,7 @@ func (s *RPC) Done(c context.Context, id string, state rpc.State) error { uri := fmt.Sprintf("%s/%s/%d", s.host, repo.FullName, build.Number) err = s.remote.Status(user, repo, build, uri) if err != nil { - logrus.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + logrus.Errorf("error setting commit status for %s/%d: %v", repo.FullName, build.Number, err) } } } From b339532e0ca1c540376a08e290dfd26bea41551b Mon Sep 17 00:00:00 2001 From: Jesse Lang Date: Wed, 20 Dec 2017 06:49:02 -0600 Subject: [PATCH 20/91] Fix DRONE_HOST check --- cmd/drone-server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 02fc150785..89f938abd6 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -483,7 +483,7 @@ func server(c *cli.Context) error { ) } - if !strings.HasSuffix(c.String("server-host"), "/") { + if strings.HasSuffix(c.String("server-host"), "/") { logrus.Fatalln( "DRONE_HOST must not have trailing slash", ) From 06fa27d937b4c218dfe9dd5c584a83df081ca944 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Mon, 8 Jan 2018 09:28:38 -0600 Subject: [PATCH 21/91] Add keepalive to agents --- cmd/drone-agent/agent.go | 22 ++++++++++++++++++++++ cmd/drone-agent/main.go | 10 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/cmd/drone-agent/agent.go b/cmd/drone-agent/agent.go index 21341c95e0..fdb017aa5e 100644 --- a/cmd/drone-agent/agent.go +++ b/cmd/drone-agent/agent.go @@ -12,6 +12,7 @@ import ( "time" "google.golang.org/grpc" + "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "github.com/cncd/pipeline/pipeline" @@ -68,6 +69,26 @@ func loop(c *cli.Context) error { // grpc.Dial(target, )) + agentKeepalive := keepalive.ClientParameters{} + if c.String("keepalive-time") != "" { + d, err := time.ParseDuration(c.String("keepalive-time")) + + if err != nil { + return err + } + + agentKeepalive.Time = d + } + if c.String("keepalive-timeout") != "" { + d, err := time.ParseDuration(c.String("keepalive-timeout")) + + if err != nil { + return err + } + + agentKeepalive.Timeout = d + } + conn, err := grpc.Dial( c.String("server"), grpc.WithInsecure(), @@ -75,6 +96,7 @@ func loop(c *cli.Context) error { username: c.String("username"), password: c.String("password"), }), + grpc.WithKeepaliveParams(agentKeepalive), ) if err != nil { diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index c23ed702b4..0ecd2919bf 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -80,6 +80,16 @@ func main() { Name: "healthcheck", Usage: "enables the healthcheck endpoint", }, + cli.StringFlag{ + EnvVar: "DRONE_KEEPALIVE_TIME", + Name: "keepalive-time", + Usage: "after a duration of this time if the agent doesn't see any activity it pings the server to see if the transport is still alive", + }, + cli.StringFlag{ + EnvVar: "DRONE_KEEPALIVE_TIMEOUT", + Name: "keepalive-timeout", + Usage: "after having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.", + }, } if err := app.Run(os.Args); err != nil { From 164fd0ad3f26e25cc401957dcb2b76b76dc5e9f8 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Mon, 8 Jan 2018 12:47:08 -0600 Subject: [PATCH 22/91] Update keepalive config to use DurationFlag --- cmd/drone-agent/agent.go | 25 ++++--------------------- cmd/drone-agent/main.go | 4 ++-- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/cmd/drone-agent/agent.go b/cmd/drone-agent/agent.go index fdb017aa5e..c1f1219129 100644 --- a/cmd/drone-agent/agent.go +++ b/cmd/drone-agent/agent.go @@ -69,26 +69,6 @@ func loop(c *cli.Context) error { // grpc.Dial(target, )) - agentKeepalive := keepalive.ClientParameters{} - if c.String("keepalive-time") != "" { - d, err := time.ParseDuration(c.String("keepalive-time")) - - if err != nil { - return err - } - - agentKeepalive.Time = d - } - if c.String("keepalive-timeout") != "" { - d, err := time.ParseDuration(c.String("keepalive-timeout")) - - if err != nil { - return err - } - - agentKeepalive.Timeout = d - } - conn, err := grpc.Dial( c.String("server"), grpc.WithInsecure(), @@ -96,7 +76,10 @@ func loop(c *cli.Context) error { username: c.String("username"), password: c.String("password"), }), - grpc.WithKeepaliveParams(agentKeepalive), + grpc.WithKeepaliveParams(keepalive.ClientParameters{ + Time: c.Duration("keepalive-time"), + Timeout: c.Duration("keepalive-timeout"), + }), ) if err != nil { diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 0ecd2919bf..33a93d6a2c 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -80,12 +80,12 @@ func main() { Name: "healthcheck", Usage: "enables the healthcheck endpoint", }, - cli.StringFlag{ + cli.DurationFlag{ EnvVar: "DRONE_KEEPALIVE_TIME", Name: "keepalive-time", Usage: "after a duration of this time if the agent doesn't see any activity it pings the server to see if the transport is still alive", }, - cli.StringFlag{ + cli.DurationFlag{ EnvVar: "DRONE_KEEPALIVE_TIMEOUT", Name: "keepalive-timeout", Usage: "after having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.", From 6eb9af01c62c4f2e9551385f72dc3c8a3bee3935 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Mon, 8 Jan 2018 14:46:44 -0600 Subject: [PATCH 23/91] Allow setting MinTime for keepalive enforcement on server This allows setting agent keepalive Time at value < 5m --- cmd/drone-server/server.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 89f938abd6..21beee2b0c 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -13,6 +13,7 @@ import ( "time" "google.golang.org/grpc" + "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "golang.org/x/crypto/acme/autocert" @@ -461,6 +462,11 @@ var flags = []cli.Flag{ Name: "coding-skip-verify", Usage: "coding skip ssl verification", }, + cli.DurationFlag{ + EnvVar: "DRONE_KEEPALIVE_MIN_TIME", + Name: "keepalive-min-time", + Usage: "coding skip ssl verification", + }, } func server(c *cli.Context) error { @@ -527,6 +533,9 @@ func server(c *cli.Context) error { s := grpc.NewServer( grpc.StreamInterceptor(auther.streamInterceptor), grpc.UnaryInterceptor(auther.unaryIntercaptor), + grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ + MinTime: c.Duration("keepalive-min-time"), + }), ) ss := new(droneserver.DroneServer) ss.Queue = droneserver.Config.Services.Queue From 36f99c9a3f00d2f65d76220603f32f3667b79c38 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Wed, 10 Jan 2018 13:39:40 -0600 Subject: [PATCH 24/91] Add explicit default for DRONE_KEEPALIVE_TIMEOUT --- cmd/drone-agent/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 33a93d6a2c..28b75bb71a 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "time" "github.com/drone/drone/version" @@ -89,6 +90,7 @@ func main() { EnvVar: "DRONE_KEEPALIVE_TIMEOUT", Name: "keepalive-timeout", Usage: "after having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.", + Value: time.Second * 20, }, } From 3454e95f31453726ddb6e7aca32b46778e84cb46 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 10 Jan 2018 13:31:07 -0800 Subject: [PATCH 25/91] bump version number --- .drone.yml | 4 +- .../cncd/pipeline/pipeline/rpc/client_grpc.go | 17 ++++++ vendor/vendor.json | 54 +++++++++---------- version/version.go | 2 +- 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/.drone.yml b/.drone.yml index bb3ab4c6c0..bac57bfac5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -118,7 +118,7 @@ pipeline: image: plugins/docker repo: drone/drone secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.3 ] + tag: [ 0.8, 0.8.4 ] when: event: tag @@ -127,7 +127,7 @@ pipeline: repo: drone/agent dockerfile: Dockerfile.agent secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.3 ] + tag: [ 0.8, 0.8.4 ] when: event: tag diff --git a/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc.go b/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc.go index 204c4fdd06..9917133210 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc.go +++ b/vendor/github.com/cncd/pipeline/pipeline/rpc/client_grpc.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "time" + "log" "github.com/cncd/pipeline/pipeline/backend" "github.com/cncd/pipeline/pipeline/rpc/proto" @@ -46,6 +47,8 @@ func (c *client) Next(ctx context.Context, f Filter) (*Pipeline, error) { res, err = c.client.Next(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: done(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -84,6 +87,8 @@ func (c *client) Wait(ctx context.Context, id string) (err error) { _, err = c.client.Wait(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: wait(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -116,6 +121,8 @@ func (c *client) Init(ctx context.Context, id string, state State) (err error) { _, err = c.client.Init(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: init(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -148,6 +155,8 @@ func (c *client) Done(ctx context.Context, id string, state State) (err error) { _, err = c.client.Done(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: done(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -173,6 +182,8 @@ func (c *client) Extend(ctx context.Context, id string) (err error) { _, err = c.client.Extend(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: extend(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -205,6 +216,8 @@ func (c *client) Update(ctx context.Context, id string, state State) (err error) _, err = c.client.Update(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: update(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -238,6 +251,8 @@ func (c *client) Upload(ctx context.Context, id string, file *File) (err error) _, err = c.client.Upload(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: upload(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case @@ -268,6 +283,8 @@ func (c *client) Log(ctx context.Context, id string, line *Line) (err error) { _, err = c.client.Log(ctx, req) if err == nil { break + } else { + log.Printf("grpc error: log(): code: %v: %s", grpc.Code(err), err) } switch grpc.Code(err) { case diff --git a/vendor/vendor.json b/vendor/vendor.json index e450b6b95a..363f0c1ccb 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -195,80 +195,80 @@ { "checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=", "path": "github.com/cncd/pipeline/pipeline", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "iRKdpheRPBTP0DKTQH7zmE2PI34=", "path": "github.com/cncd/pipeline/pipeline/backend", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "EHJGG1USUliP8nzNWV/axO5KLzw=", "path": "github.com/cncd/pipeline/pipeline/backend/docker", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "HWV2BBLXS4gY5eLJeNIg7Z6nAOA=", "path": "github.com/cncd/pipeline/pipeline/frontend", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "ncGH2MfHDtM7/dNzj2i+lnXFnf4=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "cdjOSSSS5Gzx7gRLNvObQvNJWYg=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "Sj2VYU+asWToYriIqcinav5MJZo=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "L7Q5qJmPITNmvFEEaj5MPwCWFRk=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/types", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=", "path": "github.com/cncd/pipeline/pipeline/interrupt", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=", "path": "github.com/cncd/pipeline/pipeline/multipart", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { - "checksumSHA1": "5oiGroE8hLXcj9hcZ+GGoBEm3o0=", + "checksumSHA1": "mfWlnRAr5B4+RL13W3s0BQVBofM=", "path": "github.com/cncd/pipeline/pipeline/rpc", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "N+3wNQ8hc/6yrh3FxbaxkEVwrkY=", "path": "github.com/cncd/pipeline/pipeline/rpc/proto", - "revision": "f8c48fc9fb9fd113c6e7dd941d63bb9f86a623cb", - "revisionTime": "2017-12-01T21:30:15Z" + "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", + "revisionTime": "2018-01-10T21:28:38Z" }, { "checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=", diff --git a/version/version.go b/version/version.go index f329dab173..c596253817 100644 --- a/version/version.go +++ b/version/version.go @@ -8,7 +8,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner. VersionMinor int64 = 8 // VersionPatch is for backwards-compatible bug fixes. - VersionPatch int64 = 3 + VersionPatch int64 = 4 // VersionPre indicates prerelease. VersionPre string // VersionDev indicates development branch. Releases will be empty string. From 5ba8cc3863fb9f4d75de63bf7fc7b0cc07ddd372 Mon Sep 17 00:00:00 2001 From: jhernandezb Date: Fri, 12 Jan 2018 22:53:44 -0600 Subject: [PATCH 26/91] update acme dependency --- vendor/golang.org/x/crypto/acme/acme.go | 40 +-- .../x/crypto/acme/autocert/autocert.go | 326 +++++++++++++----- vendor/golang.org/x/crypto/acme/types.go | 34 ++ vendor/vendor.json | 12 +- 4 files changed, 286 insertions(+), 126 deletions(-) diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go index 4e409be6d2..fa9c4b39e2 100644 --- a/vendor/golang.org/x/crypto/acme/acme.go +++ b/vendor/golang.org/x/crypto/acme/acme.go @@ -51,38 +51,6 @@ const ( maxNonces = 100 ) -// CertOption is an optional argument type for Client methods which manipulate -// certificate data. -type CertOption interface { - privateCertOpt() -} - -// WithKey creates an option holding a private/public key pair. -// The private part signs a certificate, and the public part represents the signee. -func WithKey(key crypto.Signer) CertOption { - return &certOptKey{key} -} - -type certOptKey struct { - key crypto.Signer -} - -func (*certOptKey) privateCertOpt() {} - -// WithTemplate creates an option for specifying a certificate template. -// See x509.CreateCertificate for template usage details. -// -// In TLSSNIxChallengeCert methods, the template is also used as parent, -// resulting in a self-signed certificate. -// The DNSNames field of t is always overwritten for tls-sni challenge certs. -func WithTemplate(t *x509.Certificate) CertOption { - return (*certOptTemplate)(t) -} - -type certOptTemplate x509.Certificate - -func (*certOptTemplate) privateCertOpt() {} - // Client is an ACME client. // The only required field is Key. An example of creating a client with a new key // is as follows: @@ -174,7 +142,7 @@ func (c *Client) Discover(ctx context.Context) (Directory, error) { // // In the case where CA server does not provide the issued certificate in the response, // CreateCert will poll certURL using c.FetchCert, which will result in additional round-trips. -// In such scenario the caller can cancel the polling with ctx. +// In such a scenario, the caller can cancel the polling with ctx. // // CreateCert returns an error if the CA's response or chain was unreasonably large. // Callers are encouraged to parse the returned value to ensure the certificate is valid and has the expected features. @@ -289,7 +257,7 @@ func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte, func AcceptTOS(tosURL string) bool { return true } // Register creates a new account registration by following the "new-reg" flow. -// It returns registered account. The a argument is not modified. +// It returns the registered account. The account is not modified. // // The registration may require the caller to agree to the CA's Terms of Service (TOS). // If so, and the account has not indicated the acceptance of the terms (see Account for details), @@ -1027,6 +995,7 @@ func keyAuth(pub crypto.PublicKey, token string) (string, error) { // tlsChallengeCert creates a temporary certificate for TLS-SNI challenges // with the given SANs and auto-generated public/private key pair. +// The Subject Common Name is set to the first SAN to aid debugging. // To create a cert with a custom key pair, specify WithKey option. func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) { var ( @@ -1065,6 +1034,9 @@ func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) { } } tmpl.DNSNames = san + if len(san) > 0 { + tmpl.Subject.CommonName = san[0] + } der, err := x509.CreateCertificate(rand.Reader, tmpl, tmpl, key.Public(), key) if err != nil { diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/vendor/golang.org/x/crypto/acme/autocert/autocert.go index a478eff54a..453e72291f 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/autocert.go +++ b/vendor/golang.org/x/crypto/acme/autocert/autocert.go @@ -24,7 +24,9 @@ import ( "fmt" "io" mathrand "math/rand" + "net" "net/http" + "path" "strconv" "strings" "sync" @@ -80,11 +82,14 @@ func defaultHostPolicy(context.Context, string) error { } // Manager is a stateful certificate manager built on top of acme.Client. -// It obtains and refreshes certificates automatically, -// as well as providing them to a TLS server via tls.Config. +// It obtains and refreshes certificates automatically using "tls-sni-01", +// "tls-sni-02" and "http-01" challenge types, as well as providing them +// to a TLS server via tls.Config. // -// To preserve issued certificates and improve overall performance, -// use a cache implementation of Cache. For instance, DirCache. +// You must specify a cache implementation, such as DirCache, +// to reuse obtained certificates across program restarts. +// Otherwise your server is very likely to exceed the certificate +// issuer's request rate limits. type Manager struct { // Prompt specifies a callback function to conditionally accept a CA's Terms of Service (TOS). // The registration may require the caller to agree to the CA's TOS. @@ -148,15 +153,26 @@ type Manager struct { stateMu sync.Mutex state map[string]*certState // keyed by domain name - // tokenCert is keyed by token domain name, which matches server name - // of ClientHello. Keys always have ".acme.invalid" suffix. - tokenCertMu sync.RWMutex - tokenCert map[string]*tls.Certificate - // renewal tracks the set of domains currently running renewal timers. // It is keyed by domain name. renewalMu sync.Mutex renewal map[string]*domainRenewal + + // tokensMu guards the rest of the fields: tryHTTP01, certTokens and httpTokens. + tokensMu sync.RWMutex + // tryHTTP01 indicates whether the Manager should try "http-01" challenge type + // during the authorization flow. + tryHTTP01 bool + // httpTokens contains response body values for http-01 challenges + // and is keyed by the URL path at which a challenge response is expected + // to be provisioned. + // The entries are stored for the duration of the authorization flow. + httpTokens map[string][]byte + // certTokens contains temporary certificates for tls-sni challenges + // and is keyed by token domain name, which matches server name of ClientHello. + // Keys always have ".acme.invalid" suffix. + // The entries are stored for the duration of the authorization flow. + certTokens map[string]*tls.Certificate } // GetCertificate implements the tls.Config.GetCertificate hook. @@ -183,14 +199,16 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, return nil, errors.New("acme/autocert: server name contains invalid character") } + // In the worst-case scenario, the timeout needs to account for caching, host policy, + // domain ownership verification and certificate issuance. ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) defer cancel() // check whether this is a token cert requested for TLS-SNI challenge if strings.HasSuffix(name, ".acme.invalid") { - m.tokenCertMu.RLock() - defer m.tokenCertMu.RUnlock() - if cert := m.tokenCert[name]; cert != nil { + m.tokensMu.RLock() + defer m.tokensMu.RUnlock() + if cert := m.certTokens[name]; cert != nil { return cert, nil } if cert, err := m.cacheGet(ctx, name); err == nil { @@ -222,6 +240,68 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, return cert, nil } +// HTTPHandler configures the Manager to provision ACME "http-01" challenge responses. +// It returns an http.Handler that responds to the challenges and must be +// running on port 80. If it receives a request that is not an ACME challenge, +// it delegates the request to the optional fallback handler. +// +// If fallback is nil, the returned handler redirects all GET and HEAD requests +// to the default TLS port 443 with 302 Found status code, preserving the original +// request path and query. It responds with 400 Bad Request to all other HTTP methods. +// The fallback is not protected by the optional HostPolicy. +// +// Because the fallback handler is run with unencrypted port 80 requests, +// the fallback should not serve TLS-only requests. +// +// If HTTPHandler is never called, the Manager will only use TLS SNI +// challenges for domain verification. +func (m *Manager) HTTPHandler(fallback http.Handler) http.Handler { + m.tokensMu.Lock() + defer m.tokensMu.Unlock() + m.tryHTTP01 = true + + if fallback == nil { + fallback = http.HandlerFunc(handleHTTPRedirect) + } + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if !strings.HasPrefix(r.URL.Path, "/.well-known/acme-challenge/") { + fallback.ServeHTTP(w, r) + return + } + // A reasonable context timeout for cache and host policy only, + // because we don't wait for a new certificate issuance here. + ctx, cancel := context.WithTimeout(r.Context(), time.Minute) + defer cancel() + if err := m.hostPolicy()(ctx, r.Host); err != nil { + http.Error(w, err.Error(), http.StatusForbidden) + return + } + data, err := m.httpToken(ctx, r.URL.Path) + if err != nil { + http.Error(w, err.Error(), http.StatusNotFound) + return + } + w.Write(data) + }) +} + +func handleHTTPRedirect(w http.ResponseWriter, r *http.Request) { + if r.Method != "GET" && r.Method != "HEAD" { + http.Error(w, "Use HTTPS", http.StatusBadRequest) + return + } + target := "https://" + stripPort(r.Host) + r.URL.RequestURI() + http.Redirect(w, r, target, http.StatusFound) +} + +func stripPort(hostport string) string { + host, _, err := net.SplitHostPort(hostport) + if err != nil { + return hostport + } + return net.JoinHostPort(host, "443") +} + // cert returns an existing certificate either from m.state or cache. // If a certificate is found in cache but not in m.state, the latter will be filled // with the cached value. @@ -369,7 +449,7 @@ func (m *Manager) createCert(ctx context.Context, domain string) (*tls.Certifica // We are the first; state is locked. // Unblock the readers when domain ownership is verified - // and the we got the cert or the process failed. + // and we got the cert or the process failed. defer state.Unlock() state.locked = false @@ -437,16 +517,17 @@ func (m *Manager) certState(domain string) (*certState, error) { return state, nil } -// authorizedCert starts domain ownership verification process and requests a new cert upon success. +// authorizedCert starts the domain ownership verification process and requests a new cert upon success. // The key argument is the certificate private key. func (m *Manager) authorizedCert(ctx context.Context, key crypto.Signer, domain string) (der [][]byte, leaf *x509.Certificate, err error) { - if err := m.verify(ctx, domain); err != nil { - return nil, nil, err - } client, err := m.acmeClient(ctx) if err != nil { return nil, nil, err } + + if err := m.verify(ctx, client, domain); err != nil { + return nil, nil, err + } csr, err := certRequest(key, domain) if err != nil { return nil, nil, err @@ -462,98 +543,171 @@ func (m *Manager) authorizedCert(ctx context.Context, key crypto.Signer, domain return der, leaf, nil } -// verify starts a new identifier (domain) authorization flow. -// It prepares a challenge response and then blocks until the authorization -// is marked as "completed" by the CA (either succeeded or failed). -// -// verify returns nil iff the verification was successful. -func (m *Manager) verify(ctx context.Context, domain string) error { - client, err := m.acmeClient(ctx) - if err != nil { - return err - } - - // start domain authorization and get the challenge - authz, err := client.Authorize(ctx, domain) - if err != nil { - return err - } - // maybe don't need to at all - if authz.Status == acme.StatusValid { - return nil - } +// verify runs the identifier (domain) authorization flow +// using each applicable ACME challenge type. +func (m *Manager) verify(ctx context.Context, client *acme.Client, domain string) error { + // The list of challenge types we'll try to fulfill + // in this specific order. + challengeTypes := []string{"tls-sni-02", "tls-sni-01"} + m.tokensMu.RLock() + if m.tryHTTP01 { + challengeTypes = append(challengeTypes, "http-01") + } + m.tokensMu.RUnlock() + + var nextTyp int // challengeType index of the next challenge type to try + for { + // Start domain authorization and get the challenge. + authz, err := client.Authorize(ctx, domain) + if err != nil { + return err + } + // No point in accepting challenges if the authorization status + // is in a final state. + switch authz.Status { + case acme.StatusValid: + return nil // already authorized + case acme.StatusInvalid: + return fmt.Errorf("acme/autocert: invalid authorization %q", authz.URI) + } - // pick a challenge: prefer tls-sni-02 over tls-sni-01 - // TODO: consider authz.Combinations - var chal *acme.Challenge - for _, c := range authz.Challenges { - if c.Type == "tls-sni-02" { - chal = c - break + // Pick the next preferred challenge. + var chal *acme.Challenge + for chal == nil && nextTyp < len(challengeTypes) { + chal = pickChallenge(challengeTypes[nextTyp], authz.Challenges) + nextTyp++ } - if c.Type == "tls-sni-01" { - chal = c + if chal == nil { + return fmt.Errorf("acme/autocert: unable to authorize %q; tried %q", domain, challengeTypes) + } + cleanup, err := m.fulfill(ctx, client, chal) + if err != nil { + continue + } + defer cleanup() + if _, err := client.Accept(ctx, chal); err != nil { + continue + } + + // A challenge is fulfilled and accepted: wait for the CA to validate. + if _, err := client.WaitAuthorization(ctx, authz.URI); err == nil { + return nil } } - if chal == nil { - return errors.New("acme/autocert: no supported challenge type found") - } +} - // create a token cert for the challenge response - var ( - cert tls.Certificate - name string - ) +// fulfill provisions a response to the challenge chal. +// The cleanup is non-nil only if provisioning succeeded. +func (m *Manager) fulfill(ctx context.Context, client *acme.Client, chal *acme.Challenge) (cleanup func(), err error) { switch chal.Type { case "tls-sni-01": - cert, name, err = client.TLSSNI01ChallengeCert(chal.Token) + cert, name, err := client.TLSSNI01ChallengeCert(chal.Token) + if err != nil { + return nil, err + } + m.putCertToken(ctx, name, &cert) + return func() { go m.deleteCertToken(name) }, nil case "tls-sni-02": - cert, name, err = client.TLSSNI02ChallengeCert(chal.Token) - default: - err = fmt.Errorf("acme/autocert: unknown challenge type %q", chal.Type) - } - if err != nil { - return err + cert, name, err := client.TLSSNI02ChallengeCert(chal.Token) + if err != nil { + return nil, err + } + m.putCertToken(ctx, name, &cert) + return func() { go m.deleteCertToken(name) }, nil + case "http-01": + resp, err := client.HTTP01ChallengeResponse(chal.Token) + if err != nil { + return nil, err + } + p := client.HTTP01ChallengePath(chal.Token) + m.putHTTPToken(ctx, p, resp) + return func() { go m.deleteHTTPToken(p) }, nil } - m.putTokenCert(ctx, name, &cert) - defer func() { - // verification has ended at this point - // don't need token cert anymore - go m.deleteTokenCert(name) - }() + return nil, fmt.Errorf("acme/autocert: unknown challenge type %q", chal.Type) +} - // ready to fulfill the challenge - if _, err := client.Accept(ctx, chal); err != nil { - return err +func pickChallenge(typ string, chal []*acme.Challenge) *acme.Challenge { + for _, c := range chal { + if c.Type == typ { + return c + } } - // wait for the CA to validate - _, err = client.WaitAuthorization(ctx, authz.URI) - return err + return nil } -// putTokenCert stores the cert under the named key in both m.tokenCert map +// putCertToken stores the cert under the named key in both m.certTokens map // and m.Cache. -func (m *Manager) putTokenCert(ctx context.Context, name string, cert *tls.Certificate) { - m.tokenCertMu.Lock() - defer m.tokenCertMu.Unlock() - if m.tokenCert == nil { - m.tokenCert = make(map[string]*tls.Certificate) +func (m *Manager) putCertToken(ctx context.Context, name string, cert *tls.Certificate) { + m.tokensMu.Lock() + defer m.tokensMu.Unlock() + if m.certTokens == nil { + m.certTokens = make(map[string]*tls.Certificate) } - m.tokenCert[name] = cert + m.certTokens[name] = cert m.cachePut(ctx, name, cert) } -// deleteTokenCert removes the token certificate for the specified domain name -// from both m.tokenCert map and m.Cache. -func (m *Manager) deleteTokenCert(name string) { - m.tokenCertMu.Lock() - defer m.tokenCertMu.Unlock() - delete(m.tokenCert, name) +// deleteCertToken removes the token certificate for the specified domain name +// from both m.certTokens map and m.Cache. +func (m *Manager) deleteCertToken(name string) { + m.tokensMu.Lock() + defer m.tokensMu.Unlock() + delete(m.certTokens, name) if m.Cache != nil { m.Cache.Delete(context.Background(), name) } } +// httpToken retrieves an existing http-01 token value from an in-memory map +// or the optional cache. +func (m *Manager) httpToken(ctx context.Context, tokenPath string) ([]byte, error) { + m.tokensMu.RLock() + defer m.tokensMu.RUnlock() + if v, ok := m.httpTokens[tokenPath]; ok { + return v, nil + } + if m.Cache == nil { + return nil, fmt.Errorf("acme/autocert: no token at %q", tokenPath) + } + return m.Cache.Get(ctx, httpTokenCacheKey(tokenPath)) +} + +// putHTTPToken stores an http-01 token value using tokenPath as key +// in both in-memory map and the optional Cache. +// +// It ignores any error returned from Cache.Put. +func (m *Manager) putHTTPToken(ctx context.Context, tokenPath, val string) { + m.tokensMu.Lock() + defer m.tokensMu.Unlock() + if m.httpTokens == nil { + m.httpTokens = make(map[string][]byte) + } + b := []byte(val) + m.httpTokens[tokenPath] = b + if m.Cache != nil { + m.Cache.Put(ctx, httpTokenCacheKey(tokenPath), b) + } +} + +// deleteHTTPToken removes an http-01 token value from both in-memory map +// and the optional Cache, ignoring any error returned from the latter. +// +// If m.Cache is non-nil, it blocks until Cache.Delete returns without a timeout. +func (m *Manager) deleteHTTPToken(tokenPath string) { + m.tokensMu.Lock() + defer m.tokensMu.Unlock() + delete(m.httpTokens, tokenPath) + if m.Cache != nil { + m.Cache.Delete(context.Background(), httpTokenCacheKey(tokenPath)) + } +} + +// httpTokenCacheKey returns a key at which an http-01 token value may be stored +// in the Manager's optional Cache. +func httpTokenCacheKey(tokenPath string) string { + return "http-01-" + path.Base(tokenPath) +} + // renew starts a cert renewal timer loop, one per domain. // // The loop is scheduled in two cases: diff --git a/vendor/golang.org/x/crypto/acme/types.go b/vendor/golang.org/x/crypto/acme/types.go index ab4de0b880..3e199749ec 100644 --- a/vendor/golang.org/x/crypto/acme/types.go +++ b/vendor/golang.org/x/crypto/acme/types.go @@ -5,6 +5,8 @@ package acme import ( + "crypto" + "crypto/x509" "errors" "fmt" "net/http" @@ -293,3 +295,35 @@ func (e *wireError) error(h http.Header) *Error { Header: h, } } + +// CertOption is an optional argument type for the TLSSNIxChallengeCert methods for +// customizing a temporary certificate for TLS-SNI challenges. +type CertOption interface { + privateCertOpt() +} + +// WithKey creates an option holding a private/public key pair. +// The private part signs a certificate, and the public part represents the signee. +func WithKey(key crypto.Signer) CertOption { + return &certOptKey{key} +} + +type certOptKey struct { + key crypto.Signer +} + +func (*certOptKey) privateCertOpt() {} + +// WithTemplate creates an option for specifying a certificate template. +// See x509.CreateCertificate for template usage details. +// +// In TLSSNIxChallengeCert methods, the template is also used as parent, +// resulting in a self-signed certificate. +// The DNSNames field of t is always overwritten for tls-sni challenge certs. +func WithTemplate(t *x509.Certificate) CertOption { + return (*certOptTemplate)(t) +} + +type certOptTemplate x509.Certificate + +func (*certOptTemplate) privateCertOpt() {} diff --git a/vendor/vendor.json b/vendor/vendor.json index 363f0c1ccb..9e731caa2f 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1007,16 +1007,16 @@ "revisionTime": "2016-11-19T21:37:11Z" }, { - "checksumSHA1": "Ag672Laei0E45NrvTO4LV9B3Jfc=", + "checksumSHA1": "CSMVjFF7FnylAUUKW1e/4r+VFXA=", "path": "golang.org/x/crypto/acme", - "revision": "c7af5bf2638a1164f2eb5467c39c6cffbd13a02e", - "revisionTime": "2017-04-25T18:31:00Z" + "revision": "13931e22f9e72ea58bb73048bc752b48c6d4d4ac", + "revisionTime": "2018-01-11T11:10:38Z" }, { - "checksumSHA1": "TrKJW+flz7JulXU3sqnBJjGzgQc=", + "checksumSHA1": "lBWiVnI+9tnYWuXnUiWljDy9dnc=", "path": "golang.org/x/crypto/acme/autocert", - "revision": "c7af5bf2638a1164f2eb5467c39c6cffbd13a02e", - "revisionTime": "2017-04-25T18:31:00Z" + "revision": "13931e22f9e72ea58bb73048bc752b48c6d4d4ac", + "revisionTime": "2018-01-11T11:10:38Z" }, { "checksumSHA1": "MlEHIE/60sB86Lmf0MPTIXHzKzE=", From 32e80eca20a3f4eed527d2ff089150d34b301a3e Mon Sep 17 00:00:00 2001 From: jhernandezb Date: Fri, 12 Jan 2018 22:54:49 -0600 Subject: [PATCH 27/91] lets encrypt: migrate to http-01 challenge --- cmd/drone-server/server.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 89f938abd6..a908779006 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -576,24 +576,23 @@ func server(c *cli.Context) error { // start the server with lets encrypt enabled // listen on ports 443 and 80 + address, err := url.Parse(c.String("server-host")) + if err != nil { + return err + } + + dir := cacheDir() + os.MkdirAll(dir, 0700) + + manager := autocert.Manager{ + Prompt: autocert.AcceptTOS, + HostPolicy: autocert.HostWhitelist(address.Host), + Cache: autocert.DirCache(dir), + } g.Go(func() error { - return http.ListenAndServe(":http", http.HandlerFunc(redirect)) + return http.ListenAndServe(":http", manager.HTTPHandler(http.HandlerFunc(redirect))) }) - g.Go(func() error { - address, err := url.Parse(c.String("server-host")) - if err != nil { - return err - } - - dir := cacheDir() - os.MkdirAll(dir, 0700) - - manager := autocert.Manager{ - Prompt: autocert.AcceptTOS, - HostPolicy: autocert.HostWhitelist(address.Host), - Cache: autocert.DirCache(dir), - } serve := &http.Server{ Addr: ":https", Handler: handler, From 546e0bad00e4ff73fc554e5fad9786002615e654 Mon Sep 17 00:00:00 2001 From: jhernandezb Date: Thu, 18 Jan 2018 10:33:41 -0600 Subject: [PATCH 28/91] Fix autocert generation --- cmd/drone-server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index a908779006..a4efe2f525 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -584,7 +584,7 @@ func server(c *cli.Context) error { dir := cacheDir() os.MkdirAll(dir, 0700) - manager := autocert.Manager{ + manager := &autocert.Manager{ Prompt: autocert.AcceptTOS, HostPolicy: autocert.HostWhitelist(address.Host), Cache: autocert.DirCache(dir), From cd0524e77e24fabb5ce9e278b78cae7aa4b1ca78 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 18 Jan 2018 09:26:28 -0800 Subject: [PATCH 29/91] endpoint to purge build logs --- router/router.go | 1 + server/build.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/router/router.go b/router/router.go index 64dd996840..ac515c0426 100644 --- a/router/router.go +++ b/router/router.go @@ -103,6 +103,7 @@ func Load(mux *httptreemux.ContextMux, middleware ...gin.HandlerFunc) http.Handl repo.POST("/builds/:number/approve", session.MustPush, server.PostApproval) repo.POST("/builds/:number/decline", session.MustPush, server.PostDecline) repo.DELETE("/builds/:number/:job", session.MustPush, server.DeleteBuild) + repo.DELETE("/logs/:number", session.MustPush, server.DeleteBuildLogs) } badges := e.Group("/api/badges/:owner/:name") diff --git a/server/build.go b/server/build.go index 43d391d813..f88bdae6d4 100644 --- a/server/build.go +++ b/server/build.go @@ -1,6 +1,7 @@ package server import ( + "bytes" "context" "encoding/json" "fmt" @@ -663,3 +664,52 @@ func PostBuild(c *gin.Context) { Config.Services.Queue.Push(context.Background(), task) } } + +// +/// +// + +func DeleteBuildLogs(c *gin.Context) { + repo := session.Repo(c) + num, _ := strconv.Atoi(c.Params.ByName("number")) + + build, err := store.GetBuildNumber(c, repo, num) + if err != nil { + c.AbortWithError(404, err) + return + } + + procs, err := store.FromContext(c).ProcList(build) + if err != nil { + c.AbortWithError(404, err) + return + } + + switch build.Status { + case model.StatusRunning, model.StatusPending: + c.String(400, "Cannot delete logs for a pending or running build") + return + } + + for _, proc := range procs { + buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name)) + lerr := store.FromContext(c).LogSave(proc, buf) + if lerr != nil { + err = lerr + } + } + if err != nil { + c.String(400, "There was a problem deleting your logs. %s", err) + return + } + + c.String(204, "") +} + +var deleteStr = `[ + { + "proc": %q, + "pos": 0, + "out": "LOGS PURGED\n" + } +]` From 8771fb53af982096b1021c31a28f337d643320f7 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 18 Jan 2018 09:30:41 -0800 Subject: [PATCH 30/91] purged log placeholder to include username --- server/build.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/build.go b/server/build.go index f88bdae6d4..9a01997299 100644 --- a/server/build.go +++ b/server/build.go @@ -671,6 +671,7 @@ func PostBuild(c *gin.Context) { func DeleteBuildLogs(c *gin.Context) { repo := session.Repo(c) + user := session.User(c) num, _ := strconv.Atoi(c.Params.ByName("number")) build, err := store.GetBuildNumber(c, repo, num) @@ -692,7 +693,7 @@ func DeleteBuildLogs(c *gin.Context) { } for _, proc := range procs { - buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name)) + buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login)) lerr := store.FromContext(c).LogSave(proc, buf) if lerr != nil { err = lerr @@ -710,6 +711,6 @@ var deleteStr = `[ { "proc": %q, "pos": 0, - "out": "LOGS PURGED\n" + "out": "logs purged by %s\n" } ]` From e15e88584e0e2e70e890a7ffcbb0874d6e9958bf Mon Sep 17 00:00:00 2001 From: Tony Li Date: Thu, 18 Jan 2018 13:08:11 -0500 Subject: [PATCH 31/91] purge log w/ timestamp --- server/build.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/build.go b/server/build.go index 9a01997299..d97ab98fec 100644 --- a/server/build.go +++ b/server/build.go @@ -693,7 +693,8 @@ func DeleteBuildLogs(c *gin.Context) { } for _, proc := range procs { - buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login)) + t := time.Now() + buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login, t.Format(time.RFC3339)) lerr := store.FromContext(c).LogSave(proc, buf) if lerr != nil { err = lerr @@ -711,6 +712,6 @@ var deleteStr = `[ { "proc": %q, "pos": 0, - "out": "logs purged by %s\n" + "out": "logs purged by %s on %s\n" } ]` From 2700a5eeaa4fa9a56d580d835a5fa39d6554dfd9 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Thu, 18 Jan 2018 13:20:42 -0500 Subject: [PATCH 32/91] better format --- server/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/build.go b/server/build.go index d97ab98fec..a9518844c6 100644 --- a/server/build.go +++ b/server/build.go @@ -693,8 +693,8 @@ func DeleteBuildLogs(c *gin.Context) { } for _, proc := range procs { - t := time.Now() - buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login, t.Format(time.RFC3339)) + t := time.Now().UTC() + buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login, t.Format(time.UnixDate))) lerr := store.FromContext(c).LogSave(proc, buf) if lerr != nil { err = lerr From b892f566e5daf19561c0aac84e48e0ce409c71a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=90=D0=BD=D0=B3=D0=B8=D0=BD?= Date: Mon, 22 Jan 2018 10:40:11 +0300 Subject: [PATCH 33/91] fix missing semicolon in Postgres script's files --- .../postgres/files/013_add_column_repo_visibility.sql | 4 ++-- .../ddl/postgres/files/014_add_column_repo_seq.sql | 3 ++- .../ddl/postgres/files/015_add_column_repo_active.sql | 4 ++-- .../ddl/postgres/files/016_add_column_user_synced.sql | 2 +- .../ddl/postgres/files/018_add_column_file_pid.sql | 9 +++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql b/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql index ed795dfc20..03b73f8887 100644 --- a/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql +++ b/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql @@ -1,6 +1,6 @@ -- name: alter-table-add-repo-visibility -ALTER TABLE repos ADD COLUMN repo_visibility VARCHAR(50) +ALTER TABLE repos ADD COLUMN repo_visibility VARCHAR(50); -- name: update-table-set-repo-visibility @@ -8,4 +8,4 @@ UPDATE repos SET repo_visibility = (CASE WHEN repo_private = false THEN 'public' ELSE 'private' - END) + END); diff --git a/store/datastore/ddl/postgres/files/014_add_column_repo_seq.sql b/store/datastore/ddl/postgres/files/014_add_column_repo_seq.sql index a0be87dda7..2c45f95b6a 100644 --- a/store/datastore/ddl/postgres/files/014_add_column_repo_seq.sql +++ b/store/datastore/ddl/postgres/files/014_add_column_repo_seq.sql @@ -8,9 +8,10 @@ UPDATE repos SET repo_counter = ( SELECT max(build_number) FROM builds WHERE builds.build_repo_id = repos.repo_id -) +); -- name: update-table-set-repo-seq-default UPDATE repos SET repo_counter = 0 WHERE repo_counter IS NULL +; \ No newline at end of file diff --git a/store/datastore/ddl/postgres/files/015_add_column_repo_active.sql b/store/datastore/ddl/postgres/files/015_add_column_repo_active.sql index 4dca2dd1e1..627ffda0c0 100644 --- a/store/datastore/ddl/postgres/files/015_add_column_repo_active.sql +++ b/store/datastore/ddl/postgres/files/015_add_column_repo_active.sql @@ -1,7 +1,7 @@ -- name: alter-table-add-repo-active -ALTER TABLE repos ADD COLUMN repo_active BOOLEAN +ALTER TABLE repos ADD COLUMN repo_active BOOLEAN; -- name: update-table-set-repo-active -UPDATE repos SET repo_active = true +UPDATE repos SET repo_active = true; diff --git a/store/datastore/ddl/postgres/files/016_add_column_user_synced.sql b/store/datastore/ddl/postgres/files/016_add_column_user_synced.sql index 43db914e7a..efe2d9bed9 100644 --- a/store/datastore/ddl/postgres/files/016_add_column_user_synced.sql +++ b/store/datastore/ddl/postgres/files/016_add_column_user_synced.sql @@ -4,4 +4,4 @@ ALTER TABLE users ADD COLUMN user_synced INTEGER; -- name: update-table-set-user-synced -UPDATE users SET user_synced = 0 +UPDATE users SET user_synced = 0; diff --git a/store/datastore/ddl/postgres/files/018_add_column_file_pid.sql b/store/datastore/ddl/postgres/files/018_add_column_file_pid.sql index 0ad11ac788..a8ee163c10 100644 --- a/store/datastore/ddl/postgres/files/018_add_column_file_pid.sql +++ b/store/datastore/ddl/postgres/files/018_add_column_file_pid.sql @@ -1,18 +1,18 @@ -- name: alter-table-add-file-pid -ALTER TABLE files ADD COLUMN file_pid INTEGER +ALTER TABLE files ADD COLUMN file_pid INTEGER; -- name: alter-table-add-file-meta-passed -ALTER TABLE files ADD COLUMN file_meta_passed INTEGER +ALTER TABLE files ADD COLUMN file_meta_passed INTEGER; -- name: alter-table-add-file-meta-failed -ALTER TABLE files ADD COLUMN file_meta_failed INTEGER +ALTER TABLE files ADD COLUMN file_meta_failed INTEGER; -- name: alter-table-add-file-meta-skipped -ALTER TABLE files ADD COLUMN file_meta_skipped INTEGER +ALTER TABLE files ADD COLUMN file_meta_skipped INTEGER; -- name: alter-table-update-file-meta @@ -20,3 +20,4 @@ UPDATE files SET file_meta_passed=0 ,file_meta_failed=0 ,file_meta_skipped=0 +; \ No newline at end of file From 8295166ca4b324efccb7fb21ba3a261174f88d95 Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Wed, 24 Jan 2018 08:41:11 -0600 Subject: [PATCH 34/91] Update usage for keepalive-min-time --- cmd/drone-server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 21beee2b0c..031fb0a603 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -465,7 +465,7 @@ var flags = []cli.Flag{ cli.DurationFlag{ EnvVar: "DRONE_KEEPALIVE_MIN_TIME", Name: "keepalive-min-time", - Usage: "coding skip ssl verification", + Usage: "server-side enforcement policy on the minimum amount of time a client should wait before sending a keepalive ping.", }, } From e4a77e5346d0092d0c600bee1bd17fa01b631941 Mon Sep 17 00:00:00 2001 From: Michael de Wit Date: Mon, 29 Jan 2018 13:20:02 +0100 Subject: [PATCH 35/91] Fix Gitea remote pull-request webhook parsing --- remote/gitea/fixtures/hooks.go | 2 -- remote/gitea/helper.go | 6 +++--- remote/gitea/helper_test.go | 1 + remote/gitea/types.go | 22 ++++++++++------------ 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/remote/gitea/fixtures/hooks.go b/remote/gitea/fixtures/hooks.go index 8f79ff3e2b..83e31fd425 100644 --- a/remote/gitea/fixtures/hooks.go +++ b/remote/gitea/fixtures/hooks.go @@ -103,13 +103,11 @@ const HookPullRequest = `{ "email": "gordon@golang.org", "avatar_url": "http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" }, - "base_branch": "master", "base": { "label": "master", "ref": "master", "sha": "9353195a19e45482665306e466c832c46560532d" }, - "head_branch": "feature/changes", "head": { "label": "feature/changes", "ref": "feature/changes", diff --git a/remote/gitea/helper.go b/remote/gitea/helper.go index 587daf3831..79e04c12af 100644 --- a/remote/gitea/helper.go +++ b/remote/gitea/helper.go @@ -127,15 +127,15 @@ func buildFromPullRequest(hook *pullRequestHook) *model.Build { Commit: hook.PullRequest.Head.Sha, Link: hook.PullRequest.URL, Ref: fmt.Sprintf("refs/pull/%d/head", hook.Number), - Branch: hook.PullRequest.BaseBranch, + Branch: hook.PullRequest.Base.Ref, Message: hook.PullRequest.Title, Author: hook.PullRequest.User.Username, Avatar: avatar, Sender: sender, Title: hook.PullRequest.Title, Refspec: fmt.Sprintf("%s:%s", - hook.PullRequest.HeadBranch, - hook.PullRequest.BaseBranch, + hook.PullRequest.Head.Ref, + hook.PullRequest.Base.Ref, ), } return build diff --git a/remote/gitea/helper_test.go b/remote/gitea/helper_test.go index 3ff0d8c94d..6f1d672764 100644 --- a/remote/gitea/helper_test.go +++ b/remote/gitea/helper_test.go @@ -127,6 +127,7 @@ func Test_parse(t *testing.T) { g.Assert(build.Ref).Equal("refs/pull/1/head") g.Assert(build.Link).Equal(hook.PullRequest.URL) g.Assert(build.Branch).Equal("master") + g.Assert(build.Refspec).Equal("feature/changes:master") g.Assert(build.Message).Equal(hook.PullRequest.Title) g.Assert(build.Avatar).Equal("http://1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87") g.Assert(build.Author).Equal(hook.PullRequest.User.Username) diff --git a/remote/gitea/types.go b/remote/gitea/types.go index 1671bd8128..ec9cd28ff4 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -54,16 +54,15 @@ type pullRequestHook struct { Email string `json:"email"` Avatar string `json:"avatar_url"` } `json:"user"` - Title string `json:"title"` - Body string `json:"body"` - Labels []string `json:"labels"` - State string `json:"state"` - URL string `json:"html_url"` - Mergeable bool `json:"mergeable"` - Merged bool `json:"merged"` - MergeBase string `json:"merge_base"` - BaseBranch string `json:"base_branch"` - Base struct { + Title string `json:"title"` + Body string `json:"body"` + Labels []string `json:"labels"` + State string `json:"state"` + URL string `json:"html_url"` + Mergeable bool `json:"mergeable"` + Merged bool `json:"merged"` + MergeBase string `json:"merge_base"` + Base struct { Label string `json:"label"` Ref string `json:"ref"` Sha string `json:"sha"` @@ -82,8 +81,7 @@ type pullRequestHook struct { } `json:"owner"` } `json:"repo"` } `json:"base"` - HeadBranch string `json:"head_branch"` - Head struct { + Head struct { Label string `json:"label"` Ref string `json:"ref"` Sha string `json:"sha"` From e1a695bd046c8ba6bf2f37f99de3ef29bec2b124 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 29 Jan 2018 19:00:14 -0500 Subject: [PATCH 36/91] update agent cli usage --- cmd/drone-agent/main.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 28b75bb71a..822995c90f 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -45,7 +45,7 @@ func main() { cli.BoolTFlag{ EnvVar: "DRONE_DEBUG", Name: "debug", - Usage: "start the agent in debug mode", + Usage: "enable agent debug mode", }, cli.BoolFlag{ EnvVar: "DRONE_DEBUG_PRETTY", @@ -60,36 +60,39 @@ func main() { cli.StringFlag{ EnvVar: "DRONE_HOSTNAME,HOSTNAME", Name: "hostname", + Usage: "agent hostname", }, cli.StringFlag{ EnvVar: "DRONE_PLATFORM", Name: "platform", + Usage: "restrict builds by platform conditions", Value: "linux/amd64", }, cli.StringFlag{ EnvVar: "DRONE_FILTER", Name: "filter", - Usage: "filter expression used to restrict builds by label", + Usage: "filter expression to restrict builds by label", }, cli.IntFlag{ EnvVar: "DRONE_MAX_PROCS", Name: "max-procs", + Usage: "agent parallel builds", Value: 1, }, cli.BoolTFlag{ EnvVar: "DRONE_HEALTHCHECK", Name: "healthcheck", - Usage: "enables the healthcheck endpoint", + Usage: "enable healthcheck endpoint", }, cli.DurationFlag{ EnvVar: "DRONE_KEEPALIVE_TIME", Name: "keepalive-time", - Usage: "after a duration of this time if the agent doesn't see any activity it pings the server to see if the transport is still alive", + Usage: "after a duration of this time of no activity, the agent pings the server to check if the transport is still alive", }, cli.DurationFlag{ EnvVar: "DRONE_KEEPALIVE_TIMEOUT", Name: "keepalive-timeout", - Usage: "after having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.", + Usage: "after pinging for a keepalive check, the agent waits for a duration of this time before closing the connection if no activity", Value: time.Second * 20, }, } From 73914fdbd50feaac39bba0d3c7390040446c3b88 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 29 Jan 2018 19:21:32 -0500 Subject: [PATCH 37/91] update server cli usage --- cmd/drone-server/server.go | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index a4efe2f525..f0ff04068e 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -38,12 +38,12 @@ var flags = []cli.Flag{ cli.BoolFlag{ EnvVar: "DRONE_DEBUG", Name: "debug", - Usage: "start the server in debug mode", + Usage: "enable server debug mode", }, cli.StringFlag{ EnvVar: "DRONE_SERVER_HOST,DRONE_HOST", Name: "server-host", - Usage: "server host", + Usage: "server host (://)", }, cli.StringFlag{ EnvVar: "DRONE_SERVER_ADDR", @@ -54,22 +54,22 @@ var flags = []cli.Flag{ cli.StringFlag{ EnvVar: "DRONE_SERVER_CERT", Name: "server-cert", - Usage: "server ssl cert", + Usage: "server ssl cert path", }, cli.StringFlag{ EnvVar: "DRONE_SERVER_KEY", Name: "server-key", - Usage: "server ssl key", + Usage: "server ssl key path", }, cli.BoolFlag{ EnvVar: "DRONE_LETS_ENCRYPT", Name: "lets-encrypt", - Usage: "lets encrypt enabled", + Usage: "enable let's encrypt", }, cli.BoolFlag{ EnvVar: "DRONE_QUIC", Name: "quic", - Usage: "start the server with quic enabled", + Usage: "enable quic", }, cli.StringFlag{ EnvVar: "DRONE_WWW", @@ -90,7 +90,7 @@ var flags = []cli.Flag{ cli.BoolFlag{ EnvVar: "DRONE_OPEN", Name: "open", - Usage: "open user registration", + Usage: "enable open user registration", }, cli.StringFlag{ EnvVar: "DRONE_REPO_CONFIG", @@ -101,12 +101,13 @@ var flags = []cli.Flag{ cli.DurationFlag{ EnvVar: "DRONE_SESSION_EXPIRES", Name: "session-expires", - Usage: "Set the session expiration time default 72h", + Usage: "set the session expiration time default 72h", Value: time.Hour * 72, }, cli.StringSliceFlag{ EnvVar: "DRONE_ESCALATE", Name: "escalate", + Usage: "images run in privileged mode", Value: &cli.StringSlice{ "plugins/docker", "plugins/gcr", @@ -124,7 +125,7 @@ var flags = []cli.Flag{ cli.StringFlag{ EnvVar: "DRONE_AGENT_SECRET,DRONE_SECRET", Name: "agent-secret", - Usage: "agent secret passcode", + Usage: "drone server-agent shared password", }, cli.StringFlag{ EnvVar: "DRONE_SECRET_ENDPOINT", @@ -157,28 +158,32 @@ var flags = []cli.Flag{ // resource limit parameters // cli.Int64Flag{ - Name: "limit-mem-swap", EnvVar: "DRONE_LIMIT_MEM_SWAP", + Name: "limit-mem-swap", + Usage: "maximum swappable memory allowed in bytes", }, cli.Int64Flag{ - Name: "limit-mem", EnvVar: "DRONE_LIMIT_MEM", + Name: "limit-mem", + Usage: "maximum memory allowed in bytes", }, cli.Int64Flag{ - Name: "limit-shm-size", EnvVar: "DRONE_LIMIT_SHM_SIZE", + Name: "limit-shm-size", }, cli.Int64Flag{ - Name: "limit-cpu-quota", EnvVar: "DRONE_LIMIT_CPU_QUOTA", + Name: "limit-cpu-quota", + Usage: "impose a cpu quota", }, cli.Int64Flag{ - Name: "limit-cpu-shares", EnvVar: "DRONE_LIMIT_CPU_SHARES", + Name: "limit-cpu-shares", + Usage: "change the cpu shares", }, cli.StringFlag{ - Name: "limit-cpu-set", EnvVar: "DRONE_LIMIT_CPU_SET", + Name: "limit-cpu-set", }, // // remote parameters From 625ef44f55126ae33018fa280821c1e22e3cec41 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 29 Jan 2018 19:21:46 -0500 Subject: [PATCH 38/91] make same --- cmd/drone-agent/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 822995c90f..2ad8e1caee 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -40,7 +40,7 @@ func main() { cli.StringFlag{ EnvVar: "DRONE_PASSWORD,DRONE_SECRET", Name: "password", - Usage: "drone auth password", + Usage: "drone server-agent shared password", }, cli.BoolTFlag{ EnvVar: "DRONE_DEBUG", From 22522bfe44b9235c3daabe6e1bf20ac8dcec8bca Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 30 Jan 2018 13:28:07 -0500 Subject: [PATCH 39/91] update server usages --- cmd/drone-server/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index f0ff04068e..3690c51d0c 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -43,7 +43,7 @@ var flags = []cli.Flag{ cli.StringFlag{ EnvVar: "DRONE_SERVER_HOST,DRONE_HOST", Name: "server-host", - Usage: "server host (://)", + Usage: "server fully qualified url (://)", }, cli.StringFlag{ EnvVar: "DRONE_SERVER_ADDR", @@ -101,7 +101,7 @@ var flags = []cli.Flag{ cli.DurationFlag{ EnvVar: "DRONE_SESSION_EXPIRES", Name: "session-expires", - Usage: "set the session expiration time default 72h", + Usage: "session expiration time", Value: time.Hour * 72, }, cli.StringSliceFlag{ @@ -170,6 +170,7 @@ var flags = []cli.Flag{ cli.Int64Flag{ EnvVar: "DRONE_LIMIT_SHM_SIZE", Name: "limit-shm-size", + Usage: "docker compose /dev/shm allowed in bytes", }, cli.Int64Flag{ EnvVar: "DRONE_LIMIT_CPU_QUOTA", From 0a6666b4bf4c13c0d345f8e1a24a322668fbd97b Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 30 Jan 2018 13:28:17 -0500 Subject: [PATCH 40/91] update server-agent usage --- cmd/drone-agent/main.go | 2 +- cmd/drone-server/server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 2ad8e1caee..75aac17d98 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -40,7 +40,7 @@ func main() { cli.StringFlag{ EnvVar: "DRONE_PASSWORD,DRONE_SECRET", Name: "password", - Usage: "drone server-agent shared password", + Usage: "server-agent shared password", }, cli.BoolTFlag{ EnvVar: "DRONE_DEBUG", diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 3690c51d0c..85d6ab0f46 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -125,7 +125,7 @@ var flags = []cli.Flag{ cli.StringFlag{ EnvVar: "DRONE_AGENT_SECRET,DRONE_SECRET", Name: "agent-secret", - Usage: "drone server-agent shared password", + Usage: "server-agent shared password", }, cli.StringFlag{ EnvVar: "DRONE_SECRET_ENDPOINT", From 84954e2d202b3db3fc04616cc1ba63b7b0b912f7 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 30 Jan 2018 13:30:06 -0500 Subject: [PATCH 41/91] fix verbage --- cmd/drone-server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 85d6ab0f46..5460933afb 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -107,7 +107,7 @@ var flags = []cli.Flag{ cli.StringSliceFlag{ EnvVar: "DRONE_ESCALATE", Name: "escalate", - Usage: "images run in privileged mode", + Usage: "images to run in privileged mode", Value: &cli.StringSlice{ "plugins/docker", "plugins/gcr", From a844ed53e9d1f3ca7d5314ebc1dbcbbb77086667 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 1 Feb 2018 13:10:00 -0600 Subject: [PATCH 42/91] allow repo admin to update build counter --- server/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/repo.go b/server/repo.go index 972a18e929..b8c1faaa22 100644 --- a/server/repo.go +++ b/server/repo.go @@ -100,7 +100,7 @@ func PatchRepo(c *gin.Context) { return } - if (in.IsTrusted != nil || in.Timeout != nil || in.BuildCounter != nil) && !user.Admin { + if (in.IsTrusted != nil || in.Timeout != nil) && !user.Admin { c.String(403, "Insufficient privileges") return } From af08c76b6acb6faade2a79c794baa7a839caa011 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Thu, 1 Feb 2018 14:07:45 -0600 Subject: [PATCH 43/91] allow repo admin to kill build --- router/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/router.go b/router/router.go index ac515c0426..0cb4fd1197 100644 --- a/router/router.go +++ b/router/router.go @@ -99,7 +99,7 @@ func Load(mux *httptreemux.ContextMux, middleware ...gin.HandlerFunc) http.Handl repo.POST("/move", session.MustRepoAdmin(), server.MoveRepo) repo.POST("/builds/:number", session.MustPush, server.PostBuild) - repo.DELETE("/builds/:number", session.MustAdmin(), server.ZombieKill) + repo.DELETE("/builds/:number", session.MustRepoAdmin(), server.ZombieKill) repo.POST("/builds/:number/approve", session.MustPush, server.PostApproval) repo.POST("/builds/:number/decline", session.MustPush, server.PostDecline) repo.DELETE("/builds/:number/:job", session.MustPush, server.DeleteBuild) From fe593eedd123c709e58ac4f8e7a0a1603f8bd6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Sch=C3=B6lzel?= Date: Thu, 1 Feb 2018 22:06:39 +0100 Subject: [PATCH 44/91] upgrade alpine base images to latest version --- Dockerfile.agent.alpine | 2 +- Dockerfile.alpine | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.agent.alpine b/Dockerfile.agent.alpine index a2bb3ce291..eac573ebd4 100644 --- a/Dockerfile.agent.alpine +++ b/Dockerfile.agent.alpine @@ -1,4 +1,4 @@ -FROM alpine:3.6 +FROM alpine:3.7 RUN apk add -U --no-cache ca-certificates diff --git a/Dockerfile.alpine b/Dockerfile.alpine index a22797c864..2d7047220a 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,4 +1,4 @@ -FROM alpine:3.6 +FROM alpine:3.7 EXPOSE 8000 9000 80 443 RUN apk add -U --no-cache ca-certificates From af76d46b53b98a35190dca796ba76b12f2ba4a0b Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 2 Feb 2018 13:03:40 -0600 Subject: [PATCH 45/91] add page param for getting build list with offset --- store/datastore/builds.go | 6 +++--- store/datastore/builds_test.go | 2 +- store/store.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/store/datastore/builds.go b/store/datastore/builds.go index 6793fa027b..fddee0b25d 100644 --- a/store/datastore/builds.go +++ b/store/datastore/builds.go @@ -45,9 +45,9 @@ func (db *datastore) GetBuildLastBefore(repo *model.Repo, branch string, num int return build, err } -func (db *datastore) GetBuildList(repo *model.Repo) ([]*model.Build, error) { +func (db *datastore) GetBuildList(repo *model.Repo, page int) ([]*model.Build, error) { var builds = []*model.Build{} - var err = meddler.QueryAll(db, &builds, rebind(buildListQuery), repo.ID) + var err = meddler.QueryAll(db, &builds, rebind(buildListQuery), repo.ID, 50*(page-1)) return builds, err } @@ -130,7 +130,7 @@ SELECT * FROM builds WHERE build_repo_id = ? ORDER BY build_number DESC -LIMIT 50 +LIMIT 50 OFFSET ? ` const buildNumberQuery = ` diff --git a/store/datastore/builds_test.go b/store/datastore/builds_test.go index 4aed2d3265..69497f85f9 100644 --- a/store/datastore/builds_test.go +++ b/store/datastore/builds_test.go @@ -247,7 +247,7 @@ func TestBuilds(t *testing.T) { } s.CreateBuild(build1, []*model.Proc{}...) s.CreateBuild(build2, []*model.Proc{}...) - builds, err := s.GetBuildList(&model.Repo{ID: 1}) + builds, err := s.GetBuildList(&model.Repo{ID: 1}, 1) g.Assert(err == nil).IsTrue() g.Assert(len(builds)).Equal(2) g.Assert(builds[0].ID).Equal(build2.ID) diff --git a/store/store.go b/store/store.go index ccfd635fe6..88c6ccff25 100644 --- a/store/store.go +++ b/store/store.go @@ -67,7 +67,7 @@ type Store interface { GetBuildLastBefore(*model.Repo, string, int64) (*model.Build, error) // GetBuildList gets a list of builds for the repository - GetBuildList(*model.Repo) ([]*model.Build, error) + GetBuildList(*model.Repo, int) ([]*model.Build, error) // GetBuildQueue gets a list of build in queue. GetBuildQueue() ([]*model.Feed, error) @@ -223,8 +223,8 @@ func GetBuildLastBefore(c context.Context, repo *model.Repo, branch string, numb return FromContext(c).GetBuildLastBefore(repo, branch, number) } -func GetBuildList(c context.Context, repo *model.Repo) ([]*model.Build, error) { - return FromContext(c).GetBuildList(repo) +func GetBuildList(c context.Context, repo *model.Repo, page int) ([]*model.Build, error) { + return FromContext(c).GetBuildList(repo, page) } func GetBuildQueue(c context.Context) ([]*model.Feed, error) { From c84031e3e8491aad184acb2f2c8a9168831d1f34 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Fri, 2 Feb 2018 13:04:21 -0600 Subject: [PATCH 46/91] get page query param. set default of 1 if not set --- server/badge.go | 2 +- server/build.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/badge.go b/server/badge.go index ed3947de87..455bd90a93 100644 --- a/server/badge.go +++ b/server/badge.go @@ -72,7 +72,7 @@ func GetCC(c *gin.Context) { return } - builds, err := store.GetBuildList(c, repo) + builds, err := store.GetBuildList(c, repo, 1) if err != nil || len(builds) == 0 { c.AbortWithStatus(404) return diff --git a/server/build.go b/server/build.go index a9518844c6..c66807d6ac 100644 --- a/server/build.go +++ b/server/build.go @@ -25,7 +25,13 @@ import ( func GetBuilds(c *gin.Context) { repo := session.Repo(c) - builds, err := store.GetBuildList(c, repo) + page, err := strconv.Atoi(c.DefaultQuery("page", "1")) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + return + } + + builds, err := store.GetBuildList(c, repo, page) if err != nil { c.AbortWithStatus(http.StatusInternalServerError) return From e3a5376d01e5946fb769d8ba4def3232d7f0116f Mon Sep 17 00:00:00 2001 From: Diep Pham Date: Thu, 25 Jan 2018 15:05:17 +0700 Subject: [PATCH 47/91] uses email from Sender field of push event Gitea/Gogs [set repository owner](https://github.com/go-gitea/gitea/blob/d644e8810710bc2e5035aa25f63c597c47312404/models/pull.go#L469) information as Pusher in webhook. For example, if we have a repository: git.example.com/org1/repo1, owner of repository will be `org1` and the email field will be empty. This PR changes gitea/gogs helpers to use the email in Sender field, which is the user that click the merge button. --- remote/gitea/fixtures/hooks.go | 1 + remote/gitea/helper.go | 2 +- remote/gitea/types.go | 1 + remote/gogs/fixtures/hooks.go | 1 + remote/gogs/helper.go | 2 +- remote/gogs/types.go | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/remote/gitea/fixtures/hooks.go b/remote/gitea/fixtures/hooks.go index 8f79ff3e2b..8c0dda3f64 100644 --- a/remote/gitea/fixtures/hooks.go +++ b/remote/gitea/fixtures/hooks.go @@ -46,6 +46,7 @@ const HookPush = ` "login": "gordon", "id": 1, "username": "gordon", + "email": "gordon@golang.org", "avatar_url": "http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } } diff --git a/remote/gitea/helper.go b/remote/gitea/helper.go index 587daf3831..183324a706 100644 --- a/remote/gitea/helper.go +++ b/remote/gitea/helper.go @@ -77,7 +77,7 @@ func buildFromPush(hook *pushHook) *model.Build { Message: hook.Commits[0].Message, Avatar: avatar, Author: author, - Email: hook.Pusher.Email, + Email: hook.Sender.Email, Timestamp: time.Now().UTC().Unix(), Sender: sender, } diff --git a/remote/gitea/types.go b/remote/gitea/types.go index 1671bd8128..2f1ebcd602 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -38,6 +38,7 @@ type pushHook struct { ID int64 `json:"id"` Login string `json:"login"` Username string `json:"username"` + Email string `json:"email"` Avatar string `json:"avatar_url"` } `json:"sender"` } diff --git a/remote/gogs/fixtures/hooks.go b/remote/gogs/fixtures/hooks.go index e9c19dba52..fdd1fda150 100644 --- a/remote/gogs/fixtures/hooks.go +++ b/remote/gogs/fixtures/hooks.go @@ -44,6 +44,7 @@ var HookPush = ` "sender": { "login": "gordon", "id": 1, + "email": "gordon@golang.org", "avatar_url": "http://gogs.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } } diff --git a/remote/gogs/helper.go b/remote/gogs/helper.go index 8b9420ed72..9bd965591d 100644 --- a/remote/gogs/helper.go +++ b/remote/gogs/helper.go @@ -77,7 +77,7 @@ func buildFromPush(hook *pushHook) *model.Build { Message: hook.Commits[0].Message, Avatar: avatar, Author: author, - Email: hook.Pusher.Email, + Email: hook.Sender.Email, Timestamp: time.Now().UTC().Unix(), Sender: sender, } diff --git a/remote/gogs/types.go b/remote/gogs/types.go index 611004455e..c4bed21a69 100644 --- a/remote/gogs/types.go +++ b/remote/gogs/types.go @@ -37,6 +37,7 @@ type pushHook struct { ID int64 `json:"id"` Login string `json:"login"` Username string `json:"username"` + Email string `json:"email"` Avatar string `json:"avatar_url"` } `json:"sender"` } From 9651a8043ed064841870831540f48c52e4f6c05b Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 13 Feb 2018 10:41:36 -0800 Subject: [PATCH 48/91] add usage for cpu-set --- cmd/drone-server/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 5460933afb..7bb3fc9cea 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -185,6 +185,7 @@ var flags = []cli.Flag{ cli.StringFlag{ EnvVar: "DRONE_LIMIT_CPU_SET", Name: "limit-cpu-set", + Usage: "set the cpus allowed to execute containers", }, // // remote parameters From 100f44c615d4f30462daeceb770d7b2b7aa6f5e5 Mon Sep 17 00:00:00 2001 From: Yuki Yoshida Date: Thu, 15 Feb 2018 17:39:59 +0900 Subject: [PATCH 49/91] Fix typos --- model/limit.go | 2 +- model/user.go | 2 +- remote/gerrit/gerrit.go | 4 ++-- remote/gitea/gitea.go | 2 +- remote/gogs/gogs.go | 2 +- server/web/opts.go | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/model/limit.go b/model/limit.go index 46f50df191..352b91ca5e 100644 --- a/model/limit.go +++ b/model/limit.go @@ -10,7 +10,7 @@ type Limiter interface { LimitBuild(*User, *Repo, *Build) error } -// NoLimit impliments the Limiter interface without enforcing any +// NoLimit implements the Limiter interface without enforcing any // actual limits. All limiting functions are no-ops. type NoLimit struct{} diff --git a/model/user.go b/model/user.go index 37ac19af35..d961e9f72d 100644 --- a/model/user.go +++ b/model/user.go @@ -30,7 +30,7 @@ type User struct { // Secret is the oauth2 token secret. Secret string `json:"-" meddler:"user_secret"` - // Expiry is the token and secret expriation timestamp. + // Expiry is the token and secret expiration timestamp. Expiry int64 `json:"-" meddler:"user_expiry"` // Email is the email address for this user. diff --git a/remote/gerrit/gerrit.go b/remote/gerrit/gerrit.go index 4ddc6a32b8..94a339786d 100644 --- a/remote/gerrit/gerrit.go +++ b/remote/gerrit/gerrit.go @@ -11,7 +11,7 @@ import ( ) // IMPORTANT Gerrit support is not yet implemented. This file is a placeholder -// for future implementaiton. +// for future implementation. // Opts defines configuration options. type Opts struct { @@ -52,7 +52,7 @@ func New(opts Opts) (remote.Remote, error) { }, nil } -// Login authenticates an account with Gerrit using oauth authenticaiton. The +// Login authenticates an account with Gerrit using oauth authentication. The // Gerrit account details are returned when the user is successfully authenticated. func (c *client) Login(res http.ResponseWriter, req *http.Request) (*model.User, error) { return nil, nil diff --git a/remote/gitea/gitea.go b/remote/gitea/gitea.go index 30e3cdd2eb..26ee8ae096 100644 --- a/remote/gitea/gitea.go +++ b/remote/gitea/gitea.go @@ -105,7 +105,7 @@ func New(opts Opts) (remote.Remote, error) { }, nil } -// Login authenticates an account with Gitea using basic authenticaiton. The +// Login authenticates an account with Gitea using basic authentication. The // Gitea account details are returned when the user is successfully authenticated. func (c *client) Login(res http.ResponseWriter, req *http.Request) (*model.User, error) { var ( diff --git a/remote/gogs/gogs.go b/remote/gogs/gogs.go index 97dcf45a6d..8e2339f8c6 100644 --- a/remote/gogs/gogs.go +++ b/remote/gogs/gogs.go @@ -52,7 +52,7 @@ func New(opts Opts) (remote.Remote, error) { }, nil } -// Login authenticates an account with Gogs using basic authenticaiton. The +// Login authenticates an account with Gogs using basic authentication. The // Gogs account details are returned when the user is successfully authenticated. func (c *client) Login(res http.ResponseWriter, req *http.Request) (*model.User, error) { var ( diff --git a/server/web/opts.go b/server/web/opts.go index d3e70b0528..09d0c6d3a8 100644 --- a/server/web/opts.go +++ b/server/web/opts.go @@ -12,7 +12,7 @@ type Options struct { // Option configures the website handler. type Option func(*Options) -// WithSync configures the website hanlder with the duration value +// WithSync configures the website handler with the duration value // used to determine if the user account requires synchronization. func WithSync(d time.Duration) Option { return func(o *Options) { @@ -20,7 +20,7 @@ func WithSync(d time.Duration) Option { } } -// WithDir configures the website hanlder with the directory value +// WithDir configures the website handler with the directory value // used to serve the website from the local filesystem. func WithDir(s string) Option { return func(o *Options) { @@ -28,7 +28,7 @@ func WithDir(s string) Option { } } -// WithDocs configures the website hanlder with the documentation +// WithDocs configures the website handler with the documentation // website address, which should be included in the user interface. func WithDocs(s string) Option { return func(o *Options) { From ce3855812bb00dbf1993d8663b6100b272e104dd Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 16 Feb 2018 13:49:11 -0800 Subject: [PATCH 50/91] Update LICENSE --- LICENSE | 281 ++++++++++++++++---------------------------------------- 1 file changed, 80 insertions(+), 201 deletions(-) diff --git a/LICENSE b/LICENSE index 7a4a3ea242..db5ce218c6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,202 +1,81 @@ +The Drone Community Edition (the "Community Edition") is licensed +under the Apache License, Version 2.0 (the "Apache License"). You may +obtain a copy of the Apache License at - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + http://www.apache.org/licenses/LICENSE-2.0 + +The Drone Enterprise Edition (the "Enterprise Edition") is licensed +under the Business Source License, Version 1.0 (the "BSL License"). A +copy of the BSL License is provided below. + +The source files in this repository have a header indicating which +license they are under. The BUILDING file provides instructions for +creating the Community Edition distribution subject to the terms of +the Apache License. + +----------------------------------------------------------------------------- + +Licensor: Drone.IO, Inc +Licensed Work: Drone Enterprise Edition + +Additional Use Grant: Usage of the software is free for entities with both: + (a) annual gross revenue under (USD) $1 million + (according to GAAP, or the equivalent in its country + of domicile); and (b) less than (USD) $5 million in + aggregate debt and equity funding. + +Change Date: 2022-01-01 + +Change License: Apache-2.0 + +Notice + +The Drone Enterprise License (this document, or the "License") is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. + +----------------------------------------------------------------------------- + +Drone Enterprise License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. From c28d1bad2b9a817918877a4a51905ed058098ffc Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 16 Feb 2018 13:52:26 -0800 Subject: [PATCH 51/91] Format LICENSE [ci skip] --- LICENSE | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index db5ce218c6..04b10d8b6b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,17 +1,16 @@ -The Drone Community Edition (the "Community Edition") is licensed -under the Apache License, Version 2.0 (the "Apache License"). You may -obtain a copy of the Apache License at +The Drone Community Edition (the "Community Edition") is licensed under the +Apache License, Version 2.0 (the "Apache License"). You may obtain a copy of +the Apache License at http://www.apache.org/licenses/LICENSE-2.0 -The Drone Enterprise Edition (the "Enterprise Edition") is licensed -under the Business Source License, Version 1.0 (the "BSL License"). A -copy of the BSL License is provided below. +The Drone Enterprise Edition (the "Enterprise Edition") is licensed under +the Drone Enterprise License, Version 1.1 (the "Enterprise License"). A copy +of the Enterprise License is provided below. -The source files in this repository have a header indicating which -license they are under. The BUILDING file provides instructions for -creating the Community Edition distribution subject to the terms of -the Apache License. +The source files in this repository have a header indicating which license +they are under. The BUILDING file provides instructions for creating the +Community Edition distribution subject to the terms of the Apache License. ----------------------------------------------------------------------------- From 580fe9abb749bde4ed7aa4e354b5fdb217cc050a Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 19 Feb 2018 14:24:10 -0800 Subject: [PATCH 52/91] add apache license header to files --- cmd/drone-agent/agent.go | 14 ++++++++++++++ cmd/drone-agent/health.go | 14 ++++++++++++++ cmd/drone-agent/health_test.go | 14 ++++++++++++++ cmd/drone-agent/main.go | 14 ++++++++++++++ cmd/drone-server/main.go | 14 ++++++++++++++ cmd/drone-server/server.go | 14 ++++++++++++++ cmd/drone-server/setup.go | 14 ++++++++++++++ model/build.go | 14 ++++++++++++++ model/build_test.go | 14 ++++++++++++++ model/cc.go | 14 ++++++++++++++ model/cc_test.go | 14 ++++++++++++++ model/config.go | 14 ++++++++++++++ model/const.go | 14 ++++++++++++++ model/environ.go | 14 ++++++++++++++ model/event.go | 14 ++++++++++++++ model/feed.go | 14 ++++++++++++++ model/file.go | 14 ++++++++++++++ model/limit.go | 14 ++++++++++++++ model/netrc.go | 14 ++++++++++++++ model/perm.go | 14 ++++++++++++++ model/proc.go | 14 ++++++++++++++ model/queue.go | 14 ++++++++++++++ model/registry.go | 14 ++++++++++++++ model/repo.go | 14 ++++++++++++++ model/resource_limit.go | 14 ++++++++++++++ model/secret.go | 14 ++++++++++++++ model/secret_test.go | 14 ++++++++++++++ model/sender.go | 14 ++++++++++++++ model/settings.go | 14 ++++++++++++++ model/team.go | 14 ++++++++++++++ model/user.go | 14 ++++++++++++++ model/user_test.go | 14 ++++++++++++++ remote/bitbucket/bitbucket.go | 14 ++++++++++++++ remote/bitbucket/bitbucket_test.go | 14 ++++++++++++++ remote/bitbucket/convert.go | 14 ++++++++++++++ remote/bitbucket/convert_test.go | 14 ++++++++++++++ remote/bitbucket/fixtures/handler.go | 14 ++++++++++++++ remote/bitbucket/fixtures/hooks.go | 14 ++++++++++++++ remote/bitbucket/internal/client.go | 14 ++++++++++++++ remote/bitbucket/internal/types.go | 14 ++++++++++++++ remote/bitbucket/parse.go | 14 ++++++++++++++ remote/bitbucket/parse_test.go | 14 ++++++++++++++ remote/bitbucketserver/bitbucketserver.go | 14 ++++++++++++++ remote/bitbucketserver/convert.go | 14 ++++++++++++++ remote/bitbucketserver/convert_test.go | 14 ++++++++++++++ remote/bitbucketserver/internal/client.go | 14 ++++++++++++++ remote/bitbucketserver/internal/types.go | 14 ++++++++++++++ remote/bitbucketserver/parse.go | 14 ++++++++++++++ remote/coding/coding.go | 14 ++++++++++++++ remote/coding/coding_test.go | 14 ++++++++++++++ remote/coding/fixtures/handler.go | 14 ++++++++++++++ remote/coding/fixtures/hooks.go | 14 ++++++++++++++ remote/coding/hook.go | 14 ++++++++++++++ remote/coding/hook_test.go | 14 ++++++++++++++ remote/coding/internal/coding.go | 14 ++++++++++++++ remote/coding/internal/error.go | 14 ++++++++++++++ remote/coding/internal/file.go | 14 ++++++++++++++ remote/coding/internal/project.go | 14 ++++++++++++++ remote/coding/internal/user.go | 14 ++++++++++++++ remote/coding/internal/webhook.go | 14 ++++++++++++++ remote/coding/util.go | 14 ++++++++++++++ remote/coding/util_test.go | 14 ++++++++++++++ remote/context.go | 14 ++++++++++++++ remote/errors.go | 14 ++++++++++++++ remote/gerrit/gerrit.go | 14 ++++++++++++++ remote/gitea/fixtures/handler.go | 14 ++++++++++++++ remote/gitea/fixtures/hooks.go | 14 ++++++++++++++ remote/gitea/gitea.go | 14 ++++++++++++++ remote/gitea/gitea_test.go | 14 ++++++++++++++ remote/gitea/helper.go | 14 ++++++++++++++ remote/gitea/helper_test.go | 14 ++++++++++++++ remote/gitea/parse.go | 14 ++++++++++++++ remote/gitea/parse_test.go | 14 ++++++++++++++ remote/gitea/types.go | 14 ++++++++++++++ remote/github/convert.go | 14 ++++++++++++++ remote/github/convert_test.go | 14 ++++++++++++++ remote/github/fixtures/handler.go | 14 ++++++++++++++ remote/github/fixtures/hooks.go | 14 ++++++++++++++ remote/github/github.go | 14 ++++++++++++++ remote/github/github_test.go | 14 ++++++++++++++ remote/github/parse.go | 14 ++++++++++++++ remote/github/parse_test.go | 14 ++++++++++++++ remote/github/types.go | 14 ++++++++++++++ remote/gitlab/client/drone.go | 14 ++++++++++++++ remote/gitlab/client/gitlab.go | 14 ++++++++++++++ remote/gitlab/client/groups.go | 14 ++++++++++++++ remote/gitlab/client/hook.go | 14 ++++++++++++++ remote/gitlab/client/project.go | 14 ++++++++++++++ remote/gitlab/client/types.go | 14 ++++++++++++++ remote/gitlab/client/user.go | 14 ++++++++++++++ remote/gitlab/client/util.go | 14 ++++++++++++++ remote/gitlab/gitlab.go | 14 ++++++++++++++ remote/gitlab/gitlab_test.go | 14 ++++++++++++++ remote/gitlab/helper.go | 14 ++++++++++++++ remote/gitlab/testdata/hooks.go | 14 ++++++++++++++ remote/gitlab/testdata/oauth.go | 14 ++++++++++++++ remote/gitlab/testdata/projects.go | 14 ++++++++++++++ remote/gitlab/testdata/testdata.go | 14 ++++++++++++++ remote/gitlab/testdata/users.go | 14 ++++++++++++++ remote/gitlab3/client/drone.go | 14 ++++++++++++++ remote/gitlab3/client/gitlab.go | 14 ++++++++++++++ remote/gitlab3/client/groups.go | 14 ++++++++++++++ remote/gitlab3/client/hook.go | 14 ++++++++++++++ remote/gitlab3/client/project.go | 14 ++++++++++++++ remote/gitlab3/client/types.go | 14 ++++++++++++++ remote/gitlab3/client/user.go | 14 ++++++++++++++ remote/gitlab3/client/util.go | 14 ++++++++++++++ remote/gitlab3/gitlab.go | 14 ++++++++++++++ remote/gitlab3/gitlab_test.go | 14 ++++++++++++++ remote/gitlab3/helper.go | 14 ++++++++++++++ remote/gitlab3/testdata/hooks.go | 14 ++++++++++++++ remote/gitlab3/testdata/oauth.go | 14 ++++++++++++++ remote/gitlab3/testdata/projects.go | 14 ++++++++++++++ remote/gitlab3/testdata/testdata.go | 14 ++++++++++++++ remote/gitlab3/testdata/users.go | 14 ++++++++++++++ remote/gogs/fixtures/handler.go | 14 ++++++++++++++ remote/gogs/fixtures/hooks.go | 14 ++++++++++++++ remote/gogs/gogs.go | 14 ++++++++++++++ remote/gogs/gogs_test.go | 14 ++++++++++++++ remote/gogs/helper.go | 14 ++++++++++++++ remote/gogs/helper_test.go | 14 ++++++++++++++ remote/gogs/parse.go | 14 ++++++++++++++ remote/gogs/parse_test.go | 14 ++++++++++++++ remote/gogs/types.go | 14 ++++++++++++++ remote/mock/remote.go | 14 ++++++++++++++ remote/remote.go | 14 ++++++++++++++ router/middleware/config.go | 14 ++++++++++++++ router/middleware/header/header.go | 14 ++++++++++++++ router/middleware/remote.go | 14 ++++++++++++++ router/middleware/session/agent.go | 14 ++++++++++++++ router/middleware/session/repo.go | 14 ++++++++++++++ router/middleware/session/repo_test.go | 14 ++++++++++++++ router/middleware/session/user.go | 14 ++++++++++++++ router/middleware/store.go | 14 ++++++++++++++ router/middleware/token/token.go | 14 ++++++++++++++ router/middleware/version.go | 14 ++++++++++++++ router/router.go | 14 ++++++++++++++ server/badge.go | 14 ++++++++++++++ server/build.go | 14 ++++++++++++++ server/debug/debug.go | 14 ++++++++++++++ server/file.go | 14 ++++++++++++++ server/hook.go | 14 ++++++++++++++ server/hook_test.go | 14 ++++++++++++++ server/login.go | 14 ++++++++++++++ server/metrics/prometheus.go | 14 ++++++++++++++ server/registry.go | 14 ++++++++++++++ server/repo.go | 14 ++++++++++++++ server/rpc.go | 14 ++++++++++++++ server/secret.go | 14 ++++++++++++++ server/stream.go | 14 ++++++++++++++ server/swagger/doc.go | 14 ++++++++++++++ server/swagger/swagger.go | 14 ++++++++++++++ server/sync.go | 14 ++++++++++++++ server/user.go | 14 ++++++++++++++ server/users.go | 14 ++++++++++++++ server/web/opts.go | 14 ++++++++++++++ server/web/opts_test.go | 14 ++++++++++++++ server/web/template.go | 14 ++++++++++++++ server/web/template_test.go | 14 ++++++++++++++ server/web/web.go | 14 ++++++++++++++ server/z.go | 14 ++++++++++++++ shared/httputil/httputil.go | 14 ++++++++++++++ shared/token/token.go | 14 ++++++++++++++ store/context.go | 14 ++++++++++++++ store/datastore/builds.go | 14 ++++++++++++++ store/datastore/builds_test.go | 14 ++++++++++++++ store/datastore/config.go | 14 ++++++++++++++ store/datastore/config_test.go | 14 ++++++++++++++ store/datastore/ddl/migrate.go | 14 ++++++++++++++ store/datastore/ddl/mysql/ddl.go | 14 ++++++++++++++ store/datastore/ddl/mysql/ddl_gen.go | 14 ++++++++++++++ store/datastore/ddl/postgres/ddl.go | 14 ++++++++++++++ store/datastore/ddl/postgres/ddl_gen.go | 14 ++++++++++++++ store/datastore/ddl/sqlite/ddl.go | 14 ++++++++++++++ store/datastore/ddl/sqlite/ddl_gen.go | 14 ++++++++++++++ store/datastore/files.go | 14 ++++++++++++++ store/datastore/files_test.go | 14 ++++++++++++++ store/datastore/init.go | 14 ++++++++++++++ store/datastore/init_cgo.go | 14 ++++++++++++++ store/datastore/logs.go | 14 ++++++++++++++ store/datastore/logs_test.go | 14 ++++++++++++++ store/datastore/perms.go | 14 ++++++++++++++ store/datastore/perms_test.go | 14 ++++++++++++++ store/datastore/procs.go | 14 ++++++++++++++ store/datastore/procs_test.go | 14 ++++++++++++++ store/datastore/registry.go | 14 ++++++++++++++ store/datastore/registry_test.go | 14 ++++++++++++++ store/datastore/repos.go | 14 ++++++++++++++ store/datastore/repos_test.go | 14 ++++++++++++++ store/datastore/secret.go | 14 ++++++++++++++ store/datastore/secret_test.go | 14 ++++++++++++++ store/datastore/sender.go | 14 ++++++++++++++ store/datastore/sender_test.go | 14 ++++++++++++++ store/datastore/sql/lookup.go | 14 ++++++++++++++ store/datastore/sql/mysql/sql.go | 14 ++++++++++++++ store/datastore/sql/mysql/sql_gen.go | 14 ++++++++++++++ store/datastore/sql/postgres/sql.go | 14 ++++++++++++++ store/datastore/sql/postgres/sql_gen.go | 14 ++++++++++++++ store/datastore/sql/sqlite/sql.go | 14 ++++++++++++++ store/datastore/sql/sqlite/sql_gen.go | 14 ++++++++++++++ store/datastore/store.go | 14 ++++++++++++++ store/datastore/task.go | 14 ++++++++++++++ store/datastore/task_test.go | 14 ++++++++++++++ store/datastore/users.go | 14 ++++++++++++++ store/datastore/users_test.go | 14 ++++++++++++++ store/datastore/utils.go | 14 ++++++++++++++ store/store.go | 14 ++++++++++++++ version/version.go | 14 ++++++++++++++ 208 files changed, 2912 insertions(+) diff --git a/cmd/drone-agent/agent.go b/cmd/drone-agent/agent.go index 94f9cb1317..254c8ffe57 100644 --- a/cmd/drone-agent/agent.go +++ b/cmd/drone-agent/agent.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/cmd/drone-agent/health.go b/cmd/drone-agent/health.go index 99c68fca17..6a3f77e638 100644 --- a/cmd/drone-agent/health.go +++ b/cmd/drone-agent/health.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/cmd/drone-agent/health_test.go b/cmd/drone-agent/health_test.go index 17505c867f..e15a8d8c6a 100644 --- a/cmd/drone-agent/health_test.go +++ b/cmd/drone-agent/health_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 75aac17d98..1f6622b801 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/cmd/drone-server/main.go b/cmd/drone-server/main.go index af2137f5c3..003818e3d1 100644 --- a/cmd/drone-server/main.go +++ b/cmd/drone-server/main.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 7e0de48da0..389d019ada 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/cmd/drone-server/setup.go b/cmd/drone-server/setup.go index fabc6fac84..e1dff3ecd9 100644 --- a/cmd/drone-server/setup.go +++ b/cmd/drone-server/setup.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/model/build.go b/model/build.go index e55d926377..dbedcfb7f5 100644 --- a/model/build.go +++ b/model/build.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // swagger:model build diff --git a/model/build_test.go b/model/build_test.go index 1ac176cb1a..387c18a4b8 100644 --- a/model/build_test.go +++ b/model/build_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/cc.go b/model/cc.go index 590beb753a..ad303ae344 100644 --- a/model/cc.go +++ b/model/cc.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/cc_test.go b/model/cc_test.go index 4d16727408..940e9e5ae8 100644 --- a/model/cc_test.go +++ b/model/cc_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/config.go b/model/config.go index 572947596a..71e86d6fd8 100644 --- a/model/config.go +++ b/model/config.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // ConfigStore persists pipeline configuration to storage. diff --git a/model/const.go b/model/const.go index 2cfd2e994b..e202d2e8db 100644 --- a/model/const.go +++ b/model/const.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model const ( diff --git a/model/environ.go b/model/environ.go index 3e3e00b5b6..1875e52490 100644 --- a/model/environ.go +++ b/model/environ.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/event.go b/model/event.go index e04803afc5..60469629ee 100644 --- a/model/event.go +++ b/model/event.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // EventType defines the possible types of build events. diff --git a/model/feed.go b/model/feed.go index 8e766e2192..72764ae5ab 100644 --- a/model/feed.go +++ b/model/feed.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // Feed represents an item in the user's feed or timeline. diff --git a/model/file.go b/model/file.go index fd41401785..9a86bbb31c 100644 --- a/model/file.go +++ b/model/file.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import "io" diff --git a/model/limit.go b/model/limit.go index 352b91ca5e..eb002c8ac0 100644 --- a/model/limit.go +++ b/model/limit.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // Limiter defines an interface for limiting repository creation. diff --git a/model/netrc.go b/model/netrc.go index 1bb8e67adb..6ed591164e 100644 --- a/model/netrc.go +++ b/model/netrc.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model type Netrc struct { diff --git a/model/perm.go b/model/perm.go index f0aa5e1842..b6ffd34bf7 100644 --- a/model/perm.go +++ b/model/perm.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // PermStore persists repository permissions information to storage. diff --git a/model/proc.go b/model/proc.go index d73001bdb3..ac30076d04 100644 --- a/model/proc.go +++ b/model/proc.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // ProcStore persists process information to storage. diff --git a/model/queue.go b/model/queue.go index 660d3b7e7b..a1552162aa 100644 --- a/model/queue.go +++ b/model/queue.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/registry.go b/model/registry.go index 5f074800dc..d77a173781 100644 --- a/model/registry.go +++ b/model/registry.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import "errors" diff --git a/model/repo.go b/model/repo.go index 4b22cf53d7..87b8d250b9 100644 --- a/model/repo.go +++ b/model/repo.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/resource_limit.go b/model/resource_limit.go index af2b68c7c6..104910e54f 100644 --- a/model/resource_limit.go +++ b/model/resource_limit.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // ResourceLimit is the resource limit to set on pipeline steps diff --git a/model/secret.go b/model/secret.go index 1cfd8a1081..95237fc002 100644 --- a/model/secret.go +++ b/model/secret.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/secret_test.go b/model/secret_test.go index 02c7cb248b..fc5a1407b8 100644 --- a/model/secret_test.go +++ b/model/secret_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/sender.go b/model/sender.go index 7655067c75..755409c491 100644 --- a/model/sender.go +++ b/model/sender.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model type SenderService interface { diff --git a/model/settings.go b/model/settings.go index b3722655fd..4017cd4ebd 100644 --- a/model/settings.go +++ b/model/settings.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // Settings defines system configuration parameters. diff --git a/model/team.go b/model/team.go index c91d58666e..29abeb8831 100644 --- a/model/team.go +++ b/model/team.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model // Team represents a team or organization in the remote version control system. diff --git a/model/user.go b/model/user.go index d961e9f72d..4faa9e9aa6 100644 --- a/model/user.go +++ b/model/user.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import ( diff --git a/model/user_test.go b/model/user_test.go index 27b568f516..ee96080b4f 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package model import "testing" diff --git a/remote/bitbucket/bitbucket.go b/remote/bitbucket/bitbucket.go index 3632fa2629..f7f5ef89e5 100644 --- a/remote/bitbucket/bitbucket.go +++ b/remote/bitbucket/bitbucket.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucket import ( diff --git a/remote/bitbucket/bitbucket_test.go b/remote/bitbucket/bitbucket_test.go index f00b19875b..d417798c61 100644 --- a/remote/bitbucket/bitbucket_test.go +++ b/remote/bitbucket/bitbucket_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucket import ( diff --git a/remote/bitbucket/convert.go b/remote/bitbucket/convert.go index b5627bc716..c5861b7ed1 100644 --- a/remote/bitbucket/convert.go +++ b/remote/bitbucket/convert.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucket import ( diff --git a/remote/bitbucket/convert_test.go b/remote/bitbucket/convert_test.go index 74903f5c6a..ffa526b873 100644 --- a/remote/bitbucket/convert_test.go +++ b/remote/bitbucket/convert_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucket import ( diff --git a/remote/bitbucket/fixtures/handler.go b/remote/bitbucket/fixtures/handler.go index 96aff73e0a..0440f8ad2e 100644 --- a/remote/bitbucket/fixtures/handler.go +++ b/remote/bitbucket/fixtures/handler.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures import ( diff --git a/remote/bitbucket/fixtures/hooks.go b/remote/bitbucket/fixtures/hooks.go index 2ee0823ad3..5afbb9e4a0 100644 --- a/remote/bitbucket/fixtures/hooks.go +++ b/remote/bitbucket/fixtures/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures const HookPush = ` diff --git a/remote/bitbucket/internal/client.go b/remote/bitbucket/internal/client.go index 781b3d07b9..b27633c5f3 100644 --- a/remote/bitbucket/internal/client.go +++ b/remote/bitbucket/internal/client.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/bitbucket/internal/types.go b/remote/bitbucket/internal/types.go index b92d22e08e..b8c0bbf31a 100644 --- a/remote/bitbucket/internal/types.go +++ b/remote/bitbucket/internal/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/bitbucket/parse.go b/remote/bitbucket/parse.go index 7ab385d38c..891dc20b10 100644 --- a/remote/bitbucket/parse.go +++ b/remote/bitbucket/parse.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucket import ( diff --git a/remote/bitbucket/parse_test.go b/remote/bitbucket/parse_test.go index eee2bda365..030cf1b125 100644 --- a/remote/bitbucket/parse_test.go +++ b/remote/bitbucket/parse_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucket import ( diff --git a/remote/bitbucketserver/bitbucketserver.go b/remote/bitbucketserver/bitbucketserver.go index b041b5ce4a..3f0d83b8db 100644 --- a/remote/bitbucketserver/bitbucketserver.go +++ b/remote/bitbucketserver/bitbucketserver.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucketserver // WARNING! This is an work-in-progress patch and does not yet conform to the coding, diff --git a/remote/bitbucketserver/convert.go b/remote/bitbucketserver/convert.go index cf1f6b71a3..5d398341ff 100644 --- a/remote/bitbucketserver/convert.go +++ b/remote/bitbucketserver/convert.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucketserver import ( diff --git a/remote/bitbucketserver/convert_test.go b/remote/bitbucketserver/convert_test.go index 2860d601f7..dec64dd2a7 100644 --- a/remote/bitbucketserver/convert_test.go +++ b/remote/bitbucketserver/convert_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucketserver import ( diff --git a/remote/bitbucketserver/internal/client.go b/remote/bitbucketserver/internal/client.go index 3b9d84c474..1defa7ba0b 100644 --- a/remote/bitbucketserver/internal/client.go +++ b/remote/bitbucketserver/internal/client.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/bitbucketserver/internal/types.go b/remote/bitbucketserver/internal/types.go index ec74e3cb99..3083cacec9 100644 --- a/remote/bitbucketserver/internal/types.go +++ b/remote/bitbucketserver/internal/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal type User struct { diff --git a/remote/bitbucketserver/parse.go b/remote/bitbucketserver/parse.go index be53525382..a3e4047e17 100644 --- a/remote/bitbucketserver/parse.go +++ b/remote/bitbucketserver/parse.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package bitbucketserver import ( diff --git a/remote/coding/coding.go b/remote/coding/coding.go index 4d98ffe9dd..622be8fe80 100644 --- a/remote/coding/coding.go +++ b/remote/coding/coding.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package coding import ( diff --git a/remote/coding/coding_test.go b/remote/coding/coding_test.go index 149ba996c9..aad4f039fa 100644 --- a/remote/coding/coding_test.go +++ b/remote/coding/coding_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package coding import ( diff --git a/remote/coding/fixtures/handler.go b/remote/coding/fixtures/handler.go index cf5cbb434a..33f054d66d 100644 --- a/remote/coding/fixtures/handler.go +++ b/remote/coding/fixtures/handler.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures import ( diff --git a/remote/coding/fixtures/hooks.go b/remote/coding/fixtures/hooks.go index 8253a6af57..c77715bcca 100644 --- a/remote/coding/fixtures/hooks.go +++ b/remote/coding/fixtures/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures const PushHook = ` diff --git a/remote/coding/hook.go b/remote/coding/hook.go index d073f16681..9f304a0d9f 100644 --- a/remote/coding/hook.go +++ b/remote/coding/hook.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package coding import ( diff --git a/remote/coding/hook_test.go b/remote/coding/hook_test.go index 66483e42ff..2d3e9073b7 100644 --- a/remote/coding/hook_test.go +++ b/remote/coding/hook_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package coding import ( diff --git a/remote/coding/internal/coding.go b/remote/coding/internal/coding.go index f6fc98fddf..420642a91a 100644 --- a/remote/coding/internal/coding.go +++ b/remote/coding/internal/coding.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/coding/internal/error.go b/remote/coding/internal/error.go index fefb9bc3eb..18b76fb920 100644 --- a/remote/coding/internal/error.go +++ b/remote/coding/internal/error.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/coding/internal/file.go b/remote/coding/internal/file.go index 358a21ae6b..616745af3d 100644 --- a/remote/coding/internal/file.go +++ b/remote/coding/internal/file.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/coding/internal/project.go b/remote/coding/internal/project.go index f799c78d83..7f6a95033e 100644 --- a/remote/coding/internal/project.go +++ b/remote/coding/internal/project.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/coding/internal/user.go b/remote/coding/internal/user.go index 0867483a5a..0a874d1def 100644 --- a/remote/coding/internal/user.go +++ b/remote/coding/internal/user.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/coding/internal/webhook.go b/remote/coding/internal/webhook.go index 3bc0e833a3..b9d6c4bbe6 100644 --- a/remote/coding/internal/webhook.go +++ b/remote/coding/internal/webhook.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package internal import ( diff --git a/remote/coding/util.go b/remote/coding/util.go index 9a553ea043..8bac9d02ed 100644 --- a/remote/coding/util.go +++ b/remote/coding/util.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package coding import ( diff --git a/remote/coding/util_test.go b/remote/coding/util_test.go index 704b82e97c..d2cf7af0c8 100644 --- a/remote/coding/util_test.go +++ b/remote/coding/util_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package coding import ( diff --git a/remote/context.go b/remote/context.go index 16ad2b84ed..05258581da 100644 --- a/remote/context.go +++ b/remote/context.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package remote import ( diff --git a/remote/errors.go b/remote/errors.go index 0ad31e7691..f32613d78b 100644 --- a/remote/errors.go +++ b/remote/errors.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package remote // AuthError represents remote authentication error. diff --git a/remote/gerrit/gerrit.go b/remote/gerrit/gerrit.go index 94a339786d..93b3bd2184 100644 --- a/remote/gerrit/gerrit.go +++ b/remote/gerrit/gerrit.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gerrit import ( diff --git a/remote/gitea/fixtures/handler.go b/remote/gitea/fixtures/handler.go index ca6d319afc..daabf814c2 100644 --- a/remote/gitea/fixtures/handler.go +++ b/remote/gitea/fixtures/handler.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures import ( diff --git a/remote/gitea/fixtures/hooks.go b/remote/gitea/fixtures/hooks.go index b33cc9d70a..2cd5210496 100644 --- a/remote/gitea/fixtures/hooks.go +++ b/remote/gitea/fixtures/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures // HookPush is a sample Gitea push hook diff --git a/remote/gitea/gitea.go b/remote/gitea/gitea.go index 26ee8ae096..929b907ec7 100644 --- a/remote/gitea/gitea.go +++ b/remote/gitea/gitea.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea import ( diff --git a/remote/gitea/gitea_test.go b/remote/gitea/gitea_test.go index d0502c8858..3af786478d 100644 --- a/remote/gitea/gitea_test.go +++ b/remote/gitea/gitea_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea import ( diff --git a/remote/gitea/helper.go b/remote/gitea/helper.go index d10f1b8fb4..da094a54d7 100644 --- a/remote/gitea/helper.go +++ b/remote/gitea/helper.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea import ( diff --git a/remote/gitea/helper_test.go b/remote/gitea/helper_test.go index 6f1d672764..ac51c8e1be 100644 --- a/remote/gitea/helper_test.go +++ b/remote/gitea/helper_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea import ( diff --git a/remote/gitea/parse.go b/remote/gitea/parse.go index 650fae2376..d398447c94 100644 --- a/remote/gitea/parse.go +++ b/remote/gitea/parse.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea import ( diff --git a/remote/gitea/parse_test.go b/remote/gitea/parse_test.go index 3ac0cb79a6..2e4f4559f7 100644 --- a/remote/gitea/parse_test.go +++ b/remote/gitea/parse_test.go @@ -1 +1,15 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea diff --git a/remote/gitea/types.go b/remote/gitea/types.go index 63fed544a8..f3ccb334f8 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitea type pushHook struct { diff --git a/remote/github/convert.go b/remote/github/convert.go index c535f5e006..0d1d774eca 100644 --- a/remote/github/convert.go +++ b/remote/github/convert.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github import ( diff --git a/remote/github/convert_test.go b/remote/github/convert_test.go index b6ce845e0b..3a92f844df 100644 --- a/remote/github/convert_test.go +++ b/remote/github/convert_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github import ( diff --git a/remote/github/fixtures/handler.go b/remote/github/fixtures/handler.go index ce4aa3d408..29181689f4 100644 --- a/remote/github/fixtures/handler.go +++ b/remote/github/fixtures/handler.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures import ( diff --git a/remote/github/fixtures/hooks.go b/remote/github/fixtures/hooks.go index da9baac6da..6a07ac3f6f 100644 --- a/remote/github/fixtures/hooks.go +++ b/remote/github/fixtures/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures // HookPush is a sample push hook. diff --git a/remote/github/github.go b/remote/github/github.go index 097c8e758d..d77622bd8b 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github import ( diff --git a/remote/github/github_test.go b/remote/github/github_test.go index bada35cdac..46243a6c95 100644 --- a/remote/github/github_test.go +++ b/remote/github/github_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github import ( diff --git a/remote/github/parse.go b/remote/github/parse.go index 36b6fcf208..6d24bfff06 100644 --- a/remote/github/parse.go +++ b/remote/github/parse.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github import ( diff --git a/remote/github/parse_test.go b/remote/github/parse_test.go index 8152e16cfd..fab286ab53 100644 --- a/remote/github/parse_test.go +++ b/remote/github/parse_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github import ( diff --git a/remote/github/types.go b/remote/github/types.go index b8ed282e8d..d03e5e74f7 100644 --- a/remote/github/types.go +++ b/remote/github/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package github type webhook struct { diff --git a/remote/gitlab/client/drone.go b/remote/gitlab/client/drone.go index 8915e84555..e5a36dcebe 100644 --- a/remote/gitlab/client/drone.go +++ b/remote/gitlab/client/drone.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client const ( diff --git a/remote/gitlab/client/gitlab.go b/remote/gitlab/client/gitlab.go index 1b4bad7498..254d8d2db7 100644 --- a/remote/gitlab/client/gitlab.go +++ b/remote/gitlab/client/gitlab.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab/client/groups.go b/remote/gitlab/client/groups.go index 0e8f30d286..745cdea55f 100644 --- a/remote/gitlab/client/groups.go +++ b/remote/gitlab/client/groups.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab/client/hook.go b/remote/gitlab/client/hook.go index 8ea89689e7..d733178e5a 100644 --- a/remote/gitlab/client/hook.go +++ b/remote/gitlab/client/hook.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab/client/project.go b/remote/gitlab/client/project.go index 47565dd516..251dfd165a 100644 --- a/remote/gitlab/client/project.go +++ b/remote/gitlab/client/project.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab/client/types.go b/remote/gitlab/client/types.go index b950a6d773..b752770886 100644 --- a/remote/gitlab/client/types.go +++ b/remote/gitlab/client/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client type QMap map[string]string diff --git a/remote/gitlab/client/user.go b/remote/gitlab/client/user.go index bafc7c47d4..88a12ae650 100644 --- a/remote/gitlab/client/user.go +++ b/remote/gitlab/client/user.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab/client/util.go b/remote/gitlab/client/util.go index c7418525b9..84c580d55c 100644 --- a/remote/gitlab/client/util.go +++ b/remote/gitlab/client/util.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab/gitlab.go b/remote/gitlab/gitlab.go index a920ca4323..884c125a2f 100644 --- a/remote/gitlab/gitlab.go +++ b/remote/gitlab/gitlab.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitlab import ( diff --git a/remote/gitlab/gitlab_test.go b/remote/gitlab/gitlab_test.go index 6e4f7003f7..78974d1d2b 100644 --- a/remote/gitlab/gitlab_test.go +++ b/remote/gitlab/gitlab_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitlab import ( diff --git a/remote/gitlab/helper.go b/remote/gitlab/helper.go index 03c5092a53..7f80c0b431 100644 --- a/remote/gitlab/helper.go +++ b/remote/gitlab/helper.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitlab import ( diff --git a/remote/gitlab/testdata/hooks.go b/remote/gitlab/testdata/hooks.go index d7e01450b3..ff5ad57bfe 100644 --- a/remote/gitlab/testdata/hooks.go +++ b/remote/gitlab/testdata/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata var TagHook = []byte(` diff --git a/remote/gitlab/testdata/oauth.go b/remote/gitlab/testdata/oauth.go index 95119d70ae..6b975e577d 100644 --- a/remote/gitlab/testdata/oauth.go +++ b/remote/gitlab/testdata/oauth.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata var accessTokenPayload = []byte(`access_token=sekret&scope=api&token_type=bearer`) diff --git a/remote/gitlab/testdata/projects.go b/remote/gitlab/testdata/projects.go index 1dd069e3f6..eb3cfc3977 100644 --- a/remote/gitlab/testdata/projects.go +++ b/remote/gitlab/testdata/projects.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata // sample repository list diff --git a/remote/gitlab/testdata/testdata.go b/remote/gitlab/testdata/testdata.go index 032d4d5882..63db0c4f22 100644 --- a/remote/gitlab/testdata/testdata.go +++ b/remote/gitlab/testdata/testdata.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata import ( diff --git a/remote/gitlab/testdata/users.go b/remote/gitlab/testdata/users.go index e7d5636971..247adc9aa1 100644 --- a/remote/gitlab/testdata/users.go +++ b/remote/gitlab/testdata/users.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata var currentUserPayload = []byte(` diff --git a/remote/gitlab3/client/drone.go b/remote/gitlab3/client/drone.go index 8915e84555..e5a36dcebe 100644 --- a/remote/gitlab3/client/drone.go +++ b/remote/gitlab3/client/drone.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client const ( diff --git a/remote/gitlab3/client/gitlab.go b/remote/gitlab3/client/gitlab.go index 1b4bad7498..254d8d2db7 100644 --- a/remote/gitlab3/client/gitlab.go +++ b/remote/gitlab3/client/gitlab.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab3/client/groups.go b/remote/gitlab3/client/groups.go index 0e8f30d286..745cdea55f 100644 --- a/remote/gitlab3/client/groups.go +++ b/remote/gitlab3/client/groups.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab3/client/hook.go b/remote/gitlab3/client/hook.go index 8ea89689e7..d733178e5a 100644 --- a/remote/gitlab3/client/hook.go +++ b/remote/gitlab3/client/hook.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab3/client/project.go b/remote/gitlab3/client/project.go index f21f1a48a4..455e2138bc 100644 --- a/remote/gitlab3/client/project.go +++ b/remote/gitlab3/client/project.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab3/client/types.go b/remote/gitlab3/client/types.go index 0c6424e03e..5371f2af82 100644 --- a/remote/gitlab3/client/types.go +++ b/remote/gitlab3/client/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client type QMap map[string]string diff --git a/remote/gitlab3/client/user.go b/remote/gitlab3/client/user.go index bafc7c47d4..88a12ae650 100644 --- a/remote/gitlab3/client/user.go +++ b/remote/gitlab3/client/user.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab3/client/util.go b/remote/gitlab3/client/util.go index c7418525b9..84c580d55c 100644 --- a/remote/gitlab3/client/util.go +++ b/remote/gitlab3/client/util.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( diff --git a/remote/gitlab3/gitlab.go b/remote/gitlab3/gitlab.go index 5bc62958e5..eb402de17c 100644 --- a/remote/gitlab3/gitlab.go +++ b/remote/gitlab3/gitlab.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitlab3 import ( diff --git a/remote/gitlab3/gitlab_test.go b/remote/gitlab3/gitlab_test.go index 7d69493c0b..e8bd7bc858 100644 --- a/remote/gitlab3/gitlab_test.go +++ b/remote/gitlab3/gitlab_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitlab3 import ( diff --git a/remote/gitlab3/helper.go b/remote/gitlab3/helper.go index 93f66ef18c..470e19b8b6 100644 --- a/remote/gitlab3/helper.go +++ b/remote/gitlab3/helper.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gitlab3 import ( diff --git a/remote/gitlab3/testdata/hooks.go b/remote/gitlab3/testdata/hooks.go index d7e01450b3..ff5ad57bfe 100644 --- a/remote/gitlab3/testdata/hooks.go +++ b/remote/gitlab3/testdata/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata var TagHook = []byte(` diff --git a/remote/gitlab3/testdata/oauth.go b/remote/gitlab3/testdata/oauth.go index 95119d70ae..6b975e577d 100644 --- a/remote/gitlab3/testdata/oauth.go +++ b/remote/gitlab3/testdata/oauth.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata var accessTokenPayload = []byte(`access_token=sekret&scope=api&token_type=bearer`) diff --git a/remote/gitlab3/testdata/projects.go b/remote/gitlab3/testdata/projects.go index 1dd069e3f6..eb3cfc3977 100644 --- a/remote/gitlab3/testdata/projects.go +++ b/remote/gitlab3/testdata/projects.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata // sample repository list diff --git a/remote/gitlab3/testdata/testdata.go b/remote/gitlab3/testdata/testdata.go index 2fa2322b65..d9ea8995a1 100644 --- a/remote/gitlab3/testdata/testdata.go +++ b/remote/gitlab3/testdata/testdata.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata import ( diff --git a/remote/gitlab3/testdata/users.go b/remote/gitlab3/testdata/users.go index e7d5636971..247adc9aa1 100644 --- a/remote/gitlab3/testdata/users.go +++ b/remote/gitlab3/testdata/users.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package testdata var currentUserPayload = []byte(` diff --git a/remote/gogs/fixtures/handler.go b/remote/gogs/fixtures/handler.go index 5904a1dd33..fa4f74a7af 100644 --- a/remote/gogs/fixtures/handler.go +++ b/remote/gogs/fixtures/handler.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures import ( diff --git a/remote/gogs/fixtures/hooks.go b/remote/gogs/fixtures/hooks.go index fdd1fda150..8aa2e22858 100644 --- a/remote/gogs/fixtures/hooks.go +++ b/remote/gogs/fixtures/hooks.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fixtures // Sample Gogs push hook diff --git a/remote/gogs/gogs.go b/remote/gogs/gogs.go index 8e2339f8c6..74a0f7bd48 100644 --- a/remote/gogs/gogs.go +++ b/remote/gogs/gogs.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs import ( diff --git a/remote/gogs/gogs_test.go b/remote/gogs/gogs_test.go index bfd8728c94..62d3698c2d 100644 --- a/remote/gogs/gogs_test.go +++ b/remote/gogs/gogs_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs import ( diff --git a/remote/gogs/helper.go b/remote/gogs/helper.go index 9bd965591d..680ba5f16b 100644 --- a/remote/gogs/helper.go +++ b/remote/gogs/helper.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs import ( diff --git a/remote/gogs/helper_test.go b/remote/gogs/helper_test.go index 41ec32eba3..8ca9149886 100644 --- a/remote/gogs/helper_test.go +++ b/remote/gogs/helper_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs import ( diff --git a/remote/gogs/parse.go b/remote/gogs/parse.go index a9ac0788e1..3698e20417 100644 --- a/remote/gogs/parse.go +++ b/remote/gogs/parse.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs import ( diff --git a/remote/gogs/parse_test.go b/remote/gogs/parse_test.go index be8cf935b0..a2f4591129 100644 --- a/remote/gogs/parse_test.go +++ b/remote/gogs/parse_test.go @@ -1 +1,15 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs diff --git a/remote/gogs/types.go b/remote/gogs/types.go index c4bed21a69..532247cac9 100644 --- a/remote/gogs/types.go +++ b/remote/gogs/types.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package gogs type pushHook struct { diff --git a/remote/mock/remote.go b/remote/mock/remote.go index f97a677fdd..d273535224 100644 --- a/remote/mock/remote.go +++ b/remote/mock/remote.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package mock import ( diff --git a/remote/remote.go b/remote/remote.go index 929d8c3a23..99f28c67aa 100644 --- a/remote/remote.go +++ b/remote/remote.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package remote //go:generate mockery -name Remote -output mock -case=underscore diff --git a/router/middleware/config.go b/router/middleware/config.go index c90c9ac850..e42e06226f 100644 --- a/router/middleware/config.go +++ b/router/middleware/config.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package middleware import ( diff --git a/router/middleware/header/header.go b/router/middleware/header/header.go index 7b82154abd..333a6b8222 100644 --- a/router/middleware/header/header.go +++ b/router/middleware/header/header.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package header import ( diff --git a/router/middleware/remote.go b/router/middleware/remote.go index cfc7482388..17bdb90a3c 100644 --- a/router/middleware/remote.go +++ b/router/middleware/remote.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package middleware import ( diff --git a/router/middleware/session/agent.go b/router/middleware/session/agent.go index d1a31c66ce..dae56d4a96 100644 --- a/router/middleware/session/agent.go +++ b/router/middleware/session/agent.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package session import ( diff --git a/router/middleware/session/repo.go b/router/middleware/session/repo.go index 2822d0095e..fddb69b0ad 100644 --- a/router/middleware/session/repo.go +++ b/router/middleware/session/repo.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package session import ( diff --git a/router/middleware/session/repo_test.go b/router/middleware/session/repo_test.go index 349b4e3ac7..de2bbdccbd 100644 --- a/router/middleware/session/repo_test.go +++ b/router/middleware/session/repo_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package session import ( diff --git a/router/middleware/session/user.go b/router/middleware/session/user.go index f965014a68..64f0bf3c2f 100644 --- a/router/middleware/session/user.go +++ b/router/middleware/session/user.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package session import ( diff --git a/router/middleware/store.go b/router/middleware/store.go index 09e52d3878..c0a02c4b09 100644 --- a/router/middleware/store.go +++ b/router/middleware/store.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package middleware import ( diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index 52440194a0..d5ca0f20f4 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package token import ( diff --git a/router/middleware/version.go b/router/middleware/version.go index 87170010a3..fbed00c700 100644 --- a/router/middleware/version.go +++ b/router/middleware/version.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package middleware import ( diff --git a/router/router.go b/router/router.go index 0cb4fd1197..c86dc13baa 100644 --- a/router/router.go +++ b/router/router.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package router import ( diff --git a/server/badge.go b/server/badge.go index 455bd90a93..aa1263cff6 100644 --- a/server/badge.go +++ b/server/badge.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/build.go b/server/build.go index c66807d6ac..838d46f128 100644 --- a/server/build.go +++ b/server/build.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/debug/debug.go b/server/debug/debug.go index d4e2346d44..17458b43e7 100644 --- a/server/debug/debug.go +++ b/server/debug/debug.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package debug import ( diff --git a/server/file.go b/server/file.go index f360c82d4b..0b2f479131 100644 --- a/server/file.go +++ b/server/file.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/hook.go b/server/hook.go index d213b61932..e47fd89d3d 100644 --- a/server/hook.go +++ b/server/hook.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/hook_test.go b/server/hook_test.go index 51af94e661..546bafabeb 100644 --- a/server/hook_test.go +++ b/server/hook_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/login.go b/server/login.go index 0a41ff3955..3f78bf1615 100644 --- a/server/login.go +++ b/server/login.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/metrics/prometheus.go b/server/metrics/prometheus.go index 1eea896165..fa28c2fbc3 100644 --- a/server/metrics/prometheus.go +++ b/server/metrics/prometheus.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package metrics import ( diff --git a/server/registry.go b/server/registry.go index d1a46b6afa..d9ee7e21de 100644 --- a/server/registry.go +++ b/server/registry.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/repo.go b/server/repo.go index b8c1faaa22..f77e52b463 100644 --- a/server/repo.go +++ b/server/repo.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/rpc.go b/server/rpc.go index d099ff4bcb..aceadca9a5 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/secret.go b/server/secret.go index 34bed546b9..8c5b20930c 100644 --- a/server/secret.go +++ b/server/secret.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/stream.go b/server/stream.go index d8625e90af..290c5ef51c 100644 --- a/server/stream.go +++ b/server/stream.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/swagger/doc.go b/server/swagger/doc.go index 2642c47d47..5778d5b987 100644 --- a/server/swagger/doc.go +++ b/server/swagger/doc.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Package classification Drone API. // // Schemes: http, https diff --git a/server/swagger/swagger.go b/server/swagger/swagger.go index 2e7a006f1d..d205abbe4b 100644 --- a/server/swagger/swagger.go +++ b/server/swagger/swagger.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package swagger import ( diff --git a/server/sync.go b/server/sync.go index 9d42835f66..8e0ac1033a 100644 --- a/server/sync.go +++ b/server/sync.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/user.go b/server/user.go index 00402ae712..c6eaaf80b5 100644 --- a/server/user.go +++ b/server/user.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/users.go b/server/users.go index 410e8b8d21..08a46f1d20 100644 --- a/server/users.go +++ b/server/users.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/server/web/opts.go b/server/web/opts.go index 09d0c6d3a8..5d77fd2113 100644 --- a/server/web/opts.go +++ b/server/web/opts.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package web import "time" diff --git a/server/web/opts_test.go b/server/web/opts_test.go index 188ec09da3..d26ee04711 100644 --- a/server/web/opts_test.go +++ b/server/web/opts_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package web import ( diff --git a/server/web/template.go b/server/web/template.go index dd93a74a04..4f3bd80aaa 100644 --- a/server/web/template.go +++ b/server/web/template.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package web import ( diff --git a/server/web/template_test.go b/server/web/template_test.go index 3a0895ff08..a1286d42e1 100644 --- a/server/web/template_test.go +++ b/server/web/template_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package web import ( diff --git a/server/web/web.go b/server/web/web.go index 58cb5dcee9..6a16f44777 100644 --- a/server/web/web.go +++ b/server/web/web.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package web import ( diff --git a/server/z.go b/server/z.go index 69df93ada0..e606b9f9e7 100644 --- a/server/z.go +++ b/server/z.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package server import ( diff --git a/shared/httputil/httputil.go b/shared/httputil/httputil.go index 86cc7b5a11..3c976155f1 100644 --- a/shared/httputil/httputil.go +++ b/shared/httputil/httputil.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package httputil import ( diff --git a/shared/token/token.go b/shared/token/token.go index d4f83a2b84..492943dd9d 100644 --- a/shared/token/token.go +++ b/shared/token/token.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package token import ( diff --git a/store/context.go b/store/context.go index 10112dde53..bceed28aa1 100644 --- a/store/context.go +++ b/store/context.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package store import ( diff --git a/store/datastore/builds.go b/store/datastore/builds.go index fddee0b25d..74c83bac10 100644 --- a/store/datastore/builds.go +++ b/store/datastore/builds.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/builds_test.go b/store/datastore/builds_test.go index 69497f85f9..dcc9bb2d01 100644 --- a/store/datastore/builds_test.go +++ b/store/datastore/builds_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/config.go b/store/datastore/config.go index ca6d6f24af..f5eae4dedc 100644 --- a/store/datastore/config.go +++ b/store/datastore/config.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/config_test.go b/store/datastore/config_test.go index cdcceaab30..e4784d3fd0 100644 --- a/store/datastore/config_test.go +++ b/store/datastore/config_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/ddl/migrate.go b/store/datastore/ddl/migrate.go index d59e201437..568848e1be 100644 --- a/store/datastore/ddl/migrate.go +++ b/store/datastore/ddl/migrate.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package ddl import ( diff --git a/store/datastore/ddl/mysql/ddl.go b/store/datastore/ddl/mysql/ddl.go index 42ab9ab9fe..6305f4ceae 100644 --- a/store/datastore/ddl/mysql/ddl.go +++ b/store/datastore/ddl/mysql/ddl.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package mysql //go:generate togo ddl -package mysql -dialect mysql diff --git a/store/datastore/ddl/mysql/ddl_gen.go b/store/datastore/ddl/mysql/ddl_gen.go index 0bd0ca69a2..11627f09c6 100644 --- a/store/datastore/ddl/mysql/ddl_gen.go +++ b/store/datastore/ddl/mysql/ddl_gen.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package mysql import ( diff --git a/store/datastore/ddl/postgres/ddl.go b/store/datastore/ddl/postgres/ddl.go index cb1877039c..fbe05329a0 100644 --- a/store/datastore/ddl/postgres/ddl.go +++ b/store/datastore/ddl/postgres/ddl.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package postgres //go:generate togo ddl -package postgres -dialect postgres diff --git a/store/datastore/ddl/postgres/ddl_gen.go b/store/datastore/ddl/postgres/ddl_gen.go index 2e999e220e..b4ff8337ef 100644 --- a/store/datastore/ddl/postgres/ddl_gen.go +++ b/store/datastore/ddl/postgres/ddl_gen.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package postgres import ( diff --git a/store/datastore/ddl/sqlite/ddl.go b/store/datastore/ddl/sqlite/ddl.go index 5573bad290..2b730c9c2f 100644 --- a/store/datastore/ddl/sqlite/ddl.go +++ b/store/datastore/ddl/sqlite/ddl.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package sqlite //go:generate togo ddl -package sqlite -dialect sqlite3 diff --git a/store/datastore/ddl/sqlite/ddl_gen.go b/store/datastore/ddl/sqlite/ddl_gen.go index e4e46247bf..cb3e69645d 100644 --- a/store/datastore/ddl/sqlite/ddl_gen.go +++ b/store/datastore/ddl/sqlite/ddl_gen.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package sqlite import ( diff --git a/store/datastore/files.go b/store/datastore/files.go index a52965ea4b..e32d070a39 100644 --- a/store/datastore/files.go +++ b/store/datastore/files.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/files_test.go b/store/datastore/files_test.go index 051e78a1db..441f297902 100644 --- a/store/datastore/files_test.go +++ b/store/datastore/files_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/init.go b/store/datastore/init.go index b006609028..f2dd486cd5 100644 --- a/store/datastore/init.go +++ b/store/datastore/init.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // +build !cgo package datastore diff --git a/store/datastore/init_cgo.go b/store/datastore/init_cgo.go index 0aa3ef76d2..6c9e0ede17 100644 --- a/store/datastore/init_cgo.go +++ b/store/datastore/init_cgo.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // +build cgo package datastore diff --git a/store/datastore/logs.go b/store/datastore/logs.go index 841ef7de37..2604d179d5 100644 --- a/store/datastore/logs.go +++ b/store/datastore/logs.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/logs_test.go b/store/datastore/logs_test.go index 6641787086..7abb48f800 100644 --- a/store/datastore/logs_test.go +++ b/store/datastore/logs_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/perms.go b/store/datastore/perms.go index ffa4f77e12..1871d426f9 100644 --- a/store/datastore/perms.go +++ b/store/datastore/perms.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/perms_test.go b/store/datastore/perms_test.go index 113b550cbd..1ab82431e5 100644 --- a/store/datastore/perms_test.go +++ b/store/datastore/perms_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/procs.go b/store/datastore/procs.go index 7dcce95ecb..51502652ba 100644 --- a/store/datastore/procs.go +++ b/store/datastore/procs.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/procs_test.go b/store/datastore/procs_test.go index 2f9849d361..b5d429c1b4 100644 --- a/store/datastore/procs_test.go +++ b/store/datastore/procs_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/registry.go b/store/datastore/registry.go index 6e16d36568..f2b13dd3d0 100644 --- a/store/datastore/registry.go +++ b/store/datastore/registry.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/registry_test.go b/store/datastore/registry_test.go index 3df5b611b6..ea8a49aacd 100644 --- a/store/datastore/registry_test.go +++ b/store/datastore/registry_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/repos.go b/store/datastore/repos.go index eda92d9010..10e74e1578 100644 --- a/store/datastore/repos.go +++ b/store/datastore/repos.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/repos_test.go b/store/datastore/repos_test.go index ddd1218a97..b4c209f4b2 100644 --- a/store/datastore/repos_test.go +++ b/store/datastore/repos_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/secret.go b/store/datastore/secret.go index 33e8c0c7ed..c05dbf2746 100644 --- a/store/datastore/secret.go +++ b/store/datastore/secret.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/secret_test.go b/store/datastore/secret_test.go index c5b02883fc..54ed058c83 100644 --- a/store/datastore/secret_test.go +++ b/store/datastore/secret_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/sender.go b/store/datastore/sender.go index 7843108631..0dd2099f97 100644 --- a/store/datastore/sender.go +++ b/store/datastore/sender.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/sender_test.go b/store/datastore/sender_test.go index 346ce2c6f8..5c73230979 100644 --- a/store/datastore/sender_test.go +++ b/store/datastore/sender_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/sql/lookup.go b/store/datastore/sql/lookup.go index da3643f91e..f9c6eec7df 100644 --- a/store/datastore/sql/lookup.go +++ b/store/datastore/sql/lookup.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package sql import ( diff --git a/store/datastore/sql/mysql/sql.go b/store/datastore/sql/mysql/sql.go index 3e7d8abf61..cc49a56d3e 100644 --- a/store/datastore/sql/mysql/sql.go +++ b/store/datastore/sql/mysql/sql.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package mysql //go:generate togo sql --package=mysql diff --git a/store/datastore/sql/mysql/sql_gen.go b/store/datastore/sql/mysql/sql_gen.go index 313a53eb48..b9b2051447 100644 --- a/store/datastore/sql/mysql/sql_gen.go +++ b/store/datastore/sql/mysql/sql_gen.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package mysql // Lookup returns the named statement. diff --git a/store/datastore/sql/postgres/sql.go b/store/datastore/sql/postgres/sql.go index 08b7734517..6623eefa5b 100644 --- a/store/datastore/sql/postgres/sql.go +++ b/store/datastore/sql/postgres/sql.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package postgres //go:generate togo sql --package=postgres diff --git a/store/datastore/sql/postgres/sql_gen.go b/store/datastore/sql/postgres/sql_gen.go index 3f0e2dacd5..8bf1581901 100644 --- a/store/datastore/sql/postgres/sql_gen.go +++ b/store/datastore/sql/postgres/sql_gen.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package postgres // Lookup returns the named statement. diff --git a/store/datastore/sql/sqlite/sql.go b/store/datastore/sql/sqlite/sql.go index 9b8267f68c..c1147069e3 100644 --- a/store/datastore/sql/sqlite/sql.go +++ b/store/datastore/sql/sqlite/sql.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package sqlite //go:generate togo sql --package=sqlite diff --git a/store/datastore/sql/sqlite/sql_gen.go b/store/datastore/sql/sqlite/sql_gen.go index e98d2e36e5..11b5e897fb 100644 --- a/store/datastore/sql/sqlite/sql_gen.go +++ b/store/datastore/sql/sqlite/sql_gen.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package sqlite // Lookup returns the named statement. diff --git a/store/datastore/store.go b/store/datastore/store.go index eb7058dc48..4cdc69f6a0 100644 --- a/store/datastore/store.go +++ b/store/datastore/store.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/task.go b/store/datastore/task.go index d82e23800a..969395257d 100644 --- a/store/datastore/task.go +++ b/store/datastore/task.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/task_test.go b/store/datastore/task_test.go index a155076586..da8083d861 100644 --- a/store/datastore/task_test.go +++ b/store/datastore/task_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/users.go b/store/datastore/users.go index ba432c346d..fef11983b2 100644 --- a/store/datastore/users.go +++ b/store/datastore/users.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/users_test.go b/store/datastore/users_test.go index f37dbce56c..14094f898a 100644 --- a/store/datastore/users_test.go +++ b/store/datastore/users_test.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/datastore/utils.go b/store/datastore/utils.go index dbf0e8b75d..56a843bfb3 100644 --- a/store/datastore/utils.go +++ b/store/datastore/utils.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package datastore import ( diff --git a/store/store.go b/store/store.go index 88c6ccff25..2b2393b041 100644 --- a/store/store.go +++ b/store/store.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package store import ( diff --git a/version/version.go b/version/version.go index c596253817..f5219e3dc0 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,17 @@ +// Copyright 2018 Drone.IO Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package version import "github.com/coreos/go-semver/semver" From 487f6c9501df309000a1f9df89dbc7780a2b27fb Mon Sep 17 00:00:00 2001 From: Philippe Schommers Date: Tue, 20 Feb 2018 18:53:03 +0100 Subject: [PATCH 53/91] Fix gitea `actionSync` --- remote/gitea/parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/gitea/parse.go b/remote/gitea/parse.go index d398447c94..731926f9f7 100644 --- a/remote/gitea/parse.go +++ b/remote/gitea/parse.go @@ -28,7 +28,7 @@ const ( hookPullRequest = "pull_request" actionOpen = "opened" - actionSync = "synchronize" + actionSync = "synchronized" stateOpen = "open" From 6d61e57e9391edb1ec9a2c7b730d83eddae0c139 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 21 Feb 2018 14:12:10 -0800 Subject: [PATCH 54/91] enable periodic tokens --- plugins/secrets/vault/opts.go | 26 ++++ plugins/secrets/vault/opts_test.go | 28 ++++ plugins/secrets/vault/vault.go | 219 ++++++++++++++++++++++++++++ plugins/secrets/vault/vault_test.go | 99 +++++++++++++ 4 files changed, 372 insertions(+) create mode 100644 plugins/secrets/vault/opts.go create mode 100644 plugins/secrets/vault/opts_test.go create mode 100644 plugins/secrets/vault/vault.go create mode 100644 plugins/secrets/vault/vault_test.go diff --git a/plugins/secrets/vault/opts.go b/plugins/secrets/vault/opts.go new file mode 100644 index 0000000000..e2833aaa32 --- /dev/null +++ b/plugins/secrets/vault/opts.go @@ -0,0 +1,26 @@ +// Copyright 2018 Drone.IO Inc +// Use of this software is governed by the Drone Enterpise License +// that can be found in the LICENSE file. + +package vault + +import "time" + +// Opts sets custom options for the vault client. +type Opts func(v *vault) + +// WithTTL returns an options that sets a TTL used to +// refresh periodic tokens. +func WithTTL(d time.Duration) Opts { + return func(v *vault) { + v.ttl = d + } +} + +// WithRenewal returns an options that sets the renewal +// period used to refresh periodic tokens +func WithRenewal(d time.Duration) Opts { + return func(v *vault) { + v.renew = d + } +} diff --git a/plugins/secrets/vault/opts_test.go b/plugins/secrets/vault/opts_test.go new file mode 100644 index 0000000000..217a98892d --- /dev/null +++ b/plugins/secrets/vault/opts_test.go @@ -0,0 +1,28 @@ +// Copyright 2018 Drone.IO Inc +// Use of this software is governed by the Drone Enterpise License +// that can be found in the LICENSE file. + +package vault + +import ( + "testing" + "time" +) + +func TestWithTTL(t *testing.T) { + v := new(vault) + opt := WithTTL(time.Hour) + opt(v) + if got, want := v.ttl, time.Hour; got != want { + t.Errorf("Want ttl %v, got %v", want, got) + } +} + +func TestWithRenewal(t *testing.T) { + v := new(vault) + opt := WithRenewal(time.Hour) + opt(v) + if got, want := v.renew, time.Hour; got != want { + t.Errorf("Want renewal %v, got %v", want, got) + } +} diff --git a/plugins/secrets/vault/vault.go b/plugins/secrets/vault/vault.go new file mode 100644 index 0000000000..407858381d --- /dev/null +++ b/plugins/secrets/vault/vault.go @@ -0,0 +1,219 @@ +// Copyright 2018 Drone.IO Inc +// Use of this software is governed by the Drone Enterpise License +// that can be found in the LICENSE file. + +package vault + +import ( + "path" + "strings" + "time" + + "github.com/Sirupsen/logrus" + "github.com/drone/drone/extras/secrets" + "github.com/drone/drone/model" + + "github.com/hashicorp/vault/api" + "gopkg.in/yaml.v2" +) + +// yaml configuration representation +// +// secrets: +// docker_username: +// file: path/to/docker/username +// docker_password: +// file: path/to/docker/password +// +type vaultConfig struct { + Secrets map[string]struct { + Path string + File string + Vault string + } +} + +type vault struct { + store model.ConfigStore + client *api.Client + ttl time.Duration + renew time.Duration + done chan struct{} +} + +// New returns a new store with secrets loaded from vault. +func New(store model.ConfigStore, opts ...Opts) (secrets.Plugin, error) { + client, err := api.NewClient(nil) + if err != nil { + return nil, err + } + v := &vault{ + store: store, + client: client, + } + for _, opt := range opts { + opt(v) + } + v.start() // start the refresh process. + return v, nil +} + +func (v *vault) SecretListBuild(repo *model.Repo, build *model.Build) ([]*model.Secret, error) { + return v.list(repo, build) +} + +func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, error) { + conf, err := v.store.ConfigLoad(build.ConfigID) + if err != nil { + return nil, err + } + var ( + in = []byte(conf.Data) + out = new(vaultConfig) + + secrets []*model.Secret + ) + err = yaml.Unmarshal(in, out) + if err != nil { + return nil, err + } + for key, val := range out.Secrets { + var path string + switch { + case val.Path != "": + path = val.Path + case val.File != "": + path = val.File + case val.Vault != "": + path = val.Vault + } + + if path == "" { + continue + } + + vaultSecret, err := v.get(path) + if err != nil { + return nil, err + } + if vaultSecret == nil { + continue + } + if !vaultSecret.Match(repo.FullName) { + continue + } + + secrets = append(secrets, &model.Secret{ + Name: key, + Value: vaultSecret.Value, + Events: vaultSecret.Event, + Images: vaultSecret.Image, + }) + } + return secrets, nil +} + +func (v *vault) get(path string) (*vaultSecret, error) { + secret, err := v.client.Logical().Read(path) + if err != nil { + return nil, err + } + if secret == nil || secret.Data == nil { + return nil, nil + } + return parseVaultSecret(secret.Data), nil +} + +// start starts the renewal loop. +func (v *vault) start() { + if v.renew == 0 || v.ttl == 0 { + logrus.Debugf("vault: token renewal disabled") + return + } + if v.done != nil { + close(v.done) + } + logrus.Debugf("vault: token renewal enabled: renew every %v", v.renew) + v.done = make(chan struct{}) + if v.renew != 0 { + go v.renewLoop() + } +} + +// stop stops the renewal loop. +func (v *vault) stop() { + close(v.done) +} + +func (v *vault) renewLoop() { + for { + select { + case <-time.After(v.renew): + incr := int(v.ttl / time.Second) + + logrus.Debugf("vault: refreshing token: increment %v", v.ttl) + _, err := v.client.Auth().Token().RenewSelf(incr) + if err != nil { + logrus.Errorf("vault: refreshing token failed: %s", err) + } else { + logrus.Debugf("vault: refreshing token succeeded") + } + case <-v.done: + return + } + } +} + +type vaultSecret struct { + Value string + Image []string + Event []string + Repo []string +} + +func parseVaultSecret(data map[string]interface{}) *vaultSecret { + secret := new(vaultSecret) + + if vvalue, ok := data["value"]; ok { + if svalue, ok := vvalue.(string); ok { + secret.Value = svalue + } + } + if vimage, ok := data["image"]; ok { + if simage, ok := vimage.(string); ok { + secret.Image = strings.Split(simage, ",") + } + } + if vevent, ok := data["event"]; ok { + if sevent, ok := vevent.(string); ok { + secret.Event = strings.Split(sevent, ",") + } + } + if vrepo, ok := data["repo"]; ok { + if srepo, ok := vrepo.(string); ok { + secret.Repo = strings.Split(srepo, ",") + } + } + if secret.Event == nil { + secret.Event = []string{} + } + if secret.Image == nil { + secret.Image = []string{} + } + if secret.Repo == nil { + secret.Repo = []string{} + } + return secret +} + +func (v *vaultSecret) Match(name string) bool { + if len(v.Repo) == 0 { + return true + } + for _, pattern := range v.Repo { + if ok, _ := path.Match(pattern, name); ok { + return true + } + } + return false +} diff --git a/plugins/secrets/vault/vault_test.go b/plugins/secrets/vault/vault_test.go new file mode 100644 index 0000000000..fd93853b38 --- /dev/null +++ b/plugins/secrets/vault/vault_test.go @@ -0,0 +1,99 @@ +// Copyright 2018 Drone.IO Inc +// Use of this software is governed by the Drone Enterpise License +// that can be found in the LICENSE file. + +package vault + +import ( + "os" + "reflect" + "testing" + + "github.com/hashicorp/vault/api" + "github.com/kr/pretty" +) + +// Use the following snippet to spin up a local vault +// server for integration testing: +// +// docker run --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=dummy' -p 8200:8200 vault +// export VAULT_ADDR=http://127.0.0.1:8200 +// export VAULT_TOKEN=dummy + +func TestVaultGet(t *testing.T) { + if os.Getenv("VAULT_TOKEN") == "" { + t.SkipNow() + return + } + + client, err := api.NewClient(nil) + if err != nil { + t.Error(err) + return + } + + _, err = client.Logical().Write("secret/testing/drone/a", map[string]interface{}{ + "value": "hello", + "image": "golang", + "event": "push,pull_request", + "repo": "octocat/hello-world,github/*", + }) + if err != nil { + t.Error(err) + return + } + + plugin := vault{client: client} + secret, err := plugin.get("secret/testing/drone/a") + if err != nil { + t.Error(err) + return + } + + if got, want := secret.Value, "hello"; got != want { + t.Errorf("Expect secret value %s, got %s", want, got) + } + + secret, err = plugin.get("secret/testing/drone/404") + if err != nil { + t.Errorf("Expect silent failure when secret does not exist, got %s", err) + } + if secret != nil { + t.Errorf("Expect nil secret when path does not exist") + } +} + +func TestVaultSecretParse(t *testing.T) { + data := map[string]interface{}{ + "value": "password", + "event": "push,tag", + "image": "plugins/s3,plugins/ec2", + "repo": "octocat/hello-world,github/*", + } + want := vaultSecret{ + Value: "password", + Event: []string{"push", "tag"}, + Image: []string{"plugins/s3", "plugins/ec2"}, + Repo: []string{"octocat/hello-world", "github/*"}, + } + got := parseVaultSecret(data) + if !reflect.DeepEqual(want, *got) { + t.Errorf("Failed read Secret.Data") + pretty.Fdiff(os.Stderr, want, got) + } +} + +func TestVaultSecretMatch(t *testing.T) { + secret := vaultSecret{ + Repo: []string{"octocat/hello-world", "github/*"}, + } + if secret.Match("octocat/*") { + t.Errorf("Expect octocat/* does not match") + } + if !secret.Match("octocat/hello-world") { + t.Errorf("Expect octocat/hello-world does match") + } + if !secret.Match("github/hello-world") { + t.Errorf("Expect github/hello-world does match wildcard") + } +} From a12fe492969831e0118b72d9bb16b2e284423274 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 21 Feb 2018 14:23:37 -0800 Subject: [PATCH 55/91] add secret plugin interface --- plugins/secrets/plugin.go | 48 ++++++++++++++++++++++++ plugins/secrets/plugin_test.go | 68 ++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 plugins/secrets/plugin.go create mode 100644 plugins/secrets/plugin_test.go diff --git a/plugins/secrets/plugin.go b/plugins/secrets/plugin.go new file mode 100644 index 0000000000..0ec22c5e94 --- /dev/null +++ b/plugins/secrets/plugin.go @@ -0,0 +1,48 @@ +// Copyright 2018 Drone.IO Inc +// Use of this software is governed by the Drone Enterpise License +// that can be found in the LICENSE file. + +package secrets + +import ( + "github.com/drone/drone/model" + "github.com/drone/drone/store" +) + +// NewDefault returns the Store wrapped as a Service. +func NewDefault(store store.Store) model.SecretService { + return New(store) +} + +// Plugin defines the required interface for implementing a remote +// secret plugin and sourcing secrets from an external source. +type Plugin interface { + SecretListBuild(*model.Repo, *model.Build) ([]*model.Secret, error) +} + +// Extend exetends the base secret service with the plugin. +func Extend(base model.SecretService, with Plugin) model.SecretService { + return &extender{base, with} +} + +type extender struct { + model.SecretService + plugin Plugin +} + +// extends the base secret service and combines the secret list with the +// secret list returned by the plugin. +func (e *extender) SecretListBuild(repo *model.Repo, build *model.Build) ([]*model.Secret, error) { + base, err := e.SecretService.SecretListBuild(repo, build) + if err != nil { + return nil, err + } + with, err := e.plugin.SecretListBuild(repo, build) + if err != nil { + return nil, err + } + for _, secret := range base { + with = append(with, secret) + } + return with, nil +} diff --git a/plugins/secrets/plugin_test.go b/plugins/secrets/plugin_test.go new file mode 100644 index 0000000000..3f411aea63 --- /dev/null +++ b/plugins/secrets/plugin_test.go @@ -0,0 +1,68 @@ +// Copyright 2018 Drone.IO Inc +// Use of this software is governed by the Drone Enterpise License +// that can be found in the LICENSE file. + +package secrets + +import ( + "testing" + + "github.com/drone/drone/model" +) + +func TestExtends(t *testing.T) { + base := &mocker{} + base.list = []*model.Secret{ + {Name: "foo"}, + {Name: "bar"}, + } + + with := &mocker{} + with.list = []*model.Secret{ + {Name: "baz"}, + {Name: "qux"}, + } + + extended := Extend(base, with) + list, err := extended.SecretListBuild(nil, nil) + if err != nil { + t.Errorf("Expected combined secret list, got error %q", err) + } + + if got, want := list[0], with.list[0]; got != want { + t.Errorf("Expected correct precedence. Want %s, got %s", want.Name, got.Name) + } + if got, want := list[1], with.list[1]; got != want { + t.Errorf("Expected correct precedence. Want %s, got %s", want.Name, got.Name) + } + if got, want := list[2], base.list[0]; got != want { + t.Errorf("Expected correct precedence. Want %s, got %s", want.Name, got.Name) + } + if got, want := list[3], base.list[1]; got != want { + t.Errorf("Expected correct precedence. Want %s, got %s", want.Name, got.Name) + } +} + +type mocker struct { + list []*model.Secret + error error +} + +func (m *mocker) SecretFind(*model.Repo, string) (*model.Secret, error) { + return nil, nil +} +func (m *mocker) SecretList(*model.Repo) ([]*model.Secret, error) { + return nil, nil +} +func (m *mocker) SecretListBuild(*model.Repo, *model.Build) ([]*model.Secret, error) { + return m.list, m.error +} +func (m *mocker) SecretCreate(*model.Repo, *model.Secret) error { + return nil +} +func (m *mocker) SecretUpdate(*model.Repo, *model.Secret) error { + return nil +} +func (m *mocker) SecretDelete(*model.Repo, string) error { + return nil +} From 5f5a0413fe537a468c9b5a09419e90e8f5b1c17a Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 21 Feb 2018 14:24:45 -0800 Subject: [PATCH 56/91] add secret plugin interface --- plugins/secrets/vault/vault.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/secrets/vault/vault.go b/plugins/secrets/vault/vault.go index 407858381d..e1b5586334 100644 --- a/plugins/secrets/vault/vault.go +++ b/plugins/secrets/vault/vault.go @@ -10,8 +10,8 @@ import ( "time" "github.com/Sirupsen/logrus" - "github.com/drone/drone/extras/secrets" "github.com/drone/drone/model" + "github.com/drone/drone/plugins/secrets" "github.com/hashicorp/vault/api" "gopkg.in/yaml.v2" From 5e557bb2d85c948215eeff086f967bba0b8e2a5e Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 23 Feb 2018 09:11:47 -0800 Subject: [PATCH 57/91] add debug logs to vault implementation --- plugins/secrets/vault/vault.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/secrets/vault/vault.go b/plugins/secrets/vault/vault.go index e1b5586334..dc6871167b 100644 --- a/plugins/secrets/vault/vault.go +++ b/plugins/secrets/vault/vault.go @@ -92,17 +92,24 @@ func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, err continue } + logrus.Debugf("vault: read secret: %s", path) + vaultSecret, err := v.get(path) if err != nil { + logrus.Debugf("vault: read secret failed: %s: %s", path, err) return nil, err } if vaultSecret == nil { + logrus.Debugf("vault: read secret failed: %s: not found or empty value", path) continue } if !vaultSecret.Match(repo.FullName) { + logrus.Debugf("vault: read secret: %s: restricted: %s", path, repo.FullName) continue } + logrus.Debugf("vault: read secret success: %s", err) + secrets = append(secrets, &model.Secret{ Name: key, Value: vaultSecret.Value, @@ -133,7 +140,7 @@ func (v *vault) start() { if v.done != nil { close(v.done) } - logrus.Debugf("vault: token renewal enabled: renew every %v", v.renew) + logrus.Infof("vault: token renewal enabled: renew every %v", v.renew) v.done = make(chan struct{}) if v.renew != 0 { go v.renewLoop() From 97da9394755b2967649a4958f0abab359becb644 Mon Sep 17 00:00:00 2001 From: Rodolfo Rodriguez Date: Thu, 1 Mar 2018 17:09:33 -0600 Subject: [PATCH 58/91] Update router.go Removes unused code --- router/router.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/router/router.go b/router/router.go index c86dc13baa..efbb5364be 100644 --- a/router/router.go +++ b/router/router.go @@ -189,10 +189,3 @@ func Load(mux *httptreemux.ContextMux, middleware ...gin.HandlerFunc) http.Handl return e } - -// type FileHandler interface { -// Index(res http.ResponseWriter, data interface{}) error -// Login(res http.ResponseWriter, data interface{}) error -// Error(res http.ResponseWriter, data interface{}) error -// Asset(res http.ResponseWriter, req *http.Request) -// } From 9ac3720b535db0c4cf1053cb4e82884e7be9abfb Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Sat, 3 Mar 2018 13:56:07 +0100 Subject: [PATCH 59/91] Refspec patch --- .../cncd/pipeline/pipeline/frontend/yaml/constraint.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go index 1b1c8b1293..a59dabb231 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go +++ b/vendor/github.com/cncd/pipeline/pipeline/frontend/yaml/constraint.go @@ -19,6 +19,7 @@ type ( Event Constraint Branch Constraint Status Constraint + Refspec Constraint Matrix ConstraintMap Local types.BoolTrue } @@ -43,6 +44,7 @@ func (c *Constraints) Match(metadata frontend.Metadata) bool { c.Environment.Match(metadata.Curr.Target) && c.Event.Match(metadata.Curr.Event) && c.Branch.Match(metadata.Curr.Commit.Branch) && + c.Refspec.Match(metadata.Curr.Commit.Refspec) && c.Repo.Match(metadata.Repo.Name) && c.Ref.Match(metadata.Curr.Commit.Ref) && c.Instance.Match(metadata.Sys.Host) && From e5ad6ec12340a61b7b1e18c4921a76247b9df07d Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Sat, 3 Mar 2018 13:58:02 +0100 Subject: [PATCH 60/91] OSS version --- .drone.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.sh b/.drone.sh index 8e1afe77bd..c93a260268 100755 --- a/.drone.sh +++ b/.drone.sh @@ -19,10 +19,9 @@ ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null # clone the extras project. set -e set -x -git clone git@github.com:drone/drone-enterprise.git extras # build a static binary with the build number and extra features. -go build -ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=build.'${DRONE_BUILD_NUMBER} -o release/drone-server github.com/drone/drone/extras/cmd/drone-server +go build -ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=build.'${DRONE_BUILD_NUMBER} -o release/drone-server github.com/drone/drone/cmd/drone-server GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-X github.com/drone/drone/version.VersionDev=build.'${DRONE_BUILD_NUMBER} -o release/drone-agent github.com/drone/drone/cmd/drone-agent GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags '-X github.com/drone/drone/version.VersionDev=build.'${DRONE_BUILD_NUMBER} -o release/linux/arm64/drone-agent github.com/drone/drone/cmd/drone-agent GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -ldflags '-X github.com/drone/drone/version.VersionDev=build.'${DRONE_BUILD_NUMBER} -o release/linux/arm/drone-agent github.com/drone/drone/cmd/drone-agent From 23736541ba130101138604edd9c007fd93fe039c Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Sat, 3 Mar 2018 14:11:32 +0100 Subject: [PATCH 61/91] Fixed build --- .drone.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.drone.sh b/.drone.sh index c93a260268..b06cb1e41c 100755 --- a/.drone.sh +++ b/.drone.sh @@ -3,15 +3,7 @@ # only execute this script as part of the pipeline. [ -z "$CI" ] && echo "missing ci environment variable" && exit 2 -# only execute the script when github token exists. -[ -z "$SSH_KEY" ] && echo "missing ssh key" && exit 3 - -# write the ssh key. mkdir /root/.ssh -echo -n "$SSH_KEY" > /root/.ssh/id_rsa -chmod 600 /root/.ssh/id_rsa - -# add github.com to our known hosts. touch /root/.ssh/known_hosts chmod 600 /root/.ssh/known_hosts ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null From 6b0f782c00d0f9df918052ed62f10266e5285f01 Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Sat, 3 Mar 2018 14:18:08 +0100 Subject: [PATCH 62/91] Building to gboo's docker repo --- .drone.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.drone.yml b/.drone.yml index bac57bfac5..b1b7b260e6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,75 +39,75 @@ pipeline: publish_server_alpine: image: plugins/docker - repo: drone/drone + repo: gboo/drone-server dockerfile: Dockerfile.alpine secrets: [ docker_username, docker_password ] tag: [ alpine ] when: - branch: master + branch: gbo event: push publish_server: image: plugins/docker - repo: drone/drone + repo: gboo/drone-server secrets: [ docker_username, docker_password ] tag: [ latest ] when: - branch: master + branch: gbo event: push publish_agent_alpine: image: plugins/docker - repo: drone/agent + repo: gboo/drone-agent dockerfile: Dockerfile.agent.alpine secrets: [ docker_username, docker_password ] tag: [ alpine ] when: - branch: master + branch: gbo event: push publish_agent_arm: image: plugins/docker - repo: drone/agent + repo: gboo/drone-agent dockerfile: Dockerfile.agent.linux.arm secrets: [ docker_username, docker_password ] tag: [ linux-arm ] when: - branch: master + branch: gbo event: push publish_agent_arm64: image: plugins/docker - repo: drone/agent + repo: gboo/drone-agent dockerfile: Dockerfile.agent.linux.arm64 secrets: [ docker_username, docker_password ] tag: [ linux-arm64 ] when: - branch: master + branch: gbo event: push publish_agent_amd64: image: plugins/docker - repo: drone/agent + repo: gboo/drone-agent dockerfile: Dockerfile.agent secrets: [ docker_username, docker_password ] tag: [ latest ] when: - branch: master + branch: gbo event: push release_server_alpine: image: plugins/docker - repo: drone/drone + repo: gboo/drone-server dockerfile: Dockerfile.alpine secrets: [ docker_username, docker_password ] - tag: [ 0.8-alpine ] + tag: ${DRONE_TAG} when: event: tag release_agent_alpine: image: plugins/docker - repo: drone/agent + repo: gboo/drone-agent dockerfile: Dockerfile.agent.alpine secrets: [ docker_username, docker_password ] tag: [ 0.8-alpine ] @@ -116,7 +116,7 @@ pipeline: release_server: image: plugins/docker - repo: drone/drone + repo: gboo/drone-server secrets: [ docker_username, docker_password ] tag: [ 0.8, 0.8.4 ] when: @@ -124,7 +124,7 @@ pipeline: release_agent: image: plugins/docker - repo: drone/agent + repo: gboo/drone-agent dockerfile: Dockerfile.agent secrets: [ docker_username, docker_password ] tag: [ 0.8, 0.8.4 ] From 3aae9dd0c585dc33f2abf09ddf3365610cd95f69 Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Sat, 3 Mar 2018 14:40:18 +0100 Subject: [PATCH 63/91] Added event and branch in fallback API --- server/hook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/hook.go b/server/hook.go index c6925f6929..dac9d71590 100644 --- a/server/hook.go +++ b/server/hook.go @@ -155,8 +155,8 @@ func PostHook(c *gin.Context) { // if failed, check if we have a fallback in the server config if len(os.Getenv("DRONE_SERVER_YAML_FALLBACK")) > 0 { // download it - resp, err := http.Get(fmt.Sprintf("%s?user=%s&repo=%s", - os.Getenv("DRONE_SERVER_YAML_FALLBACK"), user.Login, repo.FullName)) + resp, err := http.Get(fmt.Sprintf("%s?event=%s&repo=%s&branch=%s", + os.Getenv("DRONE_SERVER_YAML_FALLBACK"), build.Event, repo.FullName, build.Branch)) if err != nil { logrus.Errorf("failure to get build config for %s. %s", repo.FullName, err) c.AbortWithError(404, err) From 871feea9dfe187c9cc673bc473333f3eaf346a4d Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Sun, 4 Mar 2018 14:21:45 +0100 Subject: [PATCH 64/91] Added refspec in the YAML fallback --- server/hook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/hook.go b/server/hook.go index dac9d71590..7a3f371690 100644 --- a/server/hook.go +++ b/server/hook.go @@ -155,8 +155,8 @@ func PostHook(c *gin.Context) { // if failed, check if we have a fallback in the server config if len(os.Getenv("DRONE_SERVER_YAML_FALLBACK")) > 0 { // download it - resp, err := http.Get(fmt.Sprintf("%s?event=%s&repo=%s&branch=%s", - os.Getenv("DRONE_SERVER_YAML_FALLBACK"), build.Event, repo.FullName, build.Branch)) + resp, err := http.Get(fmt.Sprintf("%s?event=%s&repo=%s&branch=%s&refspec=%s", + os.Getenv("DRONE_SERVER_YAML_FALLBACK"), build.Event, repo.FullName, build.Branch, build.Refspec)) if err != nil { logrus.Errorf("failure to get build config for %s. %s", repo.FullName, err) c.AbortWithError(404, err) From a1d1d498529ee6cfa07c8e6359d9d6ea0a3ac59e Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 8 Mar 2018 12:46:39 -0800 Subject: [PATCH 65/91] add vault driver_opts support --- plugins/secrets/vault/vault.go | 27 ++++++++++++++++++++------- plugins/secrets/vault/vault_test.go | 17 +++++++++++++---- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/plugins/secrets/vault/vault.go b/plugins/secrets/vault/vault.go index dc6871167b..2ec8011588 100644 --- a/plugins/secrets/vault/vault.go +++ b/plugins/secrets/vault/vault.go @@ -27,9 +27,16 @@ import ( // type vaultConfig struct { Secrets map[string]struct { + Driver string + DriverOpts struct { + Path string + Key string + } `yaml:"driver_opts"` + + // deprecated. do not use. + Vault string Path string File string - Vault string } } @@ -78,7 +85,7 @@ func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, err return nil, err } for key, val := range out.Secrets { - var path string + var path, field string switch { case val.Path != "": path = val.Path @@ -86,6 +93,12 @@ func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, err path = val.File case val.Vault != "": path = val.Vault + case val.DriverOpts.Path != "": + path = val.DriverOpts.Path + field = val.DriverOpts.Key + } + if field == "" { + field = "value" } if path == "" { @@ -94,7 +107,7 @@ func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, err logrus.Debugf("vault: read secret: %s", path) - vaultSecret, err := v.get(path) + vaultSecret, err := v.get(path, field) if err != nil { logrus.Debugf("vault: read secret failed: %s: %s", path, err) return nil, err @@ -120,7 +133,7 @@ func (v *vault) list(repo *model.Repo, build *model.Build) ([]*model.Secret, err return secrets, nil } -func (v *vault) get(path string) (*vaultSecret, error) { +func (v *vault) get(path, key string) (*vaultSecret, error) { secret, err := v.client.Logical().Read(path) if err != nil { return nil, err @@ -128,7 +141,7 @@ func (v *vault) get(path string) (*vaultSecret, error) { if secret == nil || secret.Data == nil { return nil, nil } - return parseVaultSecret(secret.Data), nil + return parseVaultSecret(secret.Data, key), nil } // start starts the renewal loop. @@ -178,10 +191,10 @@ type vaultSecret struct { Repo []string } -func parseVaultSecret(data map[string]interface{}) *vaultSecret { +func parseVaultSecret(data map[string]interface{}, key string) *vaultSecret { secret := new(vaultSecret) - if vvalue, ok := data["value"]; ok { + if vvalue, ok := data[key]; ok { if svalue, ok := vvalue.(string); ok { secret.Value = svalue } diff --git a/plugins/secrets/vault/vault_test.go b/plugins/secrets/vault/vault_test.go index fd93853b38..cceb5a98f6 100644 --- a/plugins/secrets/vault/vault_test.go +++ b/plugins/secrets/vault/vault_test.go @@ -34,6 +34,7 @@ func TestVaultGet(t *testing.T) { _, err = client.Logical().Write("secret/testing/drone/a", map[string]interface{}{ "value": "hello", + "fr": "bonjour", "image": "golang", "event": "push,pull_request", "repo": "octocat/hello-world,github/*", @@ -44,17 +45,25 @@ func TestVaultGet(t *testing.T) { } plugin := vault{client: client} - secret, err := plugin.get("secret/testing/drone/a") + secret, err := plugin.get("secret/testing/drone/a", "value") if err != nil { t.Error(err) return } - if got, want := secret.Value, "hello"; got != want { t.Errorf("Expect secret value %s, got %s", want, got) } - secret, err = plugin.get("secret/testing/drone/404") + secret, err = plugin.get("secret/testing/drone/a", "fr") + if err != nil { + t.Error(err) + return + } + if got, want := secret.Value, "bonjour"; got != want { + t.Errorf("Expect secret value %s, got %s", want, got) + } + + secret, err = plugin.get("secret/testing/drone/404", "value") if err != nil { t.Errorf("Expect silent failure when secret does not exist, got %s", err) } @@ -76,7 +85,7 @@ func TestVaultSecretParse(t *testing.T) { Image: []string{"plugins/s3", "plugins/ec2"}, Repo: []string{"octocat/hello-world", "github/*"}, } - got := parseVaultSecret(data) + got := parseVaultSecret(data, "value") if !reflect.DeepEqual(want, *got) { t.Errorf("Failed read Secret.Data") pretty.Fdiff(os.Stderr, want, got) From 34e7c1648f93d92f90edd2172f217906f35a5010 Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Sat, 10 Mar 2018 20:09:14 +0100 Subject: [PATCH 66/91] Add context to gitea status Signed-off-by: Jonas Franz --- cmd/drone-server/server.go | 12 +++++++++--- cmd/drone-server/setup.go | 7 ++++--- remote/gitea/gitea.go | 11 +++++++---- remote/gitea/gitea_test.go | 8 +++++--- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 389d019ada..fe2032a1f0 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -310,6 +310,12 @@ var flags = []cli.Flag{ Usage: "gitea server address", Value: "https://try.gitea.io", }, + cli.StringFlag{ + EnvVar: "DRONE_GITEA_CONTEXT", + Name: "gitea-context", + Usage: "gitea status context", + Value: "continuous-integration/drone", + }, cli.StringFlag{ EnvVar: "DRONE_GITEA_GIT_USERNAME", Name: "gitea-git-username", diff --git a/cmd/drone-server/setup.go b/cmd/drone-server/setup.go index e1dff3ecd9..248b49a4dc 100644 --- a/cmd/drone-server/setup.go +++ b/cmd/drone-server/setup.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -115,6 +115,7 @@ func setupGogs(c *cli.Context) (remote.Remote, error) { func setupGitea(c *cli.Context) (remote.Remote, error) { return gitea.New(gitea.Opts{ URL: c.String("gitea-server"), + Context: c.String("gitea-context"), Username: c.String("gitea-git-username"), Password: c.String("gitea-git-password"), PrivateMode: c.Bool("gitea-private-mode"), diff --git a/remote/gitea/gitea.go b/remote/gitea/gitea.go index 929b907ec7..1773007f90 100644 --- a/remote/gitea/gitea.go +++ b/remote/gitea/gitea.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,6 +29,7 @@ import ( // Opts defines configuration options. type Opts struct { URL string // Gitea server url. + Context string // Context to display in status check Username string // Optional machine account username. Password string // Optional machine account password. PrivateMode bool // Gitea is running in private mode. @@ -37,6 +38,7 @@ type Opts struct { type client struct { URL string + Context string Machine string Username string Password string @@ -111,6 +113,7 @@ func New(opts Opts) (remote.Remote, error) { } return &client{ URL: opts.URL, + Context: opts.Context, Machine: url.Host, Username: opts.Username, Password: opts.Password, @@ -266,7 +269,7 @@ func (c *client) Status(u *model.User, r *model.Repo, b *model.Build, link strin State: status, TargetURL: link, Description: desc, - Context: "", + Context: c.Context, }, ) diff --git a/remote/gitea/gitea_test.go b/remote/gitea/gitea_test.go index 3af786478d..17f3610f1c 100644 --- a/remote/gitea/gitea_test.go +++ b/remote/gitea/gitea_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -44,12 +44,14 @@ func Test_gitea(t *testing.T) { g.It("Should return client with specified options", func() { remote, _ := New(Opts{ URL: "http://localhost:8080", + Context: "continuous-integration/test", Username: "someuser", Password: "password", SkipVerify: true, PrivateMode: true, }) g.Assert(remote.(*client).URL).Equal("http://localhost:8080") + g.Assert(remote.(*client).Context).Equal("continuous-integration/test") g.Assert(remote.(*client).Machine).Equal("localhost") g.Assert(remote.(*client).Username).Equal("someuser") g.Assert(remote.(*client).Password).Equal("password") From 6a32935011fc5dd63b1ff5883a754ac31863b774 Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Sat, 10 Mar 2018 20:09:14 +0100 Subject: [PATCH 67/91] Add context to gitea status Signed-off-by: Jonas Franz --- cmd/drone-server/server.go | 12 +++++++++--- cmd/drone-server/setup.go | 7 ++++--- remote/gitea/gitea.go | 11 +++++++---- remote/gitea/gitea_test.go | 8 +++++--- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 389d019ada..fe2032a1f0 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -310,6 +310,12 @@ var flags = []cli.Flag{ Usage: "gitea server address", Value: "https://try.gitea.io", }, + cli.StringFlag{ + EnvVar: "DRONE_GITEA_CONTEXT", + Name: "gitea-context", + Usage: "gitea status context", + Value: "continuous-integration/drone", + }, cli.StringFlag{ EnvVar: "DRONE_GITEA_GIT_USERNAME", Name: "gitea-git-username", diff --git a/cmd/drone-server/setup.go b/cmd/drone-server/setup.go index e1dff3ecd9..248b49a4dc 100644 --- a/cmd/drone-server/setup.go +++ b/cmd/drone-server/setup.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -115,6 +115,7 @@ func setupGogs(c *cli.Context) (remote.Remote, error) { func setupGitea(c *cli.Context) (remote.Remote, error) { return gitea.New(gitea.Opts{ URL: c.String("gitea-server"), + Context: c.String("gitea-context"), Username: c.String("gitea-git-username"), Password: c.String("gitea-git-password"), PrivateMode: c.Bool("gitea-private-mode"), diff --git a/remote/gitea/gitea.go b/remote/gitea/gitea.go index 929b907ec7..1773007f90 100644 --- a/remote/gitea/gitea.go +++ b/remote/gitea/gitea.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,6 +29,7 @@ import ( // Opts defines configuration options. type Opts struct { URL string // Gitea server url. + Context string // Context to display in status check Username string // Optional machine account username. Password string // Optional machine account password. PrivateMode bool // Gitea is running in private mode. @@ -37,6 +38,7 @@ type Opts struct { type client struct { URL string + Context string Machine string Username string Password string @@ -111,6 +113,7 @@ func New(opts Opts) (remote.Remote, error) { } return &client{ URL: opts.URL, + Context: opts.Context, Machine: url.Host, Username: opts.Username, Password: opts.Password, @@ -266,7 +269,7 @@ func (c *client) Status(u *model.User, r *model.Repo, b *model.Build, link strin State: status, TargetURL: link, Description: desc, - Context: "", + Context: c.Context, }, ) diff --git a/remote/gitea/gitea_test.go b/remote/gitea/gitea_test.go index 3af786478d..17f3610f1c 100644 --- a/remote/gitea/gitea_test.go +++ b/remote/gitea/gitea_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -44,12 +44,14 @@ func Test_gitea(t *testing.T) { g.It("Should return client with specified options", func() { remote, _ := New(Opts{ URL: "http://localhost:8080", + Context: "continuous-integration/test", Username: "someuser", Password: "password", SkipVerify: true, PrivateMode: true, }) g.Assert(remote.(*client).URL).Equal("http://localhost:8080") + g.Assert(remote.(*client).Context).Equal("continuous-integration/test") g.Assert(remote.(*client).Machine).Equal("localhost") g.Assert(remote.(*client).Username).Equal("someuser") g.Assert(remote.(*client).Password).Equal("password") From 7f49e696072f66ab110ef644196b2e3444fa1ac3 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Wed, 21 Mar 2018 14:02:17 +0100 Subject: [PATCH 68/91] Just fixed format with go fmt ./... --- cmd/drone-agent/agent.go | 8 ++++---- cmd/drone-agent/health.go | 6 +++--- cmd/drone-agent/health_test.go | 6 +++--- cmd/drone-agent/main.go | 6 +++--- cmd/drone-server/main.go | 6 +++--- cmd/drone-server/server.go | 6 +++--- cmd/drone-server/setup.go | 6 +++--- model/build.go | 6 +++--- model/build_test.go | 6 +++--- model/cc.go | 6 +++--- model/cc_test.go | 6 +++--- model/config.go | 6 +++--- model/const.go | 6 +++--- model/environ.go | 6 +++--- model/event.go | 6 +++--- model/feed.go | 6 +++--- model/file.go | 6 +++--- model/limit.go | 6 +++--- model/netrc.go | 6 +++--- model/perm.go | 6 +++--- model/proc.go | 6 +++--- model/queue.go | 6 +++--- model/registry.go | 6 +++--- model/repo.go | 8 ++++---- model/resource_limit.go | 6 +++--- model/secret.go | 6 +++--- model/secret_test.go | 6 +++--- model/sender.go | 6 +++--- model/settings.go | 6 +++--- model/team.go | 6 +++--- model/user.go | 6 +++--- model/user_test.go | 6 +++--- plugins/sender/plugin.go | 2 +- remote/bitbucket/bitbucket.go | 6 +++--- remote/bitbucket/bitbucket_test.go | 6 +++--- remote/bitbucket/convert.go | 6 +++--- remote/bitbucket/convert_test.go | 6 +++--- remote/bitbucket/fixtures/handler.go | 6 +++--- remote/bitbucket/fixtures/hooks.go | 6 +++--- remote/bitbucket/internal/client.go | 6 +++--- remote/bitbucket/internal/types.go | 6 +++--- remote/bitbucket/parse.go | 6 +++--- remote/bitbucket/parse_test.go | 6 +++--- remote/bitbucketserver/bitbucketserver.go | 6 +++--- remote/bitbucketserver/convert.go | 6 +++--- remote/bitbucketserver/convert_test.go | 6 +++--- remote/bitbucketserver/internal/client.go | 6 +++--- remote/bitbucketserver/internal/types.go | 6 +++--- remote/bitbucketserver/parse.go | 6 +++--- remote/coding/coding.go | 6 +++--- remote/coding/coding_test.go | 6 +++--- remote/coding/fixtures/handler.go | 6 +++--- remote/coding/fixtures/hooks.go | 6 +++--- remote/coding/hook.go | 6 +++--- remote/coding/hook_test.go | 6 +++--- remote/coding/internal/coding.go | 6 +++--- remote/coding/internal/error.go | 6 +++--- remote/coding/internal/file.go | 6 +++--- remote/coding/internal/project.go | 6 +++--- remote/coding/internal/user.go | 6 +++--- remote/coding/internal/webhook.go | 6 +++--- remote/coding/util.go | 6 +++--- remote/coding/util_test.go | 6 +++--- remote/context.go | 6 +++--- remote/errors.go | 6 +++--- remote/gerrit/gerrit.go | 6 +++--- remote/gitea/fixtures/handler.go | 6 +++--- remote/gitea/fixtures/hooks.go | 6 +++--- remote/gitea/gitea.go | 6 +++--- remote/gitea/gitea_test.go | 6 +++--- remote/gitea/helper.go | 6 +++--- remote/gitea/helper_test.go | 6 +++--- remote/gitea/parse.go | 6 +++--- remote/gitea/parse_test.go | 6 +++--- remote/gitea/types.go | 6 +++--- remote/github/convert.go | 6 +++--- remote/github/convert_test.go | 6 +++--- remote/github/fixtures/handler.go | 6 +++--- remote/github/fixtures/hooks.go | 6 +++--- remote/github/github.go | 6 +++--- remote/github/github_test.go | 6 +++--- remote/github/parse.go | 6 +++--- remote/github/parse_test.go | 6 +++--- remote/github/types.go | 6 +++--- remote/gitlab/client/drone.go | 6 +++--- remote/gitlab/client/gitlab.go | 6 +++--- remote/gitlab/client/groups.go | 6 +++--- remote/gitlab/client/hook.go | 6 +++--- remote/gitlab/client/project.go | 12 ++++++------ remote/gitlab/client/types.go | 6 +++--- remote/gitlab/client/user.go | 6 +++--- remote/gitlab/client/util.go | 6 +++--- remote/gitlab/gitlab.go | 6 +++--- remote/gitlab/gitlab_test.go | 6 +++--- remote/gitlab/helper.go | 6 +++--- remote/gitlab3/client/drone.go | 6 +++--- remote/gitlab3/client/gitlab.go | 6 +++--- remote/gitlab3/client/groups.go | 6 +++--- remote/gitlab3/client/hook.go | 6 +++--- remote/gitlab3/client/project.go | 6 +++--- remote/gitlab3/client/types.go | 6 +++--- remote/gitlab3/client/user.go | 6 +++--- remote/gitlab3/client/util.go | 6 +++--- remote/gitlab3/gitlab.go | 6 +++--- remote/gitlab3/gitlab_test.go | 6 +++--- remote/gitlab3/helper.go | 6 +++--- remote/gogs/fixtures/handler.go | 6 +++--- remote/gogs/fixtures/hooks.go | 6 +++--- remote/gogs/gogs.go | 6 +++--- remote/gogs/gogs_test.go | 6 +++--- remote/gogs/helper.go | 6 +++--- remote/gogs/helper_test.go | 6 +++--- remote/gogs/parse.go | 6 +++--- remote/gogs/parse_test.go | 6 +++--- remote/gogs/types.go | 6 +++--- remote/mock/remote.go | 6 +++--- remote/remote.go | 6 +++--- router/middleware/config.go | 6 +++--- router/middleware/header/header.go | 6 +++--- router/middleware/remote.go | 6 +++--- router/middleware/session/agent.go | 6 +++--- router/middleware/session/repo.go | 6 +++--- router/middleware/session/repo_test.go | 6 +++--- router/middleware/session/user.go | 6 +++--- router/middleware/store.go | 6 +++--- router/middleware/token/token.go | 6 +++--- router/middleware/version.go | 6 +++--- router/router.go | 6 +++--- server/badge.go | 6 +++--- server/build.go | 6 +++--- server/debug/debug.go | 6 +++--- server/file.go | 6 +++--- server/hook.go | 6 +++--- server/hook_test.go | 14 +++++++------- server/login.go | 6 +++--- server/metrics/prometheus.go | 6 +++--- server/registry.go | 6 +++--- server/repo.go | 6 +++--- server/rpc.go | 6 +++--- server/secret.go | 6 +++--- server/stream.go | 6 +++--- server/swagger/doc.go | 6 +++--- server/swagger/swagger.go | 6 +++--- server/sync.go | 6 +++--- server/user.go | 6 +++--- server/users.go | 6 +++--- server/web/opts.go | 6 +++--- server/web/opts_test.go | 6 +++--- server/web/template.go | 6 +++--- server/web/template_test.go | 6 +++--- server/web/web.go | 6 +++--- server/z.go | 6 +++--- shared/httputil/httputil.go | 6 +++--- shared/token/token.go | 6 +++--- store/context.go | 6 +++--- store/datastore/builds.go | 6 +++--- store/datastore/builds_test.go | 6 +++--- store/datastore/config.go | 6 +++--- store/datastore/config_test.go | 6 +++--- store/datastore/ddl/migrate.go | 6 +++--- store/datastore/ddl/mysql/ddl.go | 6 +++--- store/datastore/ddl/mysql/ddl_gen.go | 6 +++--- store/datastore/ddl/postgres/ddl.go | 6 +++--- store/datastore/ddl/postgres/ddl_gen.go | 6 +++--- store/datastore/ddl/sqlite/ddl.go | 6 +++--- store/datastore/ddl/sqlite/ddl_gen.go | 6 +++--- store/datastore/files.go | 6 +++--- store/datastore/files_test.go | 6 +++--- store/datastore/init.go | 6 +++--- store/datastore/init_cgo.go | 6 +++--- store/datastore/logs.go | 6 +++--- store/datastore/logs_test.go | 6 +++--- store/datastore/perms.go | 6 +++--- store/datastore/perms_test.go | 6 +++--- store/datastore/procs.go | 6 +++--- store/datastore/procs_test.go | 6 +++--- store/datastore/registry.go | 6 +++--- store/datastore/registry_test.go | 6 +++--- store/datastore/repos.go | 6 +++--- store/datastore/repos_test.go | 6 +++--- store/datastore/secret.go | 6 +++--- store/datastore/secret_test.go | 6 +++--- store/datastore/sender.go | 6 +++--- store/datastore/sender_test.go | 6 +++--- store/datastore/sql/lookup.go | 6 +++--- store/datastore/sql/mysql/sql.go | 6 +++--- store/datastore/sql/mysql/sql_gen.go | 6 +++--- store/datastore/sql/postgres/sql.go | 6 +++--- store/datastore/sql/postgres/sql_gen.go | 6 +++--- store/datastore/sql/sqlite/sql.go | 6 +++--- store/datastore/sql/sqlite/sql_gen.go | 6 +++--- store/datastore/store.go | 6 +++--- store/datastore/task.go | 6 +++--- store/datastore/task_test.go | 6 +++--- store/datastore/users.go | 6 +++--- store/datastore/users_test.go | 6 +++--- store/datastore/utils.go | 6 +++--- store/store.go | 6 +++--- version/version.go | 6 +++--- 199 files changed, 604 insertions(+), 604 deletions(-) diff --git a/cmd/drone-agent/agent.go b/cmd/drone-agent/agent.go index 254c8ffe57..fa71d75eda 100644 --- a/cmd/drone-agent/agent.go +++ b/cmd/drone-agent/agent.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -91,7 +91,7 @@ func loop(c *cli.Context) error { password: c.String("password"), }), grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: c.Duration("keepalive-time"), + Time: c.Duration("keepalive-time"), Timeout: c.Duration("keepalive-timeout"), }), ) diff --git a/cmd/drone-agent/health.go b/cmd/drone-agent/health.go index 6a3f77e638..1f41abac03 100644 --- a/cmd/drone-agent/health.go +++ b/cmd/drone-agent/health.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/cmd/drone-agent/health_test.go b/cmd/drone-agent/health_test.go index e15a8d8c6a..fbe23593f0 100644 --- a/cmd/drone-agent/health_test.go +++ b/cmd/drone-agent/health_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 1f6622b801..01f7459fa2 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/cmd/drone-server/main.go b/cmd/drone-server/main.go index 003818e3d1..3eda1ca165 100644 --- a/cmd/drone-server/main.go +++ b/cmd/drone-server/main.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 389d019ada..296ba29769 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/cmd/drone-server/setup.go b/cmd/drone-server/setup.go index e1dff3ecd9..90f28310e0 100644 --- a/cmd/drone-server/setup.go +++ b/cmd/drone-server/setup.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/build.go b/model/build.go index dbedcfb7f5..f1c7e00e26 100644 --- a/model/build.go +++ b/model/build.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/build_test.go b/model/build_test.go index 387c18a4b8..9220ac3d30 100644 --- a/model/build_test.go +++ b/model/build_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/cc.go b/model/cc.go index ad303ae344..f78b8076b0 100644 --- a/model/cc.go +++ b/model/cc.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/cc_test.go b/model/cc_test.go index 940e9e5ae8..b5081c23ed 100644 --- a/model/cc_test.go +++ b/model/cc_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/config.go b/model/config.go index 71e86d6fd8..8eae6e34c1 100644 --- a/model/config.go +++ b/model/config.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/const.go b/model/const.go index e202d2e8db..7b1bc465ee 100644 --- a/model/const.go +++ b/model/const.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/environ.go b/model/environ.go index 1875e52490..ee2d0d5f51 100644 --- a/model/environ.go +++ b/model/environ.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/event.go b/model/event.go index 60469629ee..a230a88009 100644 --- a/model/event.go +++ b/model/event.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/feed.go b/model/feed.go index 72764ae5ab..35d7b9baca 100644 --- a/model/feed.go +++ b/model/feed.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/file.go b/model/file.go index 9a86bbb31c..3bf52a5ee3 100644 --- a/model/file.go +++ b/model/file.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/limit.go b/model/limit.go index eb002c8ac0..2465700f4f 100644 --- a/model/limit.go +++ b/model/limit.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/netrc.go b/model/netrc.go index 6ed591164e..78661c852d 100644 --- a/model/netrc.go +++ b/model/netrc.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/perm.go b/model/perm.go index b6ffd34bf7..03ba293509 100644 --- a/model/perm.go +++ b/model/perm.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/proc.go b/model/proc.go index ac30076d04..c547725e62 100644 --- a/model/proc.go +++ b/model/proc.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/queue.go b/model/queue.go index a1552162aa..c5fdcdfdfe 100644 --- a/model/queue.go +++ b/model/queue.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/registry.go b/model/registry.go index d77a173781..f2ba1d0a8d 100644 --- a/model/registry.go +++ b/model/registry.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/repo.go b/model/repo.go index 87b8d250b9..40a523931e 100644 --- a/model/repo.go +++ b/model/repo.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,8 +15,8 @@ package model import ( - "strings" "fmt" + "strings" ) type RepoLite struct { diff --git a/model/resource_limit.go b/model/resource_limit.go index 104910e54f..ef18478706 100644 --- a/model/resource_limit.go +++ b/model/resource_limit.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/secret.go b/model/secret.go index 95237fc002..4135b23879 100644 --- a/model/secret.go +++ b/model/secret.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/secret_test.go b/model/secret_test.go index fc5a1407b8..364d3b8da1 100644 --- a/model/secret_test.go +++ b/model/secret_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/sender.go b/model/sender.go index 755409c491..e3bef4e5cb 100644 --- a/model/sender.go +++ b/model/sender.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/settings.go b/model/settings.go index 4017cd4ebd..1f73a89e55 100644 --- a/model/settings.go +++ b/model/settings.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/team.go b/model/team.go index 29abeb8831..b4c4d9afaa 100644 --- a/model/team.go +++ b/model/team.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/user.go b/model/user.go index 4faa9e9aa6..8936ceb154 100644 --- a/model/user.go +++ b/model/user.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/model/user_test.go b/model/user_test.go index ee96080b4f..fc7e9c39da 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/plugins/sender/plugin.go b/plugins/sender/plugin.go index 313f24ed71..a875989cb8 100644 --- a/plugins/sender/plugin.go +++ b/plugins/sender/plugin.go @@ -19,7 +19,7 @@ func NewRemote(endpoint string) model.SenderService { func (p *plugin) SenderAllowed(user *model.User, repo *model.Repo, build *model.Build, conf *model.Config) (bool, error) { path := fmt.Sprintf("%s/senders/%s/%s/%s/verify", p.endpoint, repo.Owner, repo.Name, build.Sender) data := map[string]interface{}{ - "build": build, + "build": build, "config": conf, } err := internal.Send("POST", path, &data, nil) diff --git a/remote/bitbucket/bitbucket.go b/remote/bitbucket/bitbucket.go index f7f5ef89e5..c76d3821c9 100644 --- a/remote/bitbucket/bitbucket.go +++ b/remote/bitbucket/bitbucket.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/bitbucket_test.go b/remote/bitbucket/bitbucket_test.go index d417798c61..c22d0e7946 100644 --- a/remote/bitbucket/bitbucket_test.go +++ b/remote/bitbucket/bitbucket_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/convert.go b/remote/bitbucket/convert.go index c5861b7ed1..985ae46323 100644 --- a/remote/bitbucket/convert.go +++ b/remote/bitbucket/convert.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/convert_test.go b/remote/bitbucket/convert_test.go index ffa526b873..cc0d590ad2 100644 --- a/remote/bitbucket/convert_test.go +++ b/remote/bitbucket/convert_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/fixtures/handler.go b/remote/bitbucket/fixtures/handler.go index 0440f8ad2e..ec855a6091 100644 --- a/remote/bitbucket/fixtures/handler.go +++ b/remote/bitbucket/fixtures/handler.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/fixtures/hooks.go b/remote/bitbucket/fixtures/hooks.go index 5afbb9e4a0..4d30623397 100644 --- a/remote/bitbucket/fixtures/hooks.go +++ b/remote/bitbucket/fixtures/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/internal/client.go b/remote/bitbucket/internal/client.go index b27633c5f3..9787255ad3 100644 --- a/remote/bitbucket/internal/client.go +++ b/remote/bitbucket/internal/client.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/internal/types.go b/remote/bitbucket/internal/types.go index b8c0bbf31a..18c5e0cacf 100644 --- a/remote/bitbucket/internal/types.go +++ b/remote/bitbucket/internal/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/parse.go b/remote/bitbucket/parse.go index 891dc20b10..dd0c3743ae 100644 --- a/remote/bitbucket/parse.go +++ b/remote/bitbucket/parse.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucket/parse_test.go b/remote/bitbucket/parse_test.go index 030cf1b125..6a2261908d 100644 --- a/remote/bitbucket/parse_test.go +++ b/remote/bitbucket/parse_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucketserver/bitbucketserver.go b/remote/bitbucketserver/bitbucketserver.go index 3f0d83b8db..057fa510b2 100644 --- a/remote/bitbucketserver/bitbucketserver.go +++ b/remote/bitbucketserver/bitbucketserver.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucketserver/convert.go b/remote/bitbucketserver/convert.go index 5d398341ff..4ea5d9ae0d 100644 --- a/remote/bitbucketserver/convert.go +++ b/remote/bitbucketserver/convert.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucketserver/convert_test.go b/remote/bitbucketserver/convert_test.go index dec64dd2a7..c364efdc86 100644 --- a/remote/bitbucketserver/convert_test.go +++ b/remote/bitbucketserver/convert_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucketserver/internal/client.go b/remote/bitbucketserver/internal/client.go index 1defa7ba0b..b569fcb181 100644 --- a/remote/bitbucketserver/internal/client.go +++ b/remote/bitbucketserver/internal/client.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucketserver/internal/types.go b/remote/bitbucketserver/internal/types.go index 3083cacec9..a1ff81b1c1 100644 --- a/remote/bitbucketserver/internal/types.go +++ b/remote/bitbucketserver/internal/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/bitbucketserver/parse.go b/remote/bitbucketserver/parse.go index a3e4047e17..0ec3e127ce 100644 --- a/remote/bitbucketserver/parse.go +++ b/remote/bitbucketserver/parse.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/coding.go b/remote/coding/coding.go index 622be8fe80..eb516a908a 100644 --- a/remote/coding/coding.go +++ b/remote/coding/coding.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/coding_test.go b/remote/coding/coding_test.go index aad4f039fa..6d3daa9710 100644 --- a/remote/coding/coding_test.go +++ b/remote/coding/coding_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/fixtures/handler.go b/remote/coding/fixtures/handler.go index 33f054d66d..a0e7ce8b8c 100644 --- a/remote/coding/fixtures/handler.go +++ b/remote/coding/fixtures/handler.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/fixtures/hooks.go b/remote/coding/fixtures/hooks.go index c77715bcca..6a7a63ff26 100644 --- a/remote/coding/fixtures/hooks.go +++ b/remote/coding/fixtures/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/hook.go b/remote/coding/hook.go index 9f304a0d9f..241e18babe 100644 --- a/remote/coding/hook.go +++ b/remote/coding/hook.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/hook_test.go b/remote/coding/hook_test.go index 2d3e9073b7..f6f77e495a 100644 --- a/remote/coding/hook_test.go +++ b/remote/coding/hook_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/internal/coding.go b/remote/coding/internal/coding.go index 420642a91a..430241f4a0 100644 --- a/remote/coding/internal/coding.go +++ b/remote/coding/internal/coding.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/internal/error.go b/remote/coding/internal/error.go index 18b76fb920..4de2d47be7 100644 --- a/remote/coding/internal/error.go +++ b/remote/coding/internal/error.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/internal/file.go b/remote/coding/internal/file.go index 616745af3d..664c4a035f 100644 --- a/remote/coding/internal/file.go +++ b/remote/coding/internal/file.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/internal/project.go b/remote/coding/internal/project.go index 7f6a95033e..6d7557795b 100644 --- a/remote/coding/internal/project.go +++ b/remote/coding/internal/project.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/internal/user.go b/remote/coding/internal/user.go index 0a874d1def..b6ca421545 100644 --- a/remote/coding/internal/user.go +++ b/remote/coding/internal/user.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/internal/webhook.go b/remote/coding/internal/webhook.go index b9d6c4bbe6..d172518983 100644 --- a/remote/coding/internal/webhook.go +++ b/remote/coding/internal/webhook.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/util.go b/remote/coding/util.go index 8bac9d02ed..abe8b4e3dd 100644 --- a/remote/coding/util.go +++ b/remote/coding/util.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/coding/util_test.go b/remote/coding/util_test.go index d2cf7af0c8..4cd98a607e 100644 --- a/remote/coding/util_test.go +++ b/remote/coding/util_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/context.go b/remote/context.go index 05258581da..5bfccc036e 100644 --- a/remote/context.go +++ b/remote/context.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/errors.go b/remote/errors.go index f32613d78b..d3df06ecdf 100644 --- a/remote/errors.go +++ b/remote/errors.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gerrit/gerrit.go b/remote/gerrit/gerrit.go index 93b3bd2184..93ade56624 100644 --- a/remote/gerrit/gerrit.go +++ b/remote/gerrit/gerrit.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/fixtures/handler.go b/remote/gitea/fixtures/handler.go index daabf814c2..70bf85f3a4 100644 --- a/remote/gitea/fixtures/handler.go +++ b/remote/gitea/fixtures/handler.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/fixtures/hooks.go b/remote/gitea/fixtures/hooks.go index 2cd5210496..0893403652 100644 --- a/remote/gitea/fixtures/hooks.go +++ b/remote/gitea/fixtures/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/gitea.go b/remote/gitea/gitea.go index 929b907ec7..1172f370cd 100644 --- a/remote/gitea/gitea.go +++ b/remote/gitea/gitea.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/gitea_test.go b/remote/gitea/gitea_test.go index 3af786478d..9c14b8bac6 100644 --- a/remote/gitea/gitea_test.go +++ b/remote/gitea/gitea_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/helper.go b/remote/gitea/helper.go index da094a54d7..0b0a918ac6 100644 --- a/remote/gitea/helper.go +++ b/remote/gitea/helper.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/helper_test.go b/remote/gitea/helper_test.go index ac51c8e1be..30c4272995 100644 --- a/remote/gitea/helper_test.go +++ b/remote/gitea/helper_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/parse.go b/remote/gitea/parse.go index d398447c94..2a29d2e859 100644 --- a/remote/gitea/parse.go +++ b/remote/gitea/parse.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/parse_test.go b/remote/gitea/parse_test.go index 2e4f4559f7..d38c3f6f59 100644 --- a/remote/gitea/parse_test.go +++ b/remote/gitea/parse_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitea/types.go b/remote/gitea/types.go index f3ccb334f8..0ae00804c2 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/convert.go b/remote/github/convert.go index 0d1d774eca..dedeb37858 100644 --- a/remote/github/convert.go +++ b/remote/github/convert.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/convert_test.go b/remote/github/convert_test.go index 3a92f844df..f0076c28ae 100644 --- a/remote/github/convert_test.go +++ b/remote/github/convert_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/fixtures/handler.go b/remote/github/fixtures/handler.go index 29181689f4..d3e0c314d8 100644 --- a/remote/github/fixtures/handler.go +++ b/remote/github/fixtures/handler.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/fixtures/hooks.go b/remote/github/fixtures/hooks.go index 6a07ac3f6f..8bb36e6ee8 100644 --- a/remote/github/fixtures/hooks.go +++ b/remote/github/fixtures/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/github.go b/remote/github/github.go index d77622bd8b..aed0bfd8a4 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/github_test.go b/remote/github/github_test.go index 46243a6c95..1b41f1366d 100644 --- a/remote/github/github_test.go +++ b/remote/github/github_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/parse.go b/remote/github/parse.go index 6d24bfff06..dac4b3489d 100644 --- a/remote/github/parse.go +++ b/remote/github/parse.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/parse_test.go b/remote/github/parse_test.go index fab286ab53..2619782b53 100644 --- a/remote/github/parse_test.go +++ b/remote/github/parse_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/github/types.go b/remote/github/types.go index d03e5e74f7..c7882ada13 100644 --- a/remote/github/types.go +++ b/remote/github/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/drone.go b/remote/gitlab/client/drone.go index e5a36dcebe..4d6ca1e550 100644 --- a/remote/gitlab/client/drone.go +++ b/remote/gitlab/client/drone.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/gitlab.go b/remote/gitlab/client/gitlab.go index 254d8d2db7..d5f47b2e03 100644 --- a/remote/gitlab/client/gitlab.go +++ b/remote/gitlab/client/gitlab.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/groups.go b/remote/gitlab/client/groups.go index 745cdea55f..651419937b 100644 --- a/remote/gitlab/client/groups.go +++ b/remote/gitlab/client/groups.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/hook.go b/remote/gitlab/client/hook.go index d733178e5a..5ffeeb9e7b 100644 --- a/remote/gitlab/client/hook.go +++ b/remote/gitlab/client/hook.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/project.go b/remote/gitlab/client/project.go index 251dfd165a..3ee761ef60 100644 --- a/remote/gitlab/client/project.go +++ b/remote/gitlab/client/project.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,8 +58,8 @@ func (g *Client) AllProjects(hide_archives bool) ([]*Project, error) { // Get a list of projects owned by the authenticated user. func (c *Client) Projects(page int, per_page int, hide_archives bool) ([]*Project, error) { projectsOptions := QMap{ - "page": strconv.Itoa(page), - "per_page": strconv.Itoa(per_page), + "page": strconv.Itoa(page), + "per_page": strconv.Itoa(per_page), "membership": "true", } @@ -145,7 +145,7 @@ func (c *Client) SetStatus(id, sha, state, desc, ref, link string) error { func (c *Client) SearchProjectId(namespace string, name string) (id int, err error) { url, opaque := c.ResourceUrl(projectsUrl, nil, QMap{ - "query": strings.ToLower(name), + "query": strings.ToLower(name), "membership": "true", }) diff --git a/remote/gitlab/client/types.go b/remote/gitlab/client/types.go index b752770886..eb158869d9 100644 --- a/remote/gitlab/client/types.go +++ b/remote/gitlab/client/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/user.go b/remote/gitlab/client/user.go index 88a12ae650..d14cef2b3a 100644 --- a/remote/gitlab/client/user.go +++ b/remote/gitlab/client/user.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/client/util.go b/remote/gitlab/client/util.go index 84c580d55c..c446d230e2 100644 --- a/remote/gitlab/client/util.go +++ b/remote/gitlab/client/util.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/gitlab.go b/remote/gitlab/gitlab.go index 884c125a2f..455b2b87de 100644 --- a/remote/gitlab/gitlab.go +++ b/remote/gitlab/gitlab.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/gitlab_test.go b/remote/gitlab/gitlab_test.go index 78974d1d2b..4e168a9617 100644 --- a/remote/gitlab/gitlab_test.go +++ b/remote/gitlab/gitlab_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab/helper.go b/remote/gitlab/helper.go index 7f80c0b431..e2a740c73d 100644 --- a/remote/gitlab/helper.go +++ b/remote/gitlab/helper.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/drone.go b/remote/gitlab3/client/drone.go index e5a36dcebe..4d6ca1e550 100644 --- a/remote/gitlab3/client/drone.go +++ b/remote/gitlab3/client/drone.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/gitlab.go b/remote/gitlab3/client/gitlab.go index 254d8d2db7..d5f47b2e03 100644 --- a/remote/gitlab3/client/gitlab.go +++ b/remote/gitlab3/client/gitlab.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/groups.go b/remote/gitlab3/client/groups.go index 745cdea55f..651419937b 100644 --- a/remote/gitlab3/client/groups.go +++ b/remote/gitlab3/client/groups.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/hook.go b/remote/gitlab3/client/hook.go index d733178e5a..5ffeeb9e7b 100644 --- a/remote/gitlab3/client/hook.go +++ b/remote/gitlab3/client/hook.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/project.go b/remote/gitlab3/client/project.go index 455e2138bc..32f559f16f 100644 --- a/remote/gitlab3/client/project.go +++ b/remote/gitlab3/client/project.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/types.go b/remote/gitlab3/client/types.go index 5371f2af82..bf6ff1356f 100644 --- a/remote/gitlab3/client/types.go +++ b/remote/gitlab3/client/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/user.go b/remote/gitlab3/client/user.go index 88a12ae650..d14cef2b3a 100644 --- a/remote/gitlab3/client/user.go +++ b/remote/gitlab3/client/user.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/client/util.go b/remote/gitlab3/client/util.go index 84c580d55c..c446d230e2 100644 --- a/remote/gitlab3/client/util.go +++ b/remote/gitlab3/client/util.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/gitlab.go b/remote/gitlab3/gitlab.go index eb402de17c..1515d7d4c1 100644 --- a/remote/gitlab3/gitlab.go +++ b/remote/gitlab3/gitlab.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/gitlab_test.go b/remote/gitlab3/gitlab_test.go index e8bd7bc858..bc98ae73bb 100644 --- a/remote/gitlab3/gitlab_test.go +++ b/remote/gitlab3/gitlab_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gitlab3/helper.go b/remote/gitlab3/helper.go index 470e19b8b6..ad6d7f3c41 100644 --- a/remote/gitlab3/helper.go +++ b/remote/gitlab3/helper.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/fixtures/handler.go b/remote/gogs/fixtures/handler.go index fa4f74a7af..4726c9c640 100644 --- a/remote/gogs/fixtures/handler.go +++ b/remote/gogs/fixtures/handler.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/fixtures/hooks.go b/remote/gogs/fixtures/hooks.go index 8aa2e22858..cf2a542122 100644 --- a/remote/gogs/fixtures/hooks.go +++ b/remote/gogs/fixtures/hooks.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/gogs.go b/remote/gogs/gogs.go index 74a0f7bd48..cc57e2a447 100644 --- a/remote/gogs/gogs.go +++ b/remote/gogs/gogs.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/gogs_test.go b/remote/gogs/gogs_test.go index 62d3698c2d..468cae520c 100644 --- a/remote/gogs/gogs_test.go +++ b/remote/gogs/gogs_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/helper.go b/remote/gogs/helper.go index 680ba5f16b..0d2db2f816 100644 --- a/remote/gogs/helper.go +++ b/remote/gogs/helper.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/helper_test.go b/remote/gogs/helper_test.go index 8ca9149886..758bd1226c 100644 --- a/remote/gogs/helper_test.go +++ b/remote/gogs/helper_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/parse.go b/remote/gogs/parse.go index 3698e20417..f0e1f47e00 100644 --- a/remote/gogs/parse.go +++ b/remote/gogs/parse.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/parse_test.go b/remote/gogs/parse_test.go index a2f4591129..29ad74267a 100644 --- a/remote/gogs/parse_test.go +++ b/remote/gogs/parse_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/gogs/types.go b/remote/gogs/types.go index 532247cac9..613a6a671f 100644 --- a/remote/gogs/types.go +++ b/remote/gogs/types.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/mock/remote.go b/remote/mock/remote.go index d273535224..2b8cf32f0a 100644 --- a/remote/mock/remote.go +++ b/remote/mock/remote.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/remote/remote.go b/remote/remote.go index 99f28c67aa..880e840628 100644 --- a/remote/remote.go +++ b/remote/remote.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/config.go b/router/middleware/config.go index e42e06226f..87c857246a 100644 --- a/router/middleware/config.go +++ b/router/middleware/config.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/header/header.go b/router/middleware/header/header.go index 333a6b8222..c3a6ba0bc1 100644 --- a/router/middleware/header/header.go +++ b/router/middleware/header/header.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/remote.go b/router/middleware/remote.go index 17bdb90a3c..401303302e 100644 --- a/router/middleware/remote.go +++ b/router/middleware/remote.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/session/agent.go b/router/middleware/session/agent.go index dae56d4a96..7c49fa7260 100644 --- a/router/middleware/session/agent.go +++ b/router/middleware/session/agent.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/session/repo.go b/router/middleware/session/repo.go index fddb69b0ad..526735bafe 100644 --- a/router/middleware/session/repo.go +++ b/router/middleware/session/repo.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/session/repo_test.go b/router/middleware/session/repo_test.go index de2bbdccbd..6e2899a346 100644 --- a/router/middleware/session/repo_test.go +++ b/router/middleware/session/repo_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/session/user.go b/router/middleware/session/user.go index 64f0bf3c2f..81da03d8ea 100644 --- a/router/middleware/session/user.go +++ b/router/middleware/session/user.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/store.go b/router/middleware/store.go index c0a02c4b09..f3bd305286 100644 --- a/router/middleware/store.go +++ b/router/middleware/store.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/token/token.go b/router/middleware/token/token.go index d5ca0f20f4..8ba2926960 100644 --- a/router/middleware/token/token.go +++ b/router/middleware/token/token.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/middleware/version.go b/router/middleware/version.go index fbed00c700..fc2a7f552e 100644 --- a/router/middleware/version.go +++ b/router/middleware/version.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/router/router.go b/router/router.go index c86dc13baa..b3677aa1b5 100644 --- a/router/router.go +++ b/router/router.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/badge.go b/server/badge.go index aa1263cff6..b8c5162f87 100644 --- a/server/badge.go +++ b/server/badge.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/build.go b/server/build.go index 838d46f128..cae90e6407 100644 --- a/server/build.go +++ b/server/build.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/debug/debug.go b/server/debug/debug.go index 17458b43e7..09c8e41a94 100644 --- a/server/debug/debug.go +++ b/server/debug/debug.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/file.go b/server/file.go index 0b2f479131..1027391ce3 100644 --- a/server/file.go +++ b/server/file.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/hook.go b/server/hook.go index e47fd89d3d..7035355a72 100644 --- a/server/hook.go +++ b/server/hook.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/hook_test.go b/server/hook_test.go index 546bafabeb..5aedd8c8c0 100644 --- a/server/hook_test.go +++ b/server/hook_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,11 +27,11 @@ func TestMultilineEnvsubst(t *testing.T) { Message: `aaa bbb`, }, - Last: &model.Build{}, + Last: &model.Build{}, Netrc: &model.Netrc{}, - Secs: []*model.Secret{}, - Regs: []*model.Registry{}, - Link: "", + Secs: []*model.Secret{}, + Regs: []*model.Registry{}, + Link: "", Yaml: `pipeline: xxx: image: scratch diff --git a/server/login.go b/server/login.go index 3f78bf1615..558f153245 100644 --- a/server/login.go +++ b/server/login.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/metrics/prometheus.go b/server/metrics/prometheus.go index fa28c2fbc3..3d0bd6a60a 100644 --- a/server/metrics/prometheus.go +++ b/server/metrics/prometheus.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/registry.go b/server/registry.go index d9ee7e21de..879edae6d3 100644 --- a/server/registry.go +++ b/server/registry.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/repo.go b/server/repo.go index f77e52b463..bb57f70bc5 100644 --- a/server/repo.go +++ b/server/repo.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/rpc.go b/server/rpc.go index aceadca9a5..7c064544ef 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/secret.go b/server/secret.go index 8c5b20930c..deb04c786d 100644 --- a/server/secret.go +++ b/server/secret.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/stream.go b/server/stream.go index 290c5ef51c..2e202989f4 100644 --- a/server/stream.go +++ b/server/stream.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/swagger/doc.go b/server/swagger/doc.go index 5778d5b987..56d093fd2d 100644 --- a/server/swagger/doc.go +++ b/server/swagger/doc.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/swagger/swagger.go b/server/swagger/swagger.go index d205abbe4b..e23ba78b2c 100644 --- a/server/swagger/swagger.go +++ b/server/swagger/swagger.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/sync.go b/server/sync.go index 8e0ac1033a..6e9091ac32 100644 --- a/server/sync.go +++ b/server/sync.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/user.go b/server/user.go index c6eaaf80b5..41f4d59138 100644 --- a/server/user.go +++ b/server/user.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/users.go b/server/users.go index 08a46f1d20..49d78683c8 100644 --- a/server/users.go +++ b/server/users.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/web/opts.go b/server/web/opts.go index 5d77fd2113..32ba6d5939 100644 --- a/server/web/opts.go +++ b/server/web/opts.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/web/opts_test.go b/server/web/opts_test.go index d26ee04711..a217f2f024 100644 --- a/server/web/opts_test.go +++ b/server/web/opts_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/web/template.go b/server/web/template.go index 4f3bd80aaa..509f20c367 100644 --- a/server/web/template.go +++ b/server/web/template.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/web/template_test.go b/server/web/template_test.go index a1286d42e1..6ad8a28509 100644 --- a/server/web/template_test.go +++ b/server/web/template_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/web/web.go b/server/web/web.go index 6a16f44777..2a46358088 100644 --- a/server/web/web.go +++ b/server/web/web.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/server/z.go b/server/z.go index e606b9f9e7..fcc036f5a9 100644 --- a/server/z.go +++ b/server/z.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/shared/httputil/httputil.go b/shared/httputil/httputil.go index 3c976155f1..011e233053 100644 --- a/shared/httputil/httputil.go +++ b/shared/httputil/httputil.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/shared/token/token.go b/shared/token/token.go index 492943dd9d..0753a18464 100644 --- a/shared/token/token.go +++ b/shared/token/token.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/context.go b/store/context.go index bceed28aa1..135c9c8404 100644 --- a/store/context.go +++ b/store/context.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/builds.go b/store/datastore/builds.go index 74c83bac10..9033e7ee10 100644 --- a/store/datastore/builds.go +++ b/store/datastore/builds.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/builds_test.go b/store/datastore/builds_test.go index dcc9bb2d01..ee5305a788 100644 --- a/store/datastore/builds_test.go +++ b/store/datastore/builds_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/config.go b/store/datastore/config.go index f5eae4dedc..af976ebb5b 100644 --- a/store/datastore/config.go +++ b/store/datastore/config.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/config_test.go b/store/datastore/config_test.go index e4784d3fd0..b98461c650 100644 --- a/store/datastore/config_test.go +++ b/store/datastore/config_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/migrate.go b/store/datastore/ddl/migrate.go index 568848e1be..16283c6645 100644 --- a/store/datastore/ddl/migrate.go +++ b/store/datastore/ddl/migrate.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/mysql/ddl.go b/store/datastore/ddl/mysql/ddl.go index 6305f4ceae..ac3c094912 100644 --- a/store/datastore/ddl/mysql/ddl.go +++ b/store/datastore/ddl/mysql/ddl.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/mysql/ddl_gen.go b/store/datastore/ddl/mysql/ddl_gen.go index 11627f09c6..b12efe1263 100644 --- a/store/datastore/ddl/mysql/ddl_gen.go +++ b/store/datastore/ddl/mysql/ddl_gen.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/postgres/ddl.go b/store/datastore/ddl/postgres/ddl.go index fbe05329a0..6d50b23362 100644 --- a/store/datastore/ddl/postgres/ddl.go +++ b/store/datastore/ddl/postgres/ddl.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/postgres/ddl_gen.go b/store/datastore/ddl/postgres/ddl_gen.go index b4ff8337ef..3915069faf 100644 --- a/store/datastore/ddl/postgres/ddl_gen.go +++ b/store/datastore/ddl/postgres/ddl_gen.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/sqlite/ddl.go b/store/datastore/ddl/sqlite/ddl.go index 2b730c9c2f..7cddb02eb4 100644 --- a/store/datastore/ddl/sqlite/ddl.go +++ b/store/datastore/ddl/sqlite/ddl.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/ddl/sqlite/ddl_gen.go b/store/datastore/ddl/sqlite/ddl_gen.go index cb3e69645d..3318a93584 100644 --- a/store/datastore/ddl/sqlite/ddl_gen.go +++ b/store/datastore/ddl/sqlite/ddl_gen.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/files.go b/store/datastore/files.go index e32d070a39..7657625518 100644 --- a/store/datastore/files.go +++ b/store/datastore/files.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/files_test.go b/store/datastore/files_test.go index 441f297902..f51230c740 100644 --- a/store/datastore/files_test.go +++ b/store/datastore/files_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/init.go b/store/datastore/init.go index f2dd486cd5..12febc36ff 100644 --- a/store/datastore/init.go +++ b/store/datastore/init.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/init_cgo.go b/store/datastore/init_cgo.go index 6c9e0ede17..8a4e208399 100644 --- a/store/datastore/init_cgo.go +++ b/store/datastore/init_cgo.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/logs.go b/store/datastore/logs.go index 2604d179d5..6d1460c9ae 100644 --- a/store/datastore/logs.go +++ b/store/datastore/logs.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/logs_test.go b/store/datastore/logs_test.go index 7abb48f800..2d227b0d26 100644 --- a/store/datastore/logs_test.go +++ b/store/datastore/logs_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/perms.go b/store/datastore/perms.go index 1871d426f9..4ad7e49b77 100644 --- a/store/datastore/perms.go +++ b/store/datastore/perms.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/perms_test.go b/store/datastore/perms_test.go index 1ab82431e5..030bdd926e 100644 --- a/store/datastore/perms_test.go +++ b/store/datastore/perms_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/procs.go b/store/datastore/procs.go index 51502652ba..d503e1de9a 100644 --- a/store/datastore/procs.go +++ b/store/datastore/procs.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/procs_test.go b/store/datastore/procs_test.go index b5d429c1b4..c02dfd295f 100644 --- a/store/datastore/procs_test.go +++ b/store/datastore/procs_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/registry.go b/store/datastore/registry.go index f2b13dd3d0..fc1d9d19e0 100644 --- a/store/datastore/registry.go +++ b/store/datastore/registry.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/registry_test.go b/store/datastore/registry_test.go index ea8a49aacd..66223599e0 100644 --- a/store/datastore/registry_test.go +++ b/store/datastore/registry_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/repos.go b/store/datastore/repos.go index 10e74e1578..e993c1742b 100644 --- a/store/datastore/repos.go +++ b/store/datastore/repos.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/repos_test.go b/store/datastore/repos_test.go index b4c209f4b2..f180543bf7 100644 --- a/store/datastore/repos_test.go +++ b/store/datastore/repos_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/secret.go b/store/datastore/secret.go index c05dbf2746..b967974e74 100644 --- a/store/datastore/secret.go +++ b/store/datastore/secret.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/secret_test.go b/store/datastore/secret_test.go index 54ed058c83..8b0b8cae8d 100644 --- a/store/datastore/secret_test.go +++ b/store/datastore/secret_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sender.go b/store/datastore/sender.go index 0dd2099f97..326cbd4d52 100644 --- a/store/datastore/sender.go +++ b/store/datastore/sender.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sender_test.go b/store/datastore/sender_test.go index 5c73230979..433797f65a 100644 --- a/store/datastore/sender_test.go +++ b/store/datastore/sender_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/lookup.go b/store/datastore/sql/lookup.go index f9c6eec7df..e0e3d46aa2 100644 --- a/store/datastore/sql/lookup.go +++ b/store/datastore/sql/lookup.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/mysql/sql.go b/store/datastore/sql/mysql/sql.go index cc49a56d3e..64fba52d48 100644 --- a/store/datastore/sql/mysql/sql.go +++ b/store/datastore/sql/mysql/sql.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/mysql/sql_gen.go b/store/datastore/sql/mysql/sql_gen.go index b9b2051447..a93ea22cb2 100644 --- a/store/datastore/sql/mysql/sql_gen.go +++ b/store/datastore/sql/mysql/sql_gen.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/postgres/sql.go b/store/datastore/sql/postgres/sql.go index 6623eefa5b..dafdfc0402 100644 --- a/store/datastore/sql/postgres/sql.go +++ b/store/datastore/sql/postgres/sql.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/postgres/sql_gen.go b/store/datastore/sql/postgres/sql_gen.go index 8bf1581901..82475ce591 100644 --- a/store/datastore/sql/postgres/sql_gen.go +++ b/store/datastore/sql/postgres/sql_gen.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/sqlite/sql.go b/store/datastore/sql/sqlite/sql.go index c1147069e3..d1481e699d 100644 --- a/store/datastore/sql/sqlite/sql.go +++ b/store/datastore/sql/sqlite/sql.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/sql/sqlite/sql_gen.go b/store/datastore/sql/sqlite/sql_gen.go index 11b5e897fb..a464217882 100644 --- a/store/datastore/sql/sqlite/sql_gen.go +++ b/store/datastore/sql/sqlite/sql_gen.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/store.go b/store/datastore/store.go index 4cdc69f6a0..e3e1401a4d 100644 --- a/store/datastore/store.go +++ b/store/datastore/store.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/task.go b/store/datastore/task.go index 969395257d..e095dc29a3 100644 --- a/store/datastore/task.go +++ b/store/datastore/task.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/task_test.go b/store/datastore/task_test.go index da8083d861..118436a5ca 100644 --- a/store/datastore/task_test.go +++ b/store/datastore/task_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/users.go b/store/datastore/users.go index fef11983b2..e37baaee53 100644 --- a/store/datastore/users.go +++ b/store/datastore/users.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/users_test.go b/store/datastore/users_test.go index 14094f898a..5fd580e6c6 100644 --- a/store/datastore/users_test.go +++ b/store/datastore/users_test.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/datastore/utils.go b/store/datastore/utils.go index 56a843bfb3..979501cef2 100644 --- a/store/datastore/utils.go +++ b/store/datastore/utils.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/store/store.go b/store/store.go index 2b2393b041..b93331a694 100644 --- a/store/store.go +++ b/store/store.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/version/version.go b/version/version.go index f5219e3dc0..bda02bf562 100644 --- a/version/version.go +++ b/version/version.go @@ -1,11 +1,11 @@ // Copyright 2018 Drone.IO Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. From 06ff6b50edecfa3373030a3e8999c26f57dcddd4 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Wed, 21 Mar 2018 13:51:54 +0100 Subject: [PATCH 69/91] Use specific token for prometheus metrics --- cmd/drone-server/server.go | 9 +++++++++ router/router.go | 5 +---- server/metrics/prometheus.go | 35 +++++++++++++++++++++++++++++++++-- server/rpc.go | 3 +++ 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 296ba29769..597f81478b 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -169,6 +169,12 @@ var flags = []cli.Flag{ Usage: "database driver configuration string", Value: "drone.sqlite", }, + cli.StringFlag{ + EnvVar: "DRONE_PROMETHEUS_AUTH_TOKEN", + Name: "prometheus-auth-token", + Usage: "token to secure prometheus metrics endpoint", + Value: "", + }, // // resource limit parameters // @@ -685,6 +691,9 @@ func setupEvilGlobals(c *cli.Context, v store.Store, r remote.Remote) { // droneserver.Config.Server.Open = cli.Bool("open") // droneserver.Config.Server.Orgs = sliceToMap(cli.StringSlice("orgs")) // droneserver.Config.Server.Admins = sliceToMap(cli.StringSlice("admin")) + + // prometheus + droneserver.Config.Prometheus.AuthToken = c.String("prometheus-auth-token") } type authorizer struct { diff --git a/router/router.go b/router/router.go index b3677aa1b5..b0619c0800 100644 --- a/router/router.go +++ b/router/router.go @@ -178,10 +178,7 @@ func Load(mux *httptreemux.ContextMux, middleware ...gin.HandlerFunc) http.Handl monitor := e.Group("/metrics") { - monitor.GET("", - session.MustAdmin(), - metrics.PromHandler(), - ) + monitor.GET("", metrics.PromHandler()) } e.GET("/version", server.Version) diff --git a/server/metrics/prometheus.go b/server/metrics/prometheus.go index 3d0bd6a60a..d7e7c9ab90 100644 --- a/server/metrics/prometheus.go +++ b/server/metrics/prometheus.go @@ -15,14 +15,45 @@ package metrics import ( - "github.com/gin-gonic/gin" + "errors" + "fmt" + "github.com/drone/drone/server" + "github.com/gin-gonic/gin" "github.com/prometheus/client_golang/prometheus/promhttp" ) +var ( + // errInvalidToken is returned when the api request token is invalid. + errInvalidToken = errors.New("Invalid or missing token") +) + // PromHandler will pass the call from /api/metrics/prometheus to prometheus func PromHandler() gin.HandlerFunc { + handler := promhttp.Handler() + return func(c *gin.Context) { - promhttp.Handler().ServeHTTP(c.Writer, c.Request) + token := server.Config.Prometheus.Token + + if token == "" { + handler.ServeHTTP(c.Writer, c.Request) + return + } + + header := c.Request.Header.Get("Authorization") + + if header == "" { + c.String(401, errInvalidToken.Error()) + return + } + + bearer := fmt.Sprintf("Bearer %s", token) + + if header != bearer { + c.String(401, errInvalidToken.Error()) + return + } + + handler.ServeHTTP(c.Writer, c.Request) } } diff --git a/server/rpc.go b/server/rpc.go index 7c064544ef..0bdec222b9 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -80,6 +80,9 @@ var Config = struct { // Orgs map[string]struct{} // Admins map[string]struct{} } + Prometheus struct { + AuthToken string + } Pipeline struct { Limits model.ResourceLimit Volumes []string From 398ca972bc2baa8618874d0d2e9f615b24520148 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 27 Mar 2018 22:50:55 +0200 Subject: [PATCH 70/91] Fixed wrong variable name --- server/metrics/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/metrics/prometheus.go b/server/metrics/prometheus.go index d7e7c9ab90..b91b5e2a7b 100644 --- a/server/metrics/prometheus.go +++ b/server/metrics/prometheus.go @@ -33,7 +33,7 @@ func PromHandler() gin.HandlerFunc { handler := promhttp.Handler() return func(c *gin.Context) { - token := server.Config.Prometheus.Token + token := server.Config.Prometheus.AuthToken if token == "" { handler.ServeHTTP(c.Writer, c.Request) From 00f72ef20668d9d048edc32dcd54c96006038a54 Mon Sep 17 00:00:00 2001 From: Fernando Barbosa Date: Tue, 27 Mar 2018 19:19:22 -0300 Subject: [PATCH 71/91] Fix EventStreamSSE Memory Leak The `Config.Services.Pubsub.Subscribe` is being initialized with the global Gin Context. This causes the publisher object to [hang at line 58](https://github.com/cncd/pubsub/blob/master/pub.go#L58) and the goroutine remains opened indefinetly, which can be a source of memory leak. Setting it to the locally defined ctx object correctly causes the goroutine to close when the function exits due to the deferred close. See https://discourse.drone.io/t/memory-leak-on-drone-server/1884 for further information. --- server/stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/stream.go b/server/stream.go index 2e202989f4..6dd19a9bad 100644 --- a/server/stream.go +++ b/server/stream.go @@ -78,7 +78,7 @@ func EventStreamSSE(c *gin.Context) { go func() { // TODO remove this from global config - Config.Services.Pubsub.Subscribe(c, "topic/events", func(m pubsub.Message) { + Config.Services.Pubsub.Subscribe(ctx, "topic/events", func(m pubsub.Message) { name := m.Labels["repo"] priv := m.Labels["private"] if repo[name] || priv == "false" { From 81103a98208b0bfc76be5b07194f359fbc80183b Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 29 Mar 2018 10:40:54 -0700 Subject: [PATCH 72/91] bump target version number to 0.8.5 --- .drone.yml | 4 ++-- version/version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index bac57bfac5..d372a27e67 100644 --- a/.drone.yml +++ b/.drone.yml @@ -118,7 +118,7 @@ pipeline: image: plugins/docker repo: drone/drone secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.4 ] + tag: [ 0.8, 0.8.5 ] when: event: tag @@ -127,7 +127,7 @@ pipeline: repo: drone/agent dockerfile: Dockerfile.agent secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.4 ] + tag: [ 0.8, 0.8.5 ] when: event: tag diff --git a/version/version.go b/version/version.go index bda02bf562..4be904ee12 100644 --- a/version/version.go +++ b/version/version.go @@ -22,7 +22,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner. VersionMinor int64 = 8 // VersionPatch is for backwards-compatible bug fixes. - VersionPatch int64 = 4 + VersionPatch int64 = 5 // VersionPre indicates prerelease. VersionPre string // VersionDev indicates development branch. Releases will be empty string. From d3898a755e83b0863e53d3ce2390872ba718314b Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 1 Apr 2018 11:34:01 -0700 Subject: [PATCH 73/91] update vendored pipeline runner --- .../cncd/pipeline/pipeline/backend/backend.go | 17 +++--- .../pipeline/backend/docker/docker.go | 18 +++--- .../cncd/pipeline/pipeline/pipeline.go | 10 ++-- vendor/vendor.json | 58 +++++++++---------- 4 files changed, 52 insertions(+), 51 deletions(-) diff --git a/vendor/github.com/cncd/pipeline/pipeline/backend/backend.go b/vendor/github.com/cncd/pipeline/pipeline/backend/backend.go index ef8331097d..6d4b7eeffe 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/backend/backend.go +++ b/vendor/github.com/cncd/pipeline/pipeline/backend/backend.go @@ -1,21 +1,24 @@ package backend -import "io" +import ( + "context" + "io" +) // Engine defines a container orchestration backend and is used // to create and manage container resources. type Engine interface { // Setup the pipeline environment. - Setup(*Config) error + Setup(context.Context, *Config) error // Start the pipeline step. - Exec(*Step) error + Exec(context.Context, *Step) error // Kill the pipeline step. - Kill(*Step) error + Kill(context.Context, *Step) error // Wait for the pipeline step to complete and returns // the completion results. - Wait(*Step) (*State, error) + Wait(context.Context, *Step) (*State, error) // Tail the pipeline step logs. - Tail(*Step) (io.ReadCloser, error) + Tail(context.Context, *Step) (io.ReadCloser, error) // Destroy the pipeline environment. - Destroy(*Config) error + Destroy(context.Context, *Config) error } diff --git a/vendor/github.com/cncd/pipeline/pipeline/backend/docker/docker.go b/vendor/github.com/cncd/pipeline/pipeline/backend/docker/docker.go index e7c67d6a04..84c333df16 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/backend/docker/docker.go +++ b/vendor/github.com/cncd/pipeline/pipeline/backend/docker/docker.go @@ -35,7 +35,7 @@ func NewEnv() (backend.Engine, error) { return New(cli), nil } -func (e *engine) Setup(conf *backend.Config) error { +func (e *engine) Setup(_ context.Context, conf *backend.Config) error { for _, vol := range conf.Volumes { _, err := e.client.VolumeCreate(noContext, volume.VolumesCreateBody{ Name: vol.Name, @@ -60,9 +60,7 @@ func (e *engine) Setup(conf *backend.Config) error { return nil } -func (e *engine) Exec(proc *backend.Step) error { - ctx := context.Background() - +func (e *engine) Exec(ctx context.Context, proc *backend.Step) error { config := toConfig(proc) hostConfig := toHostConfig(proc) @@ -126,12 +124,12 @@ func (e *engine) Exec(proc *backend.Step) error { return e.client.ContainerStart(ctx, proc.Name, startOpts) } -func (e *engine) Kill(proc *backend.Step) error { +func (e *engine) Kill(_ context.Context, proc *backend.Step) error { return e.client.ContainerKill(noContext, proc.Name, "9") } -func (e *engine) Wait(proc *backend.Step) (*backend.State, error) { - _, err := e.client.ContainerWait(noContext, proc.Name) +func (e *engine) Wait(ctx context.Context, proc *backend.Step) (*backend.State, error) { + _, err := e.client.ContainerWait(ctx, proc.Name) if err != nil { // todo } @@ -151,8 +149,8 @@ func (e *engine) Wait(proc *backend.Step) (*backend.State, error) { }, nil } -func (e *engine) Tail(proc *backend.Step) (io.ReadCloser, error) { - logs, err := e.client.ContainerLogs(noContext, proc.Name, logsOpts) +func (e *engine) Tail(ctx context.Context, proc *backend.Step) (io.ReadCloser, error) { + logs, err := e.client.ContainerLogs(ctx, proc.Name, logsOpts) if err != nil { return nil, err } @@ -167,7 +165,7 @@ func (e *engine) Tail(proc *backend.Step) (io.ReadCloser, error) { return rc, nil } -func (e *engine) Destroy(conf *backend.Config) error { +func (e *engine) Destroy(_ context.Context, conf *backend.Config) error { for _, stage := range conf.Stages { for _, step := range stage.Steps { e.client.ContainerKill(noContext, step.Name, "9") diff --git a/vendor/github.com/cncd/pipeline/pipeline/pipeline.go b/vendor/github.com/cncd/pipeline/pipeline/pipeline.go index be6970f832..047d85bad6 100644 --- a/vendor/github.com/cncd/pipeline/pipeline/pipeline.go +++ b/vendor/github.com/cncd/pipeline/pipeline/pipeline.go @@ -55,11 +55,11 @@ func New(spec *backend.Config, opts ...Option) *Runtime { // Run starts the runtime and waits for it to complete. func (r *Runtime) Run() error { defer func() { - r.engine.Destroy(r.spec) + r.engine.Destroy(r.ctx, r.spec) }() r.started = time.Now().Unix() - if err := r.engine.Setup(r.spec); err != nil { + if err := r.engine.Setup(r.ctx, r.spec); err != nil { return err } @@ -124,12 +124,12 @@ func (r *Runtime) exec(proc *backend.Step) error { } } - if err := r.engine.Exec(proc); err != nil { + if err := r.engine.Exec(r.ctx, proc); err != nil { return err } if r.logger != nil { - rc, err := r.engine.Tail(proc) + rc, err := r.engine.Tail(r.ctx, proc) if err != nil { return err } @@ -144,7 +144,7 @@ func (r *Runtime) exec(proc *backend.Step) error { return nil } - wait, err := r.engine.Wait(proc) + wait, err := r.engine.Wait(r.ctx, proc) if err != nil { return err } diff --git a/vendor/vendor.json b/vendor/vendor.json index 9e731caa2f..e45986fa17 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -193,82 +193,82 @@ "revisionTime": "2017-03-05T07:05:34Z" }, { - "checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=", + "checksumSHA1": "ZHIN9ZvSnpB6xJZrlRPiuSU5I+Y=", "path": "github.com/cncd/pipeline/pipeline", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { - "checksumSHA1": "iRKdpheRPBTP0DKTQH7zmE2PI34=", + "checksumSHA1": "fVN8cdG7KyWMge1UL3UzC0IZ8T4=", "path": "github.com/cncd/pipeline/pipeline/backend", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { - "checksumSHA1": "EHJGG1USUliP8nzNWV/axO5KLzw=", + "checksumSHA1": "W8YLHobCsauDN8mHNGv0kdDsNzM=", "path": "github.com/cncd/pipeline/pipeline/backend/docker", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "HWV2BBLXS4gY5eLJeNIg7Z6nAOA=", "path": "github.com/cncd/pipeline/pipeline/frontend", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "ncGH2MfHDtM7/dNzj2i+lnXFnf4=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "cdjOSSSS5Gzx7gRLNvObQvNJWYg=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "Sj2VYU+asWToYriIqcinav5MJZo=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "L7Q5qJmPITNmvFEEaj5MPwCWFRk=", "path": "github.com/cncd/pipeline/pipeline/frontend/yaml/types", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=", "path": "github.com/cncd/pipeline/pipeline/interrupt", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=", "path": "github.com/cncd/pipeline/pipeline/multipart", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "mfWlnRAr5B4+RL13W3s0BQVBofM=", "path": "github.com/cncd/pipeline/pipeline/rpc", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "N+3wNQ8hc/6yrh3FxbaxkEVwrkY=", "path": "github.com/cncd/pipeline/pipeline/rpc/proto", - "revision": "3a09486affc9215ba52f55b1f6e10182458d1aba", - "revisionTime": "2018-01-10T21:28:38Z" + "revision": "20fb2f4efd792fc8dafc53aec766c2edcfdf0bb0", + "revisionTime": "2018-04-01T18:32:51Z" }, { "checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=", From ea2c72b4b4f4499c67786cd742495df6e11b3e52 Mon Sep 17 00:00:00 2001 From: Delfer Date: Thu, 5 Apr 2018 15:53:28 +0300 Subject: [PATCH 74/91] Add ability to restart build of any state --- server/build.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/build.go b/server/build.go index cae90e6407..f1d6e89746 100644 --- a/server/build.go +++ b/server/build.go @@ -496,11 +496,8 @@ func PostBuild(c *gin.Context) { } switch build.Status { - case model.StatusPending, - model.StatusRunning, - model.StatusDeclined, - model.StatusBlocked, - model.StatusError: + case model.StatusDeclined, + model.StatusBlocked: c.String(500, "cannot restart a build with status %s", build.Status) return } From 23f215df0e3187b01c15fe93571786f86d2813dc Mon Sep 17 00:00:00 2001 From: Vincent Lequertier Date: Tue, 10 Apr 2018 10:47:28 +0200 Subject: [PATCH 75/91] Remove labels deserialization for gogs and gitea PRs This fixes #2154 --- remote/gitea/types.go | 1 - remote/gogs/types.go | 1 - 2 files changed, 2 deletions(-) diff --git a/remote/gitea/types.go b/remote/gitea/types.go index 0ae00804c2..4f0de583aa 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -71,7 +71,6 @@ type pullRequestHook struct { } `json:"user"` Title string `json:"title"` Body string `json:"body"` - Labels []string `json:"labels"` State string `json:"state"` URL string `json:"html_url"` Mergeable bool `json:"mergeable"` diff --git a/remote/gogs/types.go b/remote/gogs/types.go index 613a6a671f..9b62c3e28e 100644 --- a/remote/gogs/types.go +++ b/remote/gogs/types.go @@ -70,7 +70,6 @@ type pullRequestHook struct { } `json:"user"` Title string `json:"title"` Body string `json:"body"` - Labels []string `json:"labels"` State string `json:"state"` URL string `json:"html_url"` Mergeable bool `json:"mergeable"` From 79428aa2318ff960e70cda1af7a4a3b83dd95269 Mon Sep 17 00:00:00 2001 From: Matt Leung Date: Tue, 24 Apr 2018 14:48:50 -0700 Subject: [PATCH 76/91] Enable Vault auth through kubernetes auth method Added a feature to obtain the initial Vault token from the Kubernetes auth method. This works by making a request to the Vault server at the specified auth method mount point's login path and presenting the JWT located in a file on a running pod, along with the Kubernetes role to authenticate as. Vault will then respond with a token and its TTL, if the request is valid. --- cmd/drone-server/server.go | 18 +++++++ plugins/secrets/vault/fixtures/fakeJwt | 1 + plugins/secrets/vault/kubernetes.go | 47 ++++++++++++++++ plugins/secrets/vault/kubernetes_test.go | 69 ++++++++++++++++++++++++ plugins/secrets/vault/opts.go | 24 ++++++++- 5 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 plugins/secrets/vault/fixtures/fakeJwt create mode 100644 plugins/secrets/vault/kubernetes.go create mode 100644 plugins/secrets/vault/kubernetes_test.go diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index f36527bd1e..2729e6a43d 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -175,6 +175,24 @@ var flags = []cli.Flag{ Usage: "token to secure prometheus metrics endpoint", Value: "", }, + cli.StringFlag{ + EnvVar: "DRONE_VAULT_AUTH_TYPE", + Name: "drone-vault-auth-type", + Usage: "auth backend type used for connecting to vault", + Value: "token", + }, + cli.StringFlag{ + EnvVar: "DRONE_VAULT_AUTH_MOUNT_POINT", + Name: "drone-vault-auth-mount-point", + Usage: "mount point for desired vault auth backend", + Value: "", + }, + cli.StringFlag{ + EnvVar: "DRONE_VAULT_KUBERNETES_ROLE", + Name: "drone-vault-kubernetes-role", + Usage: "role to authenticate as for vault kubernetes auth", + Value: "", + }, // // resource limit parameters // diff --git a/plugins/secrets/vault/fixtures/fakeJwt b/plugins/secrets/vault/fixtures/fakeJwt new file mode 100644 index 0000000000..1e3abd126a --- /dev/null +++ b/plugins/secrets/vault/fixtures/fakeJwt @@ -0,0 +1 @@ +fakeJwt diff --git a/plugins/secrets/vault/kubernetes.go b/plugins/secrets/vault/kubernetes.go new file mode 100644 index 0000000000..ca23021d81 --- /dev/null +++ b/plugins/secrets/vault/kubernetes.go @@ -0,0 +1,47 @@ +package vault + +import ( + "fmt" + "github.com/drone/drone/plugins/internal" + "io/ioutil" + "time" +) + +/* +Vault JSON Response +{ + "auth": { + "client_token" = "token", + "lease_duration" = "1234s" + } +} +*/ +type VaultAuth struct { + Token string `json:"client_token"` + Lease string `json:"lease_duration"` +} +type VaultResp struct { + Auth VaultAuth +} + +func getKubernetesToken(addr, role, mountPoint, tokenFile string) (string, time.Duration, error) { + b, err := ioutil.ReadFile(tokenFile) + if err != nil { + return "", 0, err + } + + var resp VaultResp + path := fmt.Sprintf("%s/v1/auth/%s/login", addr, mountPoint) + data := map[string]string{ + "jwt": string(b), + "role": role, + } + + err = internal.Send("POST", path, data, &resp) + if err != nil { + return "", 0, err + } + + ttl, err := time.ParseDuration(resp.Auth.Lease) + return resp.Auth.Token, ttl, nil +} diff --git a/plugins/secrets/vault/kubernetes_test.go b/plugins/secrets/vault/kubernetes_test.go new file mode 100644 index 0000000000..1e1fbedee5 --- /dev/null +++ b/plugins/secrets/vault/kubernetes_test.go @@ -0,0 +1,69 @@ +package vault + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "testing" + "time" +) + +func TestGetKubernetesToken(t *testing.T) { + fakeRole := "fakeRole" + fakeMountPoint := "kubernetes" + fakeJwtFile := "fixtures/fakeJwt" + b, _ := ioutil.ReadFile(fakeJwtFile) + fakeJwt := string(b) + fakeClientToken := "fakeClientToken" + fakeLeaseMinutes := "10m" + fakeLeaseDuration, _ := time.ParseDuration(fakeLeaseMinutes) + fakeResp := fmt.Sprintf("{\"auth\": {\"client_token\": \"%s\", \"lease_duration\": \"%s\"}}", fakeClientToken, fakeLeaseMinutes) + expectedPath := "/v1/auth/kubernetes/login" + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + if r.Method != "POST" { + t.Errorf("Expected 'POST' request, got '%s'", r.Method) + } + if r.URL.EscapedPath() != expectedPath { + t.Errorf("Expected request to '%s', got '%s'", expectedPath, r.URL.EscapedPath()) + } + + var postdata struct { + Jwt string + Role string + } + err := json.NewDecoder(r.Body).Decode(&postdata) + if err != nil { + t.Errorf("Encountered error parsing request JSON: %s", err) + } + + jwt := postdata.Jwt + + if jwt != fakeJwt { + t.Errorf("Expected request to have jwt with value '%s', got: '%s'", fakeJwt, jwt) + } + role := postdata.Role + if role != fakeRole { + t.Errorf("Expected request to have role with value '%s', got: '%s'", fakeRole, role) + } + + fmt.Fprintf(w, fakeResp) + })) + defer ts.Close() + + url := ts.URL + token, ttl, err := getKubernetesToken(url, fakeRole, fakeMountPoint, fakeJwtFile) + if err != nil { + t.Errorf("getKubernetesToken returned an error: %s", err) + } + + if token != fakeClientToken { + t.Errorf("Expected returned token to have value '%s', got: '%s'", fakeClientToken, token) + } + if ttl != fakeLeaseDuration { + t.Errorf("Expected TTL to have value '%s', got: '%s'", fakeLeaseDuration.Seconds(), ttl.Seconds()) + } +} diff --git a/plugins/secrets/vault/opts.go b/plugins/secrets/vault/opts.go index e2833aaa32..037071ea86 100644 --- a/plugins/secrets/vault/opts.go +++ b/plugins/secrets/vault/opts.go @@ -4,7 +4,11 @@ package vault -import "time" +import ( + "github.com/Sirupsen/logrus" + "os" + "time" +) // Opts sets custom options for the vault client. type Opts func(v *vault) @@ -24,3 +28,21 @@ func WithRenewal(d time.Duration) Opts { v.renew = d } } + +func WithKubernetesAuth() Opts { + return func(v *vault) { + addr := os.Getenv("VAULT_ADDR") + role := os.Getenv("DRONE_VAULT_KUBERNETES_ROLE") + mount := os.Getenv("DRONE_VAULT_AUTH_MOUNT_POINT") + jwtFile := "/var/run/secrets/kubernetes.io/serviceaccount/token" + token, ttl, err := getKubernetesToken(addr, role, mount, jwtFile) + if err != nil { + logrus.Debugf("vault: failed to obtain token via kubernetes-auth backend: %s", err) + return + } + + v.client.SetToken(token) + v.ttl = ttl + v.renew = ttl / 2 + } +} From c4fe6496b5d99ff097fa393e2199a16b0cd8709a Mon Sep 17 00:00:00 2001 From: Matt Leung Date: Tue, 24 Apr 2018 15:26:12 -0700 Subject: [PATCH 77/91] fixup: catch err from parseduration --- plugins/secrets/vault/kubernetes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/secrets/vault/kubernetes.go b/plugins/secrets/vault/kubernetes.go index ca23021d81..be5d8ed046 100644 --- a/plugins/secrets/vault/kubernetes.go +++ b/plugins/secrets/vault/kubernetes.go @@ -43,5 +43,9 @@ func getKubernetesToken(addr, role, mountPoint, tokenFile string) (string, time. } ttl, err := time.ParseDuration(resp.Auth.Lease) + if err != nil { + return "", 0, err + } + return resp.Auth.Token, ttl, nil } From 764c36f736ebafd236ece1a423e5b60a3db3cc48 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Fri, 27 Apr 2018 18:59:36 +0300 Subject: [PATCH 78/91] Use user/permissions bitbucket API instead of hooks --- .gitignore | 1 + remote/bitbucket/bitbucket.go | 14 +++++++---- remote/bitbucket/internal/client.go | 37 ++++++++++++++++++++++------- remote/bitbucket/internal/types.go | 10 ++++++++ 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index c07e1ad423..ff6612453f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ extras/ release/ server/swagger/files/*.json +.idea/ diff --git a/remote/bitbucket/bitbucket.go b/remote/bitbucket/bitbucket.go index c76d3821c9..1dcaa06814 100644 --- a/remote/bitbucket/bitbucket.go +++ b/remote/bitbucket/bitbucket.go @@ -176,15 +176,21 @@ func (c *config) Perm(u *model.User, owner, name string) (*model.Perm, error) { client := c.newClient(u) perms := new(model.Perm) - _, err := client.FindRepo(owner, name) + repo, err := client.FindRepo(owner, name) if err != nil { return perms, err } - _, err = client.ListHooks(owner, name, &internal.ListOpts{}) + perm, err := client.GetPermission(repo.FullName) + if err == nil { - perms.Push = true - perms.Admin = true + switch perm.Permission { + case "admin": + perms.Push = true + perms.Admin = true + case "write": + perms.Push = true + } } perms.Pull = true return perms, nil diff --git a/remote/bitbucket/internal/client.go b/remote/bitbucket/internal/client.go index 9787255ad3..1b98dec95f 100644 --- a/remote/bitbucket/internal/client.go +++ b/remote/bitbucket/internal/client.go @@ -22,6 +22,7 @@ import ( "net/http" "net/url" + "github.com/pkg/errors" "golang.org/x/oauth2" "golang.org/x/oauth2/bitbucket" ) @@ -34,15 +35,16 @@ const ( ) const ( - pathUser = "%s/2.0/user/" - pathEmails = "%s/2.0/user/emails" - pathTeams = "%s/2.0/teams/?%s" - pathRepo = "%s/2.0/repositories/%s/%s" - pathRepos = "%s/2.0/repositories/%s?%s" - pathHook = "%s/2.0/repositories/%s/%s/hooks/%s" - pathHooks = "%s/2.0/repositories/%s/%s/hooks?%s" - pathSource = "%s/1.0/repositories/%s/%s/src/%s/%s" - pathStatus = "%s/2.0/repositories/%s/%s/commit/%s/statuses/build" + pathUser = "%s/2.0/user/" + pathEmails = "%s/2.0/user/emails" + pathPermissions = "%s/2.0/user/permissions/repositories?q=repository.full_name=\"%s\"" + pathTeams = "%s/2.0/teams/?%s" + pathRepo = "%s/2.0/repositories/%s/%s" + pathRepos = "%s/2.0/repositories/%s?%s" + pathHook = "%s/2.0/repositories/%s/%s/hooks/%s" + pathHooks = "%s/2.0/repositories/%s/%s/hooks?%s" + pathSource = "%s/1.0/repositories/%s/%s/src/%s/%s" + pathStatus = "%s/2.0/repositories/%s/%s/commit/%s/statuses/build" ) type Client struct { @@ -152,6 +154,23 @@ func (c *Client) CreateStatus(owner, name, revision string, status *BuildStatus) return c.do(uri, post, status, nil) } +func (c *Client) GetPermission(full_name string) (*RepoPerm, error) { + out := new(RepoPermResp) + uri := fmt.Sprintf(pathPermissions, c.base, full_name) + err := c.do(uri, get, nil, out) + + if err != nil { + return nil, err + } + + if len(out.Values) == 0 { + err = errors.New(fmt.Sprint("no permissions in repository ", full_name)) + return nil, err + } else { + return out.Values[0], nil + } +} + func (c *Client) do(rawurl, method string, in, out interface{}) error { uri, err := url.Parse(rawurl) diff --git a/remote/bitbucket/internal/types.go b/remote/bitbucket/internal/types.go index 18c5e0cacf..652b037cc0 100644 --- a/remote/bitbucket/internal/types.go +++ b/remote/bitbucket/internal/types.go @@ -224,3 +224,13 @@ type Error struct { func (e Error) Error() string { return e.Body.Message } + +type RepoPermResp struct { + Page int `json:"page"` + Pages int `json:"pagelen"` + Values []*RepoPerm `json:"values"` +} + +type RepoPerm struct { + Permission string `json:"permission"` +} From 0b73e5489b6312534eb4e0830bc116fc1d085ea8 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Fri, 27 Apr 2018 20:48:54 +0300 Subject: [PATCH 79/91] Add tests: - read access - write access - admin access --- remote/bitbucket/bitbucket.go | 22 +++++++++------ remote/bitbucket/bitbucket_test.go | 37 +++++++++++++++++++++--- remote/bitbucket/fixtures/handler.go | 42 ++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 13 deletions(-) diff --git a/remote/bitbucket/bitbucket.go b/remote/bitbucket/bitbucket.go index 1dcaa06814..35ec84f28d 100644 --- a/remote/bitbucket/bitbucket.go +++ b/remote/bitbucket/bitbucket.go @@ -182,17 +182,21 @@ func (c *config) Perm(u *model.User, owner, name string) (*model.Perm, error) { } perm, err := client.GetPermission(repo.FullName) + if err != nil { + return perms, err + } - if err == nil { - switch perm.Permission { - case "admin": - perms.Push = true - perms.Admin = true - case "write": - perms.Push = true - } + switch perm.Permission { + case "admin": + perms.Admin = true + fallthrough + case "write": + perms.Push = true + fallthrough + default: + perms.Pull = true } - perms.Pull = true + return perms, nil } diff --git a/remote/bitbucket/bitbucket_test.go b/remote/bitbucket/bitbucket_test.go index c22d0e7946..91172321b1 100644 --- a/remote/bitbucket/bitbucket_test.go +++ b/remote/bitbucket/bitbucket_test.go @@ -161,19 +161,30 @@ func Test_bitbucket(t *testing.T) { g.It("Should authorize read access", func() { perm, err := c.Perm( fakeUser, - fakeRepoNoHooks.Owner, - fakeRepoNoHooks.Name, + fakeRepoReadOnly.Owner, + fakeRepoReadOnly.Name, ) g.Assert(err == nil).IsTrue() g.Assert(perm.Pull).IsTrue() g.Assert(perm.Push).IsFalse() g.Assert(perm.Admin).IsFalse() }) + g.It("Should authorize write access", func() { + perm, err := c.Perm( + fakeUser, + fakeRepoWriteOnly.Owner, + fakeRepoWriteOnly.Name, + ) + g.Assert(err == nil).IsTrue() + g.Assert(perm.Pull).IsTrue() + g.Assert(perm.Push).IsTrue() + g.Assert(perm.Admin).IsFalse() + }) g.It("Should authorize admin access", func() { perm, err := c.Perm( fakeUser, - fakeRepo.Owner, - fakeRepo.Name, + fakeRepoAdmin.Owner, + fakeRepoAdmin.Name, ) g.Assert(err == nil).IsTrue() g.Assert(perm.Pull).IsTrue() @@ -350,6 +361,24 @@ var ( FullName: "test_name/hook_empty", } + fakeRepoReadOnly = &model.Repo{ + Owner: "test_name", + Name: "permission_read", + FullName: "test_name/permission_read", + } + + fakeRepoWriteOnly = &model.Repo{ + Owner: "test_name", + Name: "permission_write", + FullName: "test_name/permission_write", + } + + fakeRepoAdmin = &model.Repo{ + Owner: "test_name", + Name: "permission_admin", + FullName: "test_name/permission_admin", + } + fakeBuild = &model.Build{ Commit: "9ecad50", } diff --git a/remote/bitbucket/fixtures/handler.go b/remote/bitbucket/fixtures/handler.go index ec855a6091..f0565995ba 100644 --- a/remote/bitbucket/fixtures/handler.go +++ b/remote/bitbucket/fixtures/handler.go @@ -15,6 +15,7 @@ package fixtures import ( + "fmt" "net/http" "github.com/gin-gonic/gin" @@ -36,6 +37,7 @@ func Handler() http.Handler { e.GET("/2.0/repositories/:owner", getUserRepos) e.GET("/2.0/teams/", getUserTeams) e.GET("/2.0/user/", getUser) + e.GET("/2.0/user/permissions/repositories", getPermissions) return e } @@ -70,6 +72,8 @@ func getRepo(c *gin.Context) { switch c.Param("name") { case "not_found", "repo_unknown", "repo_not_found": c.String(404, "") + case "permission_read", "permission_write", "permission_admin": + c.String(200, fmt.Sprintf(permissionRepoPayload, c.Param("name"))) default: c.String(200, repoPayload) } @@ -144,6 +148,24 @@ func getUserRepos(c *gin.Context) { } } +func permission(p string) string { + return fmt.Sprintf(permissionPayload, p) +} + +func getPermissions(c *gin.Context) { + query := c.Request.URL.Query()["q"][0] + switch query { + case `repository.full_name="test_name/permission_read"`: + c.String(200, permission("read")) + case `repository.full_name="test_name/permission_write"`: + c.String(200, permission("write")) + case `repository.full_name="test_name/permission_admin"`: + c.String(200, permission("admin")) + default: + c.String(200, permission("read")) + } +} + const tokenPayload = ` { "access_token":"2YotnFZFEjr1zCsicMWpAA", @@ -170,6 +192,14 @@ const repoPayload = ` } ` +const permissionRepoPayload = ` +{ + "full_name": "test_name/%s", + "scm": "git", + "is_private": true +} +` + const repoHookPayload = ` { "pagelen": 10, @@ -238,3 +268,15 @@ const userTeamPayload = ` ] } ` + +const permissionPayload = ` +{ + "pagelen": 1, + "values": [ + { + "permission": "%s" + } + ], + "page": 1 +} +` From db698f9ef450d9a722a52707dbafb6de47527065 Mon Sep 17 00:00:00 2001 From: Matt Leung Date: Fri, 27 Apr 2018 14:22:20 -0700 Subject: [PATCH 80/91] fixup: some comments, added opts test, address pr concerns --- plugins/secrets/vault/kubernetes.go | 12 ++++----- plugins/secrets/vault/opts.go | 27 ++++++------------- plugins/secrets/vault/opts_test.go | 18 +++++++++++++ plugins/secrets/vault/vault.go | 40 +++++++++++++++++++++++++---- 4 files changed, 67 insertions(+), 30 deletions(-) diff --git a/plugins/secrets/vault/kubernetes.go b/plugins/secrets/vault/kubernetes.go index be5d8ed046..f289a8aff6 100644 --- a/plugins/secrets/vault/kubernetes.go +++ b/plugins/secrets/vault/kubernetes.go @@ -16,22 +16,22 @@ Vault JSON Response } } */ -type VaultAuth struct { +type vaultAuth struct { Token string `json:"client_token"` Lease string `json:"lease_duration"` } -type VaultResp struct { - Auth VaultAuth +type vaultResp struct { + Auth vaultAuth } -func getKubernetesToken(addr, role, mountPoint, tokenFile string) (string, time.Duration, error) { +func getKubernetesToken(addr, role, mount, tokenFile string) (string, time.Duration, error) { b, err := ioutil.ReadFile(tokenFile) if err != nil { return "", 0, err } - var resp VaultResp - path := fmt.Sprintf("%s/v1/auth/%s/login", addr, mountPoint) + var resp vaultResp + path := fmt.Sprintf("%s/v1/auth/%s/login", addr, mount) data := map[string]string{ "jwt": string(b), "role": role, diff --git a/plugins/secrets/vault/opts.go b/plugins/secrets/vault/opts.go index 037071ea86..081857854b 100644 --- a/plugins/secrets/vault/opts.go +++ b/plugins/secrets/vault/opts.go @@ -4,11 +4,7 @@ package vault -import ( - "github.com/Sirupsen/logrus" - "os" - "time" -) +import "time" // Opts sets custom options for the vault client. type Opts func(v *vault) @@ -29,20 +25,13 @@ func WithRenewal(d time.Duration) Opts { } } -func WithKubernetesAuth() Opts { +// WithKubernetes returns an options that sets +// kubernetes-auth parameters required to retrieve +// an initial Vault token +func WithKubernetesAuth(addr, role, mount string) Opts { return func(v *vault) { - addr := os.Getenv("VAULT_ADDR") - role := os.Getenv("DRONE_VAULT_KUBERNETES_ROLE") - mount := os.Getenv("DRONE_VAULT_AUTH_MOUNT_POINT") - jwtFile := "/var/run/secrets/kubernetes.io/serviceaccount/token" - token, ttl, err := getKubernetesToken(addr, role, mount, jwtFile) - if err != nil { - logrus.Debugf("vault: failed to obtain token via kubernetes-auth backend: %s", err) - return - } - - v.client.SetToken(token) - v.ttl = ttl - v.renew = ttl / 2 + v.kubeAuth.addr = addr + v.kubeAuth.role = role + v.kubeAuth.mount = mount } } diff --git a/plugins/secrets/vault/opts_test.go b/plugins/secrets/vault/opts_test.go index 217a98892d..79f01160f4 100644 --- a/plugins/secrets/vault/opts_test.go +++ b/plugins/secrets/vault/opts_test.go @@ -26,3 +26,21 @@ func TestWithRenewal(t *testing.T) { t.Errorf("Want renewal %v, got %v", want, got) } } + +func TestWithKubernetesAuth(t *testing.T) { + v := new(vault) + addr := "https://address.fake" + role := "fakeRole" + mount := "kubernetes" + opt := WithKubernetesAuth(addr, role, mount) + opt(v) + if got, want := v.kubeAuth.addr, addr; got != want { + t.Errorf("Want addr %v, got %v", want, got) + } + if got, want := v.kubeAuth.role, role; got != want { + t.Errorf("Want role %v, got %v", want, got) + } + if got, want := v.kubeAuth.mount, mount; got != want { + t.Errorf("Want mount %v, got %v", want, got) + } +} diff --git a/plugins/secrets/vault/vault.go b/plugins/secrets/vault/vault.go index 2ec8011588..ebad6859b1 100644 --- a/plugins/secrets/vault/vault.go +++ b/plugins/secrets/vault/vault.go @@ -41,11 +41,17 @@ type vaultConfig struct { } type vault struct { - store model.ConfigStore - client *api.Client - ttl time.Duration - renew time.Duration - done chan struct{} + store model.ConfigStore + client *api.Client + ttl time.Duration + renew time.Duration + auth string + kubeAuth kubeAuth + done chan struct{} +} + +type kubeAuth struct { + addr, role, mount string } // New returns a new store with secrets loaded from vault. @@ -61,10 +67,34 @@ func New(store model.ConfigStore, opts ...Opts) (secrets.Plugin, error) { for _, opt := range opts { opt(v) } + if v.auth == "kubernetes" { + err = v.initKubernetes() + if err != nil { + return nil, err + } + } v.start() // start the refresh process. return v, nil } +func (v *vault) initKubernetes() error { + token, ttl, err := getKubernetesToken( + v.kubeAuth.addr, + v.kubeAuth.role, + v.kubeAuth.mount, + "/var/run/secrets/kubernetes.io/serviceaccount/token", + ) + if err != nil { + logrus.Debugf("vault: failed to obtain token via kubernetes-auth backend: %s", err) + return err + } + + v.client.SetToken(token) + v.ttl = ttl + v.renew = ttl / 2 + return nil +} + func (v *vault) SecretListBuild(repo *model.Repo, build *model.Build) ([]*model.Secret, error) { return v.list(repo, build) } From 187d1d65bbba6afb541484e94a169f81a4ccc874 Mon Sep 17 00:00:00 2001 From: Matt Leung Date: Fri, 27 Apr 2018 14:50:47 -0700 Subject: [PATCH 81/91] add additional opt to set v.auth --- cmd/drone-server/server.go | 2 +- plugins/secrets/vault/opts.go | 10 +++++++++- plugins/secrets/vault/opts_test.go | 10 ++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index 2729e6a43d..fa689212e7 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -179,7 +179,7 @@ var flags = []cli.Flag{ EnvVar: "DRONE_VAULT_AUTH_TYPE", Name: "drone-vault-auth-type", Usage: "auth backend type used for connecting to vault", - Value: "token", + Value: "", }, cli.StringFlag{ EnvVar: "DRONE_VAULT_AUTH_MOUNT_POINT", diff --git a/plugins/secrets/vault/opts.go b/plugins/secrets/vault/opts.go index 081857854b..7b4eaa7ebc 100644 --- a/plugins/secrets/vault/opts.go +++ b/plugins/secrets/vault/opts.go @@ -25,9 +25,17 @@ func WithRenewal(d time.Duration) Opts { } } +// WithAuth returns an options that sets the vault +// method to use for authentication +func WithAuth(method string) Opts { + return func(v *vault) { + v.auth = method + } +} + // WithKubernetes returns an options that sets // kubernetes-auth parameters required to retrieve -// an initial Vault token +// an initial vault token func WithKubernetesAuth(addr, role, mount string) Opts { return func(v *vault) { v.kubeAuth.addr = addr diff --git a/plugins/secrets/vault/opts_test.go b/plugins/secrets/vault/opts_test.go index 79f01160f4..8739071518 100644 --- a/plugins/secrets/vault/opts_test.go +++ b/plugins/secrets/vault/opts_test.go @@ -27,6 +27,16 @@ func TestWithRenewal(t *testing.T) { } } +func TestWithAuth(t *testing.T) { + v := new(vault) + method := "kubernetes" + opt := WithAuth(method) + opt(v) + if got, want := v.auth, method; got != want { + t.Errorf("Want auth %v, got %v", want, got) + } +} + func TestWithKubernetesAuth(t *testing.T) { v := new(vault) addr := "https://address.fake" From b1dfa4a5a9a248419a776c43217504d4d5605a1b Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Sat, 28 Apr 2018 10:25:30 +0300 Subject: [PATCH 82/91] Fix PR comments full_name -> fullName "%s" -> %q errors.New -> fmt.Errorf --- remote/bitbucket/internal/client.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/remote/bitbucket/internal/client.go b/remote/bitbucket/internal/client.go index 1b98dec95f..374e280d43 100644 --- a/remote/bitbucket/internal/client.go +++ b/remote/bitbucket/internal/client.go @@ -22,7 +22,6 @@ import ( "net/http" "net/url" - "github.com/pkg/errors" "golang.org/x/oauth2" "golang.org/x/oauth2/bitbucket" ) @@ -37,7 +36,7 @@ const ( const ( pathUser = "%s/2.0/user/" pathEmails = "%s/2.0/user/emails" - pathPermissions = "%s/2.0/user/permissions/repositories?q=repository.full_name=\"%s\"" + pathPermissions = "%s/2.0/user/permissions/repositories?q=repository.full_name=%q" pathTeams = "%s/2.0/teams/?%s" pathRepo = "%s/2.0/repositories/%s/%s" pathRepos = "%s/2.0/repositories/%s?%s" @@ -154,9 +153,9 @@ func (c *Client) CreateStatus(owner, name, revision string, status *BuildStatus) return c.do(uri, post, status, nil) } -func (c *Client) GetPermission(full_name string) (*RepoPerm, error) { +func (c *Client) GetPermission(fullName string) (*RepoPerm, error) { out := new(RepoPermResp) - uri := fmt.Sprintf(pathPermissions, c.base, full_name) + uri := fmt.Sprintf(pathPermissions, c.base, fullName) err := c.do(uri, get, nil, out) if err != nil { @@ -164,8 +163,7 @@ func (c *Client) GetPermission(full_name string) (*RepoPerm, error) { } if len(out.Values) == 0 { - err = errors.New(fmt.Sprint("no permissions in repository ", full_name)) - return nil, err + return nil, fmt.Errorf("no permissions in repository ", fullName) } else { return out.Values[0], nil } From 0f737fd82c8d7b7fe006f239104cb55d331c8489 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Mon, 30 Apr 2018 11:50:49 +0300 Subject: [PATCH 83/91] Fix fmt.ErrorF usage --- remote/bitbucket/internal/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/bitbucket/internal/client.go b/remote/bitbucket/internal/client.go index 374e280d43..71ea12a7a8 100644 --- a/remote/bitbucket/internal/client.go +++ b/remote/bitbucket/internal/client.go @@ -163,7 +163,7 @@ func (c *Client) GetPermission(fullName string) (*RepoPerm, error) { } if len(out.Values) == 0 { - return nil, fmt.Errorf("no permissions in repository ", fullName) + return nil, fmt.Errorf("no permissions in repository %s", fullName) } else { return out.Values[0], nil } From 6a651f1e39c4a1aca0802f538f991e270864ee3f Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 1 May 2018 21:05:30 -0700 Subject: [PATCH 84/91] move vault params to extras --- cmd/drone-server/server.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index fa689212e7..f36527bd1e 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -175,24 +175,6 @@ var flags = []cli.Flag{ Usage: "token to secure prometheus metrics endpoint", Value: "", }, - cli.StringFlag{ - EnvVar: "DRONE_VAULT_AUTH_TYPE", - Name: "drone-vault-auth-type", - Usage: "auth backend type used for connecting to vault", - Value: "", - }, - cli.StringFlag{ - EnvVar: "DRONE_VAULT_AUTH_MOUNT_POINT", - Name: "drone-vault-auth-mount-point", - Usage: "mount point for desired vault auth backend", - Value: "", - }, - cli.StringFlag{ - EnvVar: "DRONE_VAULT_KUBERNETES_ROLE", - Name: "drone-vault-kubernetes-role", - Usage: "role to authenticate as for vault kubernetes auth", - Value: "", - }, // // resource limit parameters // From 9ffd5ad9e87f3d780264225bade99e39461733cd Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 2 May 2018 09:45:05 -0700 Subject: [PATCH 85/91] alternate build count strategy for postgres --- store/datastore/builds_test.go | 6 ++++++ store/datastore/sql/postgres/files/counts.sql | 3 +-- store/datastore/sql/postgres/sql_gen.go | 17 +---------------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/store/datastore/builds_test.go b/store/datastore/builds_test.go index ee5305a788..8b37883870 100644 --- a/store/datastore/builds_test.go +++ b/store/datastore/builds_test.go @@ -268,6 +268,12 @@ func TestBuilds(t *testing.T) { g.Assert(builds[0].RepoID).Equal(build2.RepoID) g.Assert(builds[0].Status).Equal(build2.Status) }) + + g.It("Should count Builds", func() { + count, err := s.GetBuildCount() + g.Assert(err == nil).IsTrue() + g.Assert(count > 0).IsTrue() + }) }) } diff --git a/store/datastore/sql/postgres/files/counts.sql b/store/datastore/sql/postgres/files/counts.sql index 29948d9322..b9c34cf1ae 100644 --- a/store/datastore/sql/postgres/files/counts.sql +++ b/store/datastore/sql/postgres/files/counts.sql @@ -11,5 +11,4 @@ WHERE repo_active = true -- name: count-builds -SELECT reltuples -FROM pg_class WHERE relname = 'builds' +SELECT currval('builds_build_id_seq'); diff --git a/store/datastore/sql/postgres/sql_gen.go b/store/datastore/sql/postgres/sql_gen.go index 82475ce591..5cb3576b1f 100644 --- a/store/datastore/sql/postgres/sql_gen.go +++ b/store/datastore/sql/postgres/sql_gen.go @@ -1,17 +1,3 @@ -// Copyright 2018 Drone.IO Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - package postgres // Lookup returns the named statement. @@ -108,8 +94,7 @@ WHERE repo_active = true ` var countBuilds = ` -SELECT reltuples -FROM pg_class WHERE relname = 'builds' +SELECT currval('builds_build_id_seq'); ` var feedLatestBuild = ` From 4063d29b446d1e090027aa4de5aef779ae6216f5 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 2 May 2018 09:59:05 -0700 Subject: [PATCH 86/91] fix failing build count test --- store/datastore/builds_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/store/datastore/builds_test.go b/store/datastore/builds_test.go index 8b37883870..3411733c8a 100644 --- a/store/datastore/builds_test.go +++ b/store/datastore/builds_test.go @@ -15,6 +15,7 @@ package datastore import ( + "fmt" "testing" "github.com/drone/drone/model" @@ -60,6 +61,11 @@ func TestBuilds(t *testing.T) { g.Assert(build.ID != 0).IsTrue() g.Assert(build.Number).Equal(1) g.Assert(build.Commit).Equal("85f8c029b902ed9400bc600bac301a0aadb144ac") + + count, err := s.GetBuildCount() + g.Assert(err == nil).IsTrue() + g.Assert(count > 0).IsTrue() + fmt.Println("GOT COUNT", count) }) g.It("Should Put a Build", func() { @@ -268,12 +274,6 @@ func TestBuilds(t *testing.T) { g.Assert(builds[0].RepoID).Equal(build2.RepoID) g.Assert(builds[0].Status).Equal(build2.Status) }) - - g.It("Should count Builds", func() { - count, err := s.GetBuildCount() - g.Assert(err == nil).IsTrue() - g.Assert(count > 0).IsTrue() - }) }) } From 75fbaf91d9e48b9ccc1ce3b3fd948d544a28ea1a Mon Sep 17 00:00:00 2001 From: Matt Leung Date: Wed, 2 May 2018 16:54:34 -0700 Subject: [PATCH 87/91] Fix vault-k8s expected response type Vault server response for lease_duration is an integer, rather than a string --- plugins/secrets/vault/kubernetes.go | 9 +++------ plugins/secrets/vault/kubernetes_test.go | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/secrets/vault/kubernetes.go b/plugins/secrets/vault/kubernetes.go index f289a8aff6..32a88f5000 100644 --- a/plugins/secrets/vault/kubernetes.go +++ b/plugins/secrets/vault/kubernetes.go @@ -12,13 +12,13 @@ Vault JSON Response { "auth": { "client_token" = "token", - "lease_duration" = "1234s" + "lease_duration" = 1234 } } */ type vaultAuth struct { Token string `json:"client_token"` - Lease string `json:"lease_duration"` + Lease int `json:"lease_duration"` } type vaultResp struct { Auth vaultAuth @@ -42,10 +42,7 @@ func getKubernetesToken(addr, role, mount, tokenFile string) (string, time.Durat return "", 0, err } - ttl, err := time.ParseDuration(resp.Auth.Lease) - if err != nil { - return "", 0, err - } + ttl := time.Duration(resp.Auth.Lease) * time.Second return resp.Auth.Token, ttl, nil } diff --git a/plugins/secrets/vault/kubernetes_test.go b/plugins/secrets/vault/kubernetes_test.go index 1e1fbedee5..42cfe6370a 100644 --- a/plugins/secrets/vault/kubernetes_test.go +++ b/plugins/secrets/vault/kubernetes_test.go @@ -17,9 +17,9 @@ func TestGetKubernetesToken(t *testing.T) { b, _ := ioutil.ReadFile(fakeJwtFile) fakeJwt := string(b) fakeClientToken := "fakeClientToken" - fakeLeaseMinutes := "10m" - fakeLeaseDuration, _ := time.ParseDuration(fakeLeaseMinutes) - fakeResp := fmt.Sprintf("{\"auth\": {\"client_token\": \"%s\", \"lease_duration\": \"%s\"}}", fakeClientToken, fakeLeaseMinutes) + fakeLeaseSeconds := 86400 + fakeLeaseDuration := time.Duration(fakeLeaseSeconds) * time.Second + fakeResp := fmt.Sprintf("{\"auth\": {\"client_token\": \"%s\", \"lease_duration\": %d}}", fakeClientToken, fakeLeaseSeconds) expectedPath := "/v1/auth/kubernetes/login" ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { From 20b26373bf40e1aaa6e0d73b6f79cc2cec8e9902 Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Mon, 21 May 2018 20:18:22 +0200 Subject: [PATCH 88/91] Documentation fork --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 338ce8f12d..c335ef0377 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +## Gbo's fork + +### Patches : + + - [Fallback to remote yaml when no .drone.yml found](https://github.com/drone/drone/compare/master...gboddin:feature/fallback-cleaned) + - [Filter with refspec](https://github.com/drone/drone/compare/master...gboddin:feature/with-refspec-pipeline) + - [OSS build](https://github.com/drone/drone/compare/master...gboddin:feature/drone-build-oss) + Drone is a Continuous Delivery system built on container technology. Drone uses a simple YAML configuration file, a superset of docker-compose, to define and execute Pipelines inside Docker containers.
From 36783e98f08ab6321bdcb08943ce9b01917508d6 Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Mon, 21 May 2018 20:22:00 +0200 Subject: [PATCH 89/91] Switched latest to master --- .drone.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 204c1d2b04..7aa16e39e1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -44,7 +44,7 @@ pipeline: secrets: [ docker_username, docker_password ] tag: [ alpine ] when: - branch: gbo + branch: master event: push publish_server: @@ -53,7 +53,7 @@ pipeline: secrets: [ docker_username, docker_password ] tag: [ latest ] when: - branch: gbo + branch: master event: push publish_agent_alpine: @@ -63,7 +63,7 @@ pipeline: secrets: [ docker_username, docker_password ] tag: [ alpine ] when: - branch: gbo + branch: master event: push publish_agent_arm: @@ -73,7 +73,7 @@ pipeline: secrets: [ docker_username, docker_password ] tag: [ linux-arm ] when: - branch: gbo + branch: master event: push publish_agent_arm64: @@ -83,7 +83,7 @@ pipeline: secrets: [ docker_username, docker_password ] tag: [ linux-arm64 ] when: - branch: gbo + branch: master event: push publish_agent_amd64: @@ -93,7 +93,7 @@ pipeline: secrets: [ docker_username, docker_password ] tag: [ latest ] when: - branch: gbo + branch: master event: push release_server_alpine: From 737a9d7bcb2aed7597357f572d2495a5f8781ae2 Mon Sep 17 00:00:00 2001 From: Gregory Boddin Date: Mon, 21 May 2018 20:28:24 +0200 Subject: [PATCH 90/91] Update README.md --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c335ef0377..0756d387e1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,22 @@ ## Gbo's fork -### Patches : +### Patches - [Fallback to remote yaml when no .drone.yml found](https://github.com/drone/drone/compare/master...gboddin:feature/fallback-cleaned) - [Filter with refspec](https://github.com/drone/drone/compare/master...gboddin:feature/with-refspec-pipeline) - [OSS build](https://github.com/drone/drone/compare/master...gboddin:feature/drone-build-oss) +### Images + - gboo/drone-server + - gboo/drone-agent + +### Fork disclaimer + +- Resolves user's specific needs +- No support +- Voids any Enterprise support +- Licensing terms by Drone is still applies when using non-free work ( see source headers ) + Drone is a Continuous Delivery system built on container technology. Drone uses a simple YAML configuration file, a superset of docker-compose, to define and execute Pipelines inside Docker containers.
From c48150767c2700d35dcc29b110a81c8b5969175e Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Fri, 27 Jul 2018 12:46:02 +0200 Subject: [PATCH 91/91] Raise version to 0.8.6 --- .drone.yml | 4 ++-- version/version.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index d372a27e67..e369ea1671 100644 --- a/.drone.yml +++ b/.drone.yml @@ -118,7 +118,7 @@ pipeline: image: plugins/docker repo: drone/drone secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.5 ] + tag: [ 0.8, 0.8.6 ] when: event: tag @@ -127,7 +127,7 @@ pipeline: repo: drone/agent dockerfile: Dockerfile.agent secrets: [ docker_username, docker_password ] - tag: [ 0.8, 0.8.5 ] + tag: [ 0.8, 0.8.6 ] when: event: tag diff --git a/version/version.go b/version/version.go index 4be904ee12..f30bd06aec 100644 --- a/version/version.go +++ b/version/version.go @@ -22,7 +22,7 @@ var ( // VersionMinor is for functionality in a backwards-compatible manner. VersionMinor int64 = 8 // VersionPatch is for backwards-compatible bug fixes. - VersionPatch int64 = 5 + VersionPatch int64 = 6 // VersionPre indicates prerelease. VersionPre string // VersionDev indicates development branch. Releases will be empty string.