periodicator/main.go

33 lines
587 B
Go
Raw Normal View History

2021-09-26 10:30:51 +05:00
package main
import (
"flag"
"fmt"
2021-09-26 10:30:51 +05:00
"log"
"os"
2021-09-26 10:30:51 +05:00
"go.dev.pztrn.name/periodicator/internal/config"
"go.dev.pztrn.name/periodicator/internal/gitlab"
"go.dev.pztrn.name/periodicator/internal/tasks"
)
var showVersion = flag.Bool("version", false, "Show version information and exit")
2021-09-26 10:30:51 +05:00
func main() {
flag.Parse()
if *showVersion {
// nolint:forbidigo
fmt.Println(config.Version)
os.Exit(0)
}
log.Println("Starting periodic tasks creator, version " + config.Version + "...")
2021-09-26 10:30:51 +05:00
cfg := config.Parse()
c := gitlab.NewGitlabClient(&cfg.Gitlab)
tasks.Process(c, cfg.Tasks)
}