2024-07-07 21:08:41 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"src.opensuse.org/autogits/common"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
GitAuthor = "GiteaBot - Obs Staging"
|
2024-07-16 17:05:43 +02:00
|
|
|
ObsBuildBot = "/obsbuild"
|
2024-07-07 21:08:41 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var GiteaToken string
|
|
|
|
|
|
|
|
|
2024-07-16 17:05:43 +02:00
|
|
|
func main() {
|
|
|
|
var defs common.ListenDefinitions
|
2024-07-07 21:08:41 +02:00
|
|
|
|
2024-07-16 17:05:43 +02:00
|
|
|
defs.Url = ObsBuildBot
|
|
|
|
defs.GitAuthor = GitAuthor
|
2024-07-07 21:08:41 +02:00
|
|
|
|
2024-07-16 17:05:43 +02:00
|
|
|
defs.Handlers = make(map[string]common.RequestProcessor)
|
|
|
|
defs.Handlers[common.RequestType_PR] = processPullRequest
|
|
|
|
defs.Handlers[common.RequestType_PR_sync] = processPullRequest
|
2024-07-07 21:08:41 +02:00
|
|
|
|
2024-07-16 17:05:43 +02:00
|
|
|
common.RequireGiteaSecretToken()
|
|
|
|
common.RequireObsSecretToken()
|
|
|
|
common.StartServerWithAddress(defs, ListenAddr)
|
2024-07-07 21:08:41 +02:00
|
|
|
}
|