albatros/bin/ci.go

24 lines
464 B
Go
Raw Permalink Normal View History

2023-04-17 09:25:26 +00:00
package main
import (
2023-05-03 08:52:34 +00:00
"log"
"net/http"
2023-04-17 09:25:26 +00:00
2023-05-03 08:52:34 +00:00
"git.deuxfleurs.fr/deuxfleurs/albatros/pkg"
2023-04-17 09:25:26 +00:00
)
func main() {
config := pkg.BuildConfig()
cluster := pkg.NewCluster(&config)
// init webserver
http.Handle("/hook", pkg.HookHandler{&config, &cluster})
http.Handle("/build", pkg.BuildHandler{&config, &cluster})
// launch
log.Println("Albatros listen on :8080")
if err := http.ListenAndServe(":8080", nil); err != nil {
log.Fatal("Can't start HTTP server")
}
}