Skip to content

Commit

Permalink
add build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Feb 28, 2019
1 parent 7c1f21d commit d04647e
Show file tree
Hide file tree
Showing 137 changed files with 941 additions and 266 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.env
.env.*
release/
scripts/
14 changes: 9 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Copyright 2019 Drone.IO, Inc.

Source code in this repository is variously licensed under the
Apache License Version 2.0, an Apache compatible license, or the
Drone Non-Commercial License. Source code in a given file is
licensed under the Drone Non-Commercial License unless otherwise
noted at the beginning of the file.
The Drone 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 is licensed under the Drone
Non-Commercial License (the "Non-Commercial License"). A copy of
the Non-Commercial License is provided below.

-----------------------------------------------------------------

Expand Down
2 changes: 2 additions & 0 deletions cmd/drone-agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package config

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/drone-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/drone-controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package config

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/drone-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions core/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core
2 changes: 2 additions & 0 deletions core/cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core
2 changes: 2 additions & 0 deletions core/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core
2 changes: 2 additions & 0 deletions core/license_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core
2 changes: 2 additions & 0 deletions core/netrc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core
2 changes: 2 additions & 0 deletions core/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core

import "testing"
Expand Down
2 changes: 2 additions & 0 deletions core/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core

import "testing"
Expand Down
2 changes: 2 additions & 0 deletions core/step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core

import "testing"
Expand Down
2 changes: 2 additions & 0 deletions core/trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core
2 changes: 2 additions & 0 deletions core/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package core

import (
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uP
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-retryablehttp v0.0.0-20180718195005-e651d75abec6 h1:qCv4319q2q7XKn0MQbi8p37hsJ+9Xo8e6yojA73JVxk=
github.com/hashicorp/go-retryablehttp v0.0.0-20180718195005-e651d75abec6/go.mod h1:fXcdFsQoipQa7mwORhKad5jmDCeSy/RCGzWA08PO0lM=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/nomad v0.0.0-20190125003214-134391155854 h1:L7WhLZt2ory/kQWxqkMwOiBpIoa4BWoadN7yx8LHEtk=
Expand Down
16 changes: 13 additions & 3 deletions handler/api/api.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
// Copyright 2019 Drone IO, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in 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 api

Expand Down
9 changes: 9 additions & 0 deletions handler/api/render/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ var (

// ErrNotFound is returned when a resource is not found.
ErrNotFound = errors.New("Not Found")

// ErrNotImplemented is returned when an endpoint is not implemented.
ErrNotImplemented = errors.New("Not Implemented")
)

// ErrorCode writes the json-encoded error message to the response.
Expand All @@ -64,6 +67,12 @@ func InternalErrorf(w http.ResponseWriter, format string, a ...interface{}) {
ErrorCode(w, fmt.Errorf(format, a...), 500)
}

// NotImplemented writes the json-encoded error message to the
// response with a 501 not found status code.
func NotImplemented(w http.ResponseWriter, err error) {
ErrorCode(w, err, 501)
}

// NotFound writes the json-encoded error message to the response
// with a 404 not found status code.
func NotFound(w http.ResponseWriter, err error) {
Expand Down
18 changes: 14 additions & 4 deletions handler/api/repos/builds/logs/delete.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
// Copyright 2019 Drone IO, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in 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 logs

import (
"net/http"
"strconv"

"github.com/drone/drone/handler/api/render"
"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/render"

"github.com/go-chi/chi"
)
Expand Down
18 changes: 14 additions & 4 deletions handler/api/repos/builds/logs/find.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
// Copyright 2019 Drone IO, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in 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 logs

Expand All @@ -9,8 +19,8 @@ import (
"net/http"
"strconv"

"github.com/drone/drone/handler/api/render"
"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/render"

"github.com/go-chi/chi"
)
Expand Down
16 changes: 13 additions & 3 deletions handler/api/repos/chown.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
// Copyright 2019 Drone IO, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in 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 repos

Expand Down
4 changes: 3 additions & 1 deletion handler/api/repos/collabs/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package collabs

import (
"net/http"

"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/render"
"github.com/drone/drone/logger"
"github.com/drone/drone/core"

"github.com/go-chi/chi"
)
Expand Down
4 changes: 3 additions & 1 deletion handler/api/repos/collabs/find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package collabs

import (
Expand All @@ -12,9 +14,9 @@ import (
"net/http/httptest"
"testing"

"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/errors"
"github.com/drone/drone/mock"
"github.com/drone/drone/core"
"github.com/sirupsen/logrus"

"github.com/go-chi/chi"
Expand Down
4 changes: 3 additions & 1 deletion handler/api/repos/collabs/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package collabs

import (
"net/http"

"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/render"
"github.com/drone/drone/logger"
"github.com/drone/drone/core"

"github.com/go-chi/chi"
)
Expand Down
4 changes: 3 additions & 1 deletion handler/api/repos/collabs/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package collabs

import (
Expand All @@ -11,9 +13,9 @@ import (
"net/http/httptest"
"testing"

"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/errors"
"github.com/drone/drone/mock"
"github.com/drone/drone/core"

"github.com/go-chi/chi"
"github.com/golang/mock/gomock"
Expand Down
40 changes: 40 additions & 0 deletions handler/api/repos/collabs/none.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2019 Drone IO, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in 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 oss

package collabs

import (
"net/http"

"github.com/drone/drone/core"
"github.com/drone/drone/handler/api/render"
)

var notImplemented = func(w http.ResponseWriter, r *http.Request) {
render.NotImplemented(w, render.ErrNotImplemented)
}

func HandleDelete(core.UserStore, core.RepositoryStore, core.PermStore) http.HandlerFunc {
return notImplemented
}

func HandleFind(core.UserStore, core.RepositoryStore, core.PermStore) http.HandlerFunc {
return notImplemented
}

func HandleList(core.RepositoryStore, core.PermStore) http.HandlerFunc {
return notImplemented
}
Loading

0 comments on commit d04647e

Please sign in to comment.