This commit is contained in:
2024-08-26 17:07:52 +02:00
parent 0473ef7c37
commit 3df22a72bb
5 changed files with 38 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ Areas of responsibility
* on package removal, removes the submodule
2. Assumes:
* _ObsPrj = project git
* config.GitProjectName == project name (default: _ObsPrj)
* Other repositories == packages (similar to OBS project)

View File

@@ -1,7 +1,9 @@
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
@@ -43,7 +45,7 @@ func processPushAction(h *common.RequestHandler) error {
action := h.Request.Data.(common.PushRequest)
if action.Repository.Name == common.DefaultGitPrj {
h.Log("push to %s -- ignoring", common.DefaultGitPrj)
h.StdLogger.Printf("push to %s -- ignoringi\n", common.DefaultGitPrj)
return nil
}
@@ -63,11 +65,19 @@ func processPushAction(h *common.RequestHandler) error {
}
}
h.Log("push of refs not on the main branch. ignoring.")
h.StdLogger.Println("push of refs not on the main branch. ignoring.")
return nil
}
func main() {
workflowConfig := flag.String("config", "", "Repository and workflow definition file")
flag.Parse()
configs, err := common.ReadWorkflowConfigsFile(*workflowConfig)
if err != nil {
log.Fatalf("Error reading config file. err: %v", err)
}
var defs common.ListenDefinitions
defs.Url = "prjgit-updater"
@@ -78,5 +88,5 @@ func main() {
defs.Handlers[common.RequestType_Repository] = processRepositoryAction
common.RequireGiteaSecretToken()
common.StartServer(defs)
common.StartServer(defs, configs)
}