Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func init() {

func main() {
app := cli.NewApp()
app.Name = "cloudops-deployment-dockerhub-proxy"
app.Usage = "Listens for requests from dockerhub webhooks and triggers Jenkins pipelines."
app.Name = "cloudops-deployment-proxy"
app.Usage = "Listens for requests from dockerhub and travisci webhooks and triggers Jenkins pipelines."
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "addr, a",
Expand Down Expand Up @@ -54,7 +54,7 @@ func main() {
return cli.NewExitError(err.Error(), 1)
}

handler := proxyservice.NewDockerHubWebhookHandler(
dockerhandler := proxyservice.NewDockerHubWebhookHandler(
proxyservice.NewJenkins(
c.String("jenkins-base-url"),
c.String("jenkins-user"),
Expand All @@ -63,8 +63,15 @@ func main() {
c.StringSlice("valid-namespace")...,
)

travishuandler := proxyservice.NewTravisWebhookHandler(
// TODO Implement me to include a newjenkins service, namespace, and other things?
// newfile proxyservice/travis.go and add handler to handlers.go and add trigger func to jenkins.go
// add tests
)

mux := http.NewServeMux()
mux.Handle("/dockerhub", handler)
mux.Handle("/dockerhub", dockerhandler)
mux.Handle("/travis", githubhandler)
mux.HandleFunc("/__heartbeat__", func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("OK"))
})
Expand Down