From 5281751ba5e82f8cb77ad894d532b8916ff6fdfd Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 28 Feb 2019 16:23:06 -0800 Subject: [PATCH] continue adding build tags issue #2616 [ci skip] --- plugin/admission/account.go | 2 ++ plugin/admission/account_oss.go | 24 +++++++++++++++++++++ plugin/admission/account_test.go | 2 ++ plugin/admission/combine.go | 16 +++++++++++--- plugin/admission/combine_test.go | 2 ++ plugin/admission/external.go | 2 ++ plugin/admission/external_oss.go | 24 +++++++++++++++++++++ plugin/admission/external_test.go | 2 ++ plugin/admission/nobot.go | 2 ++ plugin/admission/nobot_oss.go | 24 +++++++++++++++++++++ plugin/admission/nobot_test.go | 2 ++ plugin/admission/noop.go | 28 ++++++++++++++++++++++++ plugin/admission/open.go | 16 +++++++++++--- plugin/admission/open_test.go | 2 ++ plugin/config/combine.go | 16 +++++++++++--- plugin/config/global.go | 2 ++ plugin/config/global_oss.go | 34 ++++++++++++++++++++++++++++++ plugin/config/global_test.go | 2 ++ plugin/config/repo.go | 16 +++++++++++--- plugin/registry/auths/auth.go | 16 +++++++++++--- plugin/registry/auths/auth_test.go | 2 ++ plugin/registry/combine.go | 18 ++++++++++++---- plugin/registry/endpoint.go | 2 ++ plugin/registry/endpoint_oss.go | 24 +++++++++++++++++++++ plugin/registry/endpoint_test.go | 2 ++ plugin/registry/external.go | 2 ++ plugin/registry/external_oss.go | 24 +++++++++++++++++++++ plugin/registry/external_test.go | 2 ++ plugin/registry/file.go | 2 ++ plugin/registry/file_oss.go | 24 +++++++++++++++++++++ plugin/registry/file_test.go | 2 ++ plugin/registry/noop.go | 27 ++++++++++++++++++++++++ plugin/registry/static.go | 16 +++++++++++--- plugin/secret/combine.go | 16 +++++++++++--- plugin/secret/external.go | 12 ++++++----- plugin/secret/external_oss.go | 34 ++++++++++++++++++++++++++++++ plugin/secret/static.go | 16 +++++++++++--- plugin/webhook/webhook.go | 2 ++ plugin/webhook/webhook_oss.go | 34 ++++++++++++++++++++++++++++++ plugin/webhook/webhook_test.go | 2 ++ scheduler/internal/image.go | 2 ++ scheduler/queue/canceller.go | 16 +++++++++++--- scheduler/queue/queue.go | 16 +++++++++++--- scheduler/queue/scheduler.go | 16 +++++++++++--- service/license/load.go | 16 +++++++++++--- service/license/load_test.go | 16 +++++++++++--- service/license/nolimit.go | 16 +++++++++++--- service/license/service.go | 16 +++++++++++--- 48 files changed, 557 insertions(+), 54 deletions(-) create mode 100644 plugin/admission/account_oss.go create mode 100644 plugin/admission/external_oss.go create mode 100644 plugin/admission/nobot_oss.go create mode 100644 plugin/admission/noop.go create mode 100644 plugin/config/global_oss.go create mode 100644 plugin/registry/endpoint_oss.go create mode 100644 plugin/registry/external_oss.go create mode 100644 plugin/registry/file_oss.go create mode 100644 plugin/registry/noop.go create mode 100644 plugin/secret/external_oss.go create mode 100644 plugin/webhook/webhook_oss.go diff --git a/plugin/admission/account.go b/plugin/admission/account.go index 4154dbe7..07482da1 100644 --- a/plugin/admission/account.go +++ b/plugin/admission/account.go @@ -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 admission import ( diff --git a/plugin/admission/account_oss.go b/plugin/admission/account_oss.go new file mode 100644 index 00000000..ec27eb7d --- /dev/null +++ b/plugin/admission/account_oss.go @@ -0,0 +1,24 @@ +// 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 admission + +import "github.com/drone/drone/core" + +// Membership is a no-op admission controller +func Membership(core.OrganizationService, []string) core.AdmissionService { + return new(noop) +} diff --git a/plugin/admission/account_test.go b/plugin/admission/account_test.go index c7d44492..6065417b 100644 --- a/plugin/admission/account_test.go +++ b/plugin/admission/account_test.go @@ -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 admission import ( diff --git a/plugin/admission/combine.go b/plugin/admission/combine.go index 2de8909f..608971bb 100644 --- a/plugin/admission/combine.go +++ b/plugin/admission/combine.go @@ -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 admission diff --git a/plugin/admission/combine_test.go b/plugin/admission/combine_test.go index 52fa8fc2..b043c1c2 100644 --- a/plugin/admission/combine_test.go +++ b/plugin/admission/combine_test.go @@ -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 admission import ( diff --git a/plugin/admission/external.go b/plugin/admission/external.go index ad4a7103..70de937a 100644 --- a/plugin/admission/external.go +++ b/plugin/admission/external.go @@ -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 admission import ( diff --git a/plugin/admission/external_oss.go b/plugin/admission/external_oss.go new file mode 100644 index 00000000..8497ebb9 --- /dev/null +++ b/plugin/admission/external_oss.go @@ -0,0 +1,24 @@ +// 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 admission + +import "github.com/drone/drone/core" + +// External is a no-op admission controller +func External(string, string, bool) core.AdmissionService { + return new(noop) +} diff --git a/plugin/admission/external_test.go b/plugin/admission/external_test.go index 98a9ea10..5af7309a 100644 --- a/plugin/admission/external_test.go +++ b/plugin/admission/external_test.go @@ -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 admission diff --git a/plugin/admission/nobot.go b/plugin/admission/nobot.go index e78c8f1b..ab2ab1d8 100644 --- a/plugin/admission/nobot.go +++ b/plugin/admission/nobot.go @@ -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 admission import ( diff --git a/plugin/admission/nobot_oss.go b/plugin/admission/nobot_oss.go new file mode 100644 index 00000000..a4aa48d8 --- /dev/null +++ b/plugin/admission/nobot_oss.go @@ -0,0 +1,24 @@ +// 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 admission + +import "github.com/drone/drone/core" + +// Nobot is a no-op admission controller +func Nobot(string, string, bool) core.AdmissionService { + return new(noop) +} diff --git a/plugin/admission/nobot_test.go b/plugin/admission/nobot_test.go index 5cd42787..863d5858 100644 --- a/plugin/admission/nobot_test.go +++ b/plugin/admission/nobot_test.go @@ -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 admission import ( diff --git a/plugin/admission/noop.go b/plugin/admission/noop.go new file mode 100644 index 00000000..cc60c856 --- /dev/null +++ b/plugin/admission/noop.go @@ -0,0 +1,28 @@ +// 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 admission + +import ( + "context" + + "github.com/drone/drone/core" +) + +// noop is a stub admission controller. +type noop struct{} + +func (noop) Admit(context.Context, *core.User) error { + return nil +} diff --git a/plugin/admission/open.go b/plugin/admission/open.go index f5f9be35..80b60bc6 100644 --- a/plugin/admission/open.go +++ b/plugin/admission/open.go @@ -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 admission diff --git a/plugin/admission/open_test.go b/plugin/admission/open_test.go index f556101d..c9416daf 100644 --- a/plugin/admission/open_test.go +++ b/plugin/admission/open_test.go @@ -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 admission import ( diff --git a/plugin/config/combine.go b/plugin/config/combine.go index 1ea9e687..da506ee7 100644 --- a/plugin/config/combine.go +++ b/plugin/config/combine.go @@ -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 config diff --git a/plugin/config/global.go b/plugin/config/global.go index 68e90bde..dc81464d 100644 --- a/plugin/config/global.go +++ b/plugin/config/global.go @@ -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 ( diff --git a/plugin/config/global_oss.go b/plugin/config/global_oss.go new file mode 100644 index 00000000..0e79dc67 --- /dev/null +++ b/plugin/config/global_oss.go @@ -0,0 +1,34 @@ +// 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 config + +import ( + "context" + + "github.com/drone/drone/core" +) + +// Global returns a no-op configuration service. +func Global(string, string, bool) core.ConfigService { + return +} + +type noop struct{} + +func (noop) Find(context.Context, *core.ConfigArgs) (*core.Config, error) { + return nil, nil +} diff --git a/plugin/config/global_test.go b/plugin/config/global_test.go index 1f7e5567..d17b1c8d 100644 --- a/plugin/config/global_test.go +++ b/plugin/config/global_test.go @@ -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 ( diff --git a/plugin/config/repo.go b/plugin/config/repo.go index 75826323..d6e8eb0b 100644 --- a/plugin/config/repo.go +++ b/plugin/config/repo.go @@ -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 config diff --git a/plugin/registry/auths/auth.go b/plugin/registry/auths/auth.go index a14e083f..b99bb0ae 100644 --- a/plugin/registry/auths/auth.go +++ b/plugin/registry/auths/auth.go @@ -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 auths diff --git a/plugin/registry/auths/auth_test.go b/plugin/registry/auths/auth_test.go index 9929b5ec..7f1467a4 100644 --- a/plugin/registry/auths/auth_test.go +++ b/plugin/registry/auths/auth_test.go @@ -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 auths import ( diff --git a/plugin/registry/combine.go b/plugin/registry/combine.go index 2e8940e1..022cdc67 100644 --- a/plugin/registry/combine.go +++ b/plugin/registry/combine.go @@ -1,14 +1,24 @@ -// 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 registry import ( "context" - "github.com/drone/drone/logger" "github.com/drone/drone/core" + "github.com/drone/drone/logger" "github.com/sirupsen/logrus" ) diff --git a/plugin/registry/endpoint.go b/plugin/registry/endpoint.go index 45150131..f69c9c41 100644 --- a/plugin/registry/endpoint.go +++ b/plugin/registry/endpoint.go @@ -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 registry import ( diff --git a/plugin/registry/endpoint_oss.go b/plugin/registry/endpoint_oss.go new file mode 100644 index 00000000..4fb37f49 --- /dev/null +++ b/plugin/registry/endpoint_oss.go @@ -0,0 +1,24 @@ +// 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 registry + +import "github.com/drone/drone/core" + +// Endpoint returns a no-op registry credential provider. +func Endpoint(string, string, bool) core.RegistryService { + return new(noop) +} diff --git a/plugin/registry/endpoint_test.go b/plugin/registry/endpoint_test.go index e6fd1e47..2694fce4 100644 --- a/plugin/registry/endpoint_test.go +++ b/plugin/registry/endpoint_test.go @@ -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 registry import ( diff --git a/plugin/registry/external.go b/plugin/registry/external.go index ef8841cd..a3d2d518 100644 --- a/plugin/registry/external.go +++ b/plugin/registry/external.go @@ -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 registry import ( diff --git a/plugin/registry/external_oss.go b/plugin/registry/external_oss.go new file mode 100644 index 00000000..68378206 --- /dev/null +++ b/plugin/registry/external_oss.go @@ -0,0 +1,24 @@ +// 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 registry + +import "github.com/drone/drone/core" + +// External returns a no-op registry credential provider. +func External(string, string, bool) core.RegistryService { + return new(noop) +} diff --git a/plugin/registry/external_test.go b/plugin/registry/external_test.go index bb362079..1bfb397d 100644 --- a/plugin/registry/external_test.go +++ b/plugin/registry/external_test.go @@ -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 registry diff --git a/plugin/registry/file.go b/plugin/registry/file.go index 792260e9..4b7755aa 100644 --- a/plugin/registry/file.go +++ b/plugin/registry/file.go @@ -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 registry import ( diff --git a/plugin/registry/file_oss.go b/plugin/registry/file_oss.go new file mode 100644 index 00000000..fef39cb0 --- /dev/null +++ b/plugin/registry/file_oss.go @@ -0,0 +1,24 @@ +// 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 registry + +import "github.com/drone/drone/core" + +// FileSource returns a no-op registry credential provider. +func FileSource(string) core.RegistryService { + return new(noop) +} diff --git a/plugin/registry/file_test.go b/plugin/registry/file_test.go index 73098d6c..40f9eb31 100644 --- a/plugin/registry/file_test.go +++ b/plugin/registry/file_test.go @@ -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 registry import ( diff --git a/plugin/registry/noop.go b/plugin/registry/noop.go new file mode 100644 index 00000000..8e2e77e2 --- /dev/null +++ b/plugin/registry/noop.go @@ -0,0 +1,27 @@ +// 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 registry + +import ( + "context" + + "github.com/drone/drone/core" +) + +type noop struct{} + +func (noop) List(context.Context, *core.RegistryArgs) ([]*core.Registry, error) { + return nil, nil +} diff --git a/plugin/registry/static.go b/plugin/registry/static.go index 16cb5985..5f734fd2 100644 --- a/plugin/registry/static.go +++ b/plugin/registry/static.go @@ -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 registry diff --git a/plugin/secret/combine.go b/plugin/secret/combine.go index b66b1673..9c85ce80 100644 --- a/plugin/secret/combine.go +++ b/plugin/secret/combine.go @@ -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 secret diff --git a/plugin/secret/external.go b/plugin/secret/external.go index b9354027..1ad6f1ea 100644 --- a/plugin/secret/external.go +++ b/plugin/secret/external.go @@ -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 secret import ( @@ -11,7 +13,7 @@ import ( "github.com/drone/drone-yaml/yaml" "github.com/drone/drone/core" - droneapi "github.com/drone/drone-go/drone" + "github.com/drone/drone-go/drone" "github.com/drone/drone-go/plugin/secret" ) @@ -102,8 +104,8 @@ func getExternal(manifest *yaml.Manifest, match string) (path, name string, ok b return } -func toRepo(from *core.Repository) droneapi.Repo { - return droneapi.Repo{ +func toRepo(from *core.Repository) drone.Repo { + return drone.Repo{ ID: from.ID, UID: from.UID, UserID: from.UserID, @@ -125,8 +127,8 @@ func toRepo(from *core.Repository) droneapi.Repo { } } -func toBuild(from *core.Build) droneapi.Build { - return droneapi.Build{ +func toBuild(from *core.Build) drone.Build { + return drone.Build{ ID: from.ID, RepoID: from.RepoID, Trigger: from.Trigger, diff --git a/plugin/secret/external_oss.go b/plugin/secret/external_oss.go new file mode 100644 index 00000000..04500f02 --- /dev/null +++ b/plugin/secret/external_oss.go @@ -0,0 +1,34 @@ +// 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 secret + +import ( + "context" + + "github.com/drone/drone/core" +) + +// External returns a no-op registry secret provider. +func External(string, string, bool) core.SecretService { + return new(noop) +} + +type noop struct{} + +func (noop) Find(context.Context, *core.SecretArgs) (*core.Secret, error) { + return nil, nil +} diff --git a/plugin/secret/static.go b/plugin/secret/static.go index b6032e12..b531e44b 100644 --- a/plugin/secret/static.go +++ b/plugin/secret/static.go @@ -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 secret diff --git a/plugin/webhook/webhook.go b/plugin/webhook/webhook.go index 51cea043..6835af08 100644 --- a/plugin/webhook/webhook.go +++ b/plugin/webhook/webhook.go @@ -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 webhook import ( diff --git a/plugin/webhook/webhook_oss.go b/plugin/webhook/webhook_oss.go new file mode 100644 index 00000000..156e9a5a --- /dev/null +++ b/plugin/webhook/webhook_oss.go @@ -0,0 +1,34 @@ +// 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 webhook + +import ( + "context" + + "github.com/drone/drone/core" +) + +// New returns a no-op Webhook sender. +func New([]string, string) core.WebhookSender { + return new(noop) +} + +type noop struct{} + +func (noop) Send(context.Context, *WebhookData) error { + return nil +} diff --git a/plugin/webhook/webhook_test.go b/plugin/webhook/webhook_test.go index d083d101..13b08d89 100644 --- a/plugin/webhook/webhook_test.go +++ b/plugin/webhook/webhook_test.go @@ -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 webhook import ( diff --git a/scheduler/internal/image.go b/scheduler/internal/image.go index 81064497..210aa46d 100644 --- a/scheduler/internal/image.go +++ b/scheduler/internal/image.go @@ -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 internal import ( diff --git a/scheduler/queue/canceller.go b/scheduler/queue/canceller.go index 4df1d89f..458076cd 100644 --- a/scheduler/queue/canceller.go +++ b/scheduler/queue/canceller.go @@ -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 queue diff --git a/scheduler/queue/queue.go b/scheduler/queue/queue.go index 3ab24b5b..6fbf7bb3 100644 --- a/scheduler/queue/queue.go +++ b/scheduler/queue/queue.go @@ -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 queue diff --git a/scheduler/queue/scheduler.go b/scheduler/queue/scheduler.go index bfa584eb..d0a4c9d9 100644 --- a/scheduler/queue/scheduler.go +++ b/scheduler/queue/scheduler.go @@ -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 queue diff --git a/service/license/load.go b/service/license/load.go index 8cf3d66b..0a8aa453 100644 --- a/service/license/load.go +++ b/service/license/load.go @@ -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. // +build !nolimit diff --git a/service/license/load_test.go b/service/license/load_test.go index 23d9098d..f4724147 100644 --- a/service/license/load_test.go +++ b/service/license/load_test.go @@ -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. // +build !nolimit diff --git a/service/license/nolimit.go b/service/license/nolimit.go index 986833b6..8370f236 100644 --- a/service/license/nolimit.go +++ b/service/license/nolimit.go @@ -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. // +build nolimit diff --git a/service/license/service.go b/service/license/service.go index 2987b916..ca4fa001 100644 --- a/service/license/service.go +++ b/service/license/service.go @@ -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 license