pr: move config to project
This commit is contained in:
@@ -21,6 +21,7 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"net/url"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
@@ -78,7 +79,13 @@ func main() {
|
||||
log.Fatalln("No configuratio file specified. Aborting")
|
||||
}
|
||||
|
||||
configs, err := common.ReadWorkflowConfigsFile(*workflowConfig)
|
||||
gitea := common.AllocateGiteaTransport(*giteaHost)
|
||||
config, err := common.ReadConfigFile(*workflowConfig)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
configs, err := common.ResolveWorkflowConfigs(gitea, config)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -104,8 +111,6 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
gitea := common.AllocateGiteaTransport(*giteaHost)
|
||||
|
||||
if CurrentUser, err = gitea.GetCurrentUser(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -130,7 +135,7 @@ func main() {
|
||||
var defs common.ListenDefinitions
|
||||
|
||||
defs.GitAuthor = GitAuthor
|
||||
defs.RabbitURL = *rabbitUrl
|
||||
defs.RabbitURL, _ = url.Parse(*rabbitUrl)
|
||||
|
||||
defs.Handlers = make(map[string]common.RequestProcessor)
|
||||
defs.Handlers[common.RequestType_PR] = req
|
||||
@@ -138,5 +143,5 @@ func main() {
|
||||
defs.Handlers[common.RequestType_PRReviewAccepted] = req
|
||||
defs.Handlers[common.RequestType_PRReviewRejected] = req
|
||||
|
||||
log.Fatal(common.ProcessRabbitMQEvents(defs, orgs))
|
||||
log.Fatal(defs.ProcessRabbitMQEvents())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user