Skip to content

Commit

Permalink
Rename dockerhub handler in preperation for suppport for other handle…
Browse files Browse the repository at this point in the history
…rs. (#19)

Co-authored-by: Jeremiah Orem <[email protected]>
  • Loading branch information
tomprince and oremj authored Mar 23, 2020
1 parent bd013b8 commit 6e2c7a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ func main() {
return cli.NewExitError(err.Error(), 1)
}

handler := proxyservice.NewDockerHubWebhookHandler(
proxyservice.NewJenkins(
c.String("jenkins-base-url"),
c.String("jenkins-user"),
c.String("jenkins-password"),
),
jenkins := proxyservice.NewJenkins(
c.String("jenkins-base-url"),
c.String("jenkins-user"),
c.String("jenkins-password"),
)

dockerhubHandler := proxyservice.NewDockerHubWebhookHandler(
jenkins,
c.StringSlice("valid-namespace")...,
)

mux := http.NewServeMux()
mux.Handle("/dockerhub", handler)
mux.Handle("/dockerhub", dockerhubHandler)
mux.HandleFunc("/__heartbeat__", func(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("OK"))
})
Expand Down
File renamed without changes.

0 comments on commit 6e2c7a9

Please sign in to comment.