src/server/pps/server/githook/githook.go
func RunGitHookServer(address string, etcdAddress string, etcdPrefix string) error {
	c, err := client.NewFromAddress(address)
	if err != nil {
		return err
	}
	etcdClient, err := etcd.New(etcd.Config{
		Endpoints:   []string{etcdAddress},
		DialOptions: client.DefaultDialOptions(),
	})
	if err != nil {
		return err
	}
	hook, err := github.New()
	if err != nil {
		return err
	}
	s := &gitHookServer{
		hook,
		c,
		etcdClient,
		ppsdb.Pipelines(etcdClient, etcdPrefix),
	}
	return http.ListenAndServe(fmt.Sprintf(":%d", GitHookPort), s)
}
func RunGitHookServer(address string, etcdAddress string, etcdPrefix string) error {
	c, err := client.NewFromAddress(address)
	if err != nil {
		return err
	}
	etcdClient, err := etcd.New(etcd.Config{
		Endpoints:   []string{etcdAddress},
		DialOptions: client.DefaultDialOptions(),
	})
	if err != nil {
		return err
	}
	hook, err := github.New()
	if err != nil {
		return err
	}
	s := &gitHookServer{
		hook,
		c,
		etcdClient,
		ppsdb.Pipelines(etcdClient, etcdPrefix),
	}
	return http.ListenAndServe(fmt.Sprintf(":%d", GitHookPort), s)
}
func RunGitHookServer ( address string , etcdAddress string , etcdPrefix string ) error { c , err := client . NewFromAddress ( address ) if err != nil { return err } etcdClient , err := etcd . New ( etcd . Config { Endpoints : [ ] string { etcdAddress } , DialOptions : client . DefaultDialOptions ( ) , } ) if err != nil { return err } hook , err := github . New ( ) if err != nil { return err } s := & gitHookServer { hook , c , etcdClient , ppsdb . Pipelines ( etcdClient , etcdPrefix ) , } return http . ListenAndServe ( fmt . Sprintf ( " " , GitHookPort ) , s ) }
// RunGitHookServer starts the webhook server
RunGitHookServer starts the webhook server