mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 13:21:10 +00:00
removed unused and broken packages
This commit is contained in:
parent
73d04b0398
commit
39251a85a9
6 changed files with 1 additions and 109 deletions
|
@ -18,8 +18,6 @@ import (
|
||||||
"github.com/cncd/logging"
|
"github.com/cncd/logging"
|
||||||
"github.com/cncd/pipeline/pipeline/rpc/proto"
|
"github.com/cncd/pipeline/pipeline/rpc/proto"
|
||||||
"github.com/cncd/pubsub"
|
"github.com/cncd/pubsub"
|
||||||
"github.com/drone/drone/plugins/registry"
|
|
||||||
"github.com/drone/drone/plugins/secrets"
|
|
||||||
"github.com/drone/drone/plugins/sender"
|
"github.com/drone/drone/plugins/sender"
|
||||||
"github.com/drone/drone/remote"
|
"github.com/drone/drone/remote"
|
||||||
"github.com/drone/drone/router"
|
"github.com/drone/drone/router"
|
||||||
|
@ -503,12 +501,6 @@ func setupEvilGlobals(c *cli.Context, v store.Store, r remote.Remote) {
|
||||||
droneserver.Config.Services.Senders = sender.New(v, v)
|
droneserver.Config.Services.Senders = sender.New(v, v)
|
||||||
droneserver.Config.Services.Environ = setupEnvironService(c, v)
|
droneserver.Config.Services.Environ = setupEnvironService(c, v)
|
||||||
|
|
||||||
if endpoint := c.String("registry-service"); endpoint != "" {
|
|
||||||
droneserver.Config.Services.Registries = registry.NewRemote(endpoint)
|
|
||||||
}
|
|
||||||
if endpoint := c.String("secret-service"); endpoint != "" {
|
|
||||||
droneserver.Config.Services.Secrets = secrets.NewRemote(endpoint)
|
|
||||||
}
|
|
||||||
if endpoint := c.String("gating-service"); endpoint != "" {
|
if endpoint := c.String("gating-service"); endpoint != "" {
|
||||||
droneserver.Config.Services.Senders = sender.NewRemote(endpoint)
|
droneserver.Config.Services.Senders = sender.NewRemote(endpoint)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
package registry
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/drone/drone/model"
|
|
||||||
"github.com/drone/drone/plugins/internal"
|
|
||||||
)
|
|
||||||
|
|
||||||
type plugin struct {
|
|
||||||
endpoint string
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewRemote returns a new remote registry service.
|
|
||||||
func NewRemote(endpoint string) model.RegistryService {
|
|
||||||
return &plugin{endpoint}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) RegistryFind(repo *model.Repo, name string) (*model.Registry, error) {
|
|
||||||
path := fmt.Sprintf("%s/registry/%s/%s/%s", p.endpoint, repo.Owner, repo.Name, name)
|
|
||||||
out := new(model.Registry)
|
|
||||||
err := internal.Send("GET", path, nil, out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) RegistryList(repo *model.Repo) ([]*model.Registry, error) {
|
|
||||||
path := fmt.Sprintf("%s/registry/%s/%s", p.endpoint, repo.Owner, repo.Name)
|
|
||||||
out := []*model.Registry{}
|
|
||||||
err := internal.Send("GET", path, nil, out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) RegistryCreate(repo *model.Repo, in *model.Registry) error {
|
|
||||||
path := fmt.Sprintf("%s/registry/%s/%s", p.endpoint, repo.Owner, repo.Name)
|
|
||||||
return internal.Send("PATCH", path, in, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) RegistryUpdate(repo *model.Repo, in *model.Registry) error {
|
|
||||||
path := fmt.Sprintf("%s/registry/%s/%s/%s", p.endpoint, repo.Owner, repo.Name, in.Address)
|
|
||||||
return internal.Send("PATCH", path, in, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) RegistryDelete(repo *model.Repo, name string) error {
|
|
||||||
path := fmt.Sprintf("%s/registry/%s/%s/%s", p.endpoint, repo.Owner, repo.Name, name)
|
|
||||||
return internal.Send("DELETE", path, nil, nil)
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
package registry
|
|
|
@ -1,53 +0,0 @@
|
||||||
package secrets
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/drone/drone/model"
|
|
||||||
"github.com/drone/drone/plugins/internal"
|
|
||||||
)
|
|
||||||
|
|
||||||
type plugin struct {
|
|
||||||
endpoint string
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewRemote returns a new remote secret service.
|
|
||||||
func NewRemote(endpoint string) model.SecretService {
|
|
||||||
return &plugin{endpoint}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) SecretFind(repo *model.Repo, name string) (*model.Secret, error) {
|
|
||||||
path := fmt.Sprintf("%s/secrets/%s/%s/%s", p.endpoint, repo.Owner, repo.Name, name)
|
|
||||||
out := new(model.Secret)
|
|
||||||
err := internal.Send("GET", path, nil, out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) SecretList(repo *model.Repo) ([]*model.Secret, error) {
|
|
||||||
path := fmt.Sprintf("%s/secrets/%s/%s", p.endpoint, repo.Owner, repo.Name)
|
|
||||||
out := []*model.Secret{}
|
|
||||||
err := internal.Send("GET", path, nil, out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) SecretListBuild(repo *model.Repo, build *model.Build) ([]*model.Secret, error) {
|
|
||||||
path := fmt.Sprintf("%s/secrets/%s/%s/%d", p.endpoint, repo.Owner, repo.Name, build.Number)
|
|
||||||
out := []*model.Secret{}
|
|
||||||
err := internal.Send("GET", path, nil, out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) SecretCreate(repo *model.Repo, in *model.Secret) error {
|
|
||||||
path := fmt.Sprintf("%s/secrets/%s/%s", p.endpoint, repo.Owner, repo.Name)
|
|
||||||
return internal.Send("POST", path, in, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) SecretUpdate(repo *model.Repo, in *model.Secret) error {
|
|
||||||
path := fmt.Sprintf("%s/secrets/%s/%s/%s", p.endpoint, repo.Owner, repo.Name, in.Name)
|
|
||||||
return internal.Send("PATCH", path, in, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *plugin) SecretDelete(repo *model.Repo, name string) error {
|
|
||||||
path := fmt.Sprintf("%s/secrets/%s/%s/%s", p.endpoint, repo.Owner, repo.Name, name)
|
|
||||||
return internal.Send("DELETE", path, nil, nil)
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
package secrets
|
|
|
@ -210,6 +210,7 @@ func EventStreamSSE(c *gin.Context) {
|
||||||
c.Header("Content-Type", "text/event-stream")
|
c.Header("Content-Type", "text/event-stream")
|
||||||
c.Header("Cache-Control", "no-cache")
|
c.Header("Cache-Control", "no-cache")
|
||||||
c.Header("Connection", "keep-alive")
|
c.Header("Connection", "keep-alive")
|
||||||
|
c.Header("X-Accel-Buffering", "no")
|
||||||
|
|
||||||
rw := c.Writer
|
rw := c.Writer
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue