From deb2c79c2fec33a8eb4be7d7b7a8012d1ae76906 Mon Sep 17 00:00:00 2001 From: Nurahmadie Date: Thu, 27 Mar 2014 18:19:36 +0700 Subject: [PATCH] Stub for gitlab integration --- Makefile | 1 + cmd/droned/drone.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index a7882d6c..deb64cd6 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ deps: #go get github.com/dotcloud/docker/pkg/term go get github.com/drone/go-github/github go get github.com/drone/go-bitbucket/bitbucket + go get github.com/plouc/go-gitlab-client go get github.com/GeertJohan/go.rice go get github.com/GeertJohan/go.rice/rice go get github.com/go-sql-driver/mysql diff --git a/cmd/droned/drone.go b/cmd/droned/drone.go index 93dfa9c6..4c8d552f 100644 --- a/cmd/droned/drone.go +++ b/cmd/droned/drone.go @@ -16,6 +16,7 @@ import ( "github.com/drone/drone/pkg/channel" "github.com/drone/drone/pkg/database" "github.com/drone/drone/pkg/handler" + "github.com/drone/drone/pkg/handler/gitlab" "github.com/drone/drone/pkg/queue" ) @@ -135,6 +136,10 @@ func setupHandlers() { m.Post("/new/github.com", handler.UserHandler(handler.RepoCreateGithub)) m.Get("/new/github.com", handler.UserHandler(handler.RepoAdd)) + // handlers for setting up your GitLab repository + m.Post("/new/gitlab", handler.UserHandler(gitlab.RepoCreate)) + m.Get("/new/gitlab", handler.UserHandler(gitlab.RepoAdd)) + // handlers for linking your GitHub account m.Get("/auth/login/github", handler.UserHandler(handler.LinkGithub)) @@ -178,6 +183,9 @@ func setupHandlers() { // handlers for GitHub post-commit hooks m.Post("/hook/github.com", handler.ErrorHandler(hookHandler.Hook)) + // handlers for GitLab post-commit hooks + m.Post("/hook/gitlab", handler.ErrorHandler(gitlab.Hook)) + // handlers for first-time installation m.Get("/install", handler.ErrorHandler(handler.Install)) m.Post("/install", handler.ErrorHandler(handler.InstallPost))