diff --git a/.drone.yml b/.drone.yml index 77d39e30..a391db18 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,11 +28,12 @@ pipeline: event: push branch: master - publish: - image: plugins/docker - repo: drone/drone - secrets: [ docker_username, docker_password ] - tag: [ latest, 0.6, 0.6.0, 0.6.0-rc.1 ] + trigger: + image: plugins/downstream + server: https://beta.drone.io + fork: true + secrets: [ downstream_token ] + repositories: drone/drone-enterprise when: branch: master event: push diff --git a/drone/server/server.go b/drone/server/server.go index 398e6093..a2eb5fd4 100644 --- a/drone/server/server.go +++ b/drone/server/server.go @@ -11,8 +11,6 @@ import ( "github.com/cncd/logging" "github.com/cncd/pubsub" - "github.com/cncd/queue" - "github.com/drone/drone/model" "github.com/drone/drone/plugins/registry" "github.com/drone/drone/plugins/secrets" "github.com/drone/drone/plugins/sender" @@ -395,7 +393,7 @@ func setupEvilGlobals(c *cli.Context, v store.Store) { droneserver.Config.Storage.Files = v // services - droneserver.Config.Services.Queue = model.WithTaskStore(queue.New(), v) + droneserver.Config.Services.Queue = setupQueue(c, v) droneserver.Config.Services.Logs = logging.New() droneserver.Config.Services.Pubsub = pubsub.New() droneserver.Config.Services.Pubsub.Create(context.Background(), "topic/events") diff --git a/drone/server/setup.go b/drone/server/setup.go index d35c84b2..03f7938c 100644 --- a/drone/server/setup.go +++ b/drone/server/setup.go @@ -3,6 +3,8 @@ package server import ( + "github.com/cncd/queue" + "github.com/drone/drone/model" "github.com/drone/drone/store" "github.com/drone/drone/store/datastore" @@ -16,7 +18,10 @@ func setupStore(c *cli.Context) store.Store { ) } -func setupQueue(c *cli.Context) {} +func setupQueue(c *cli.Context, s store.Store) queue.Queue { + return model.WithTaskStore(queue.New(), s) +} + func setupPubsub(c *cli.Context) {} func setupStream(c *cli.Command) {} func setupRegistryService(c *cli.Command) {} diff --git a/store/datastore/repos.go b/store/datastore/repos.go index 9302da74..d59421eb 100644 --- a/store/datastore/repos.go +++ b/store/datastore/repos.go @@ -40,8 +40,9 @@ func (db *datastore) GetRepoListOf(listof []*model.RepoLite) ([]*model.Repo, err } func (db *datastore) GetRepoCount() (count int, err error) { - stmt := sql.Lookup(db.driver, "count-repos") - err = meddler.QueryAll(db, &count, stmt) + err = db.QueryRow( + sql.Lookup(db.driver, "count-repos"), + ).Scan(&count) return } diff --git a/store/datastore/users.go b/store/datastore/users.go index 520da0db..ed7ff1fc 100644 --- a/store/datastore/users.go +++ b/store/datastore/users.go @@ -67,8 +67,9 @@ func (db *datastore) GetUserFeedLatest(listof []*model.RepoLite) ([]*model.Feed, } func (db *datastore) GetUserCount() (count int, err error) { - stmt := sql.Lookup(db.driver, "count-users") - err = meddler.QueryAll(db, &count, stmt) + err = db.QueryRow( + sql.Lookup(db.driver, "count-users"), + ).Scan(&count) return }