37 Star 411 Fork 76

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
driver.go 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
phli 提交于 2018-09-19 16:48 . add bitbucket support in pipeline
package hooks
import (
"net/http"
"github.com/rancher/rancher/pkg/pipeline/hooks/drivers"
"github.com/rancher/types/config"
)
var Drivers map[string]Driver
type Driver interface {
Execute(req *http.Request) (int, error)
}
func RegisterDrivers(Management *config.ScaledContext) {
pipelineLister := Management.Project.Pipelines("").Controller().Lister()
pipelineExecutions := Management.Project.PipelineExecutions("")
sourceCodeCredentials := Management.Project.SourceCodeCredentials("")
sourceCodeCredentialLister := Management.Project.SourceCodeCredentials("").Controller().Lister()
Drivers = map[string]Driver{}
Drivers[drivers.GithubWebhookHeader] = drivers.GithubDriver{
PipelineLister: pipelineLister,
PipelineExecutions: pipelineExecutions,
SourceCodeCredentials: sourceCodeCredentials,
SourceCodeCredentialLister: sourceCodeCredentialLister,
}
Drivers[drivers.GitlabWebhookHeader] = drivers.GitlabDriver{
PipelineLister: pipelineLister,
PipelineExecutions: pipelineExecutions,
SourceCodeCredentials: sourceCodeCredentials,
SourceCodeCredentialLister: sourceCodeCredentialLister,
}
Drivers[drivers.BitbucketCloudWebhookHeader] = drivers.BitbucketCloudDriver{
PipelineLister: pipelineLister,
PipelineExecutions: pipelineExecutions,
SourceCodeCredentials: sourceCodeCredentials,
SourceCodeCredentialLister: sourceCodeCredentialLister,
}
Drivers[drivers.BitbucketServerWebhookHeader] = drivers.BitbucketServerDriver{
PipelineLister: pipelineLister,
PipelineExecutions: pipelineExecutions,
SourceCodeCredentials: sourceCodeCredentials,
SourceCodeCredentialLister: sourceCodeCredentialLister,
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.4-rc22

搜索帮助

0d507c66 1850385 C8b1a773 1850385