spiegel/main.go

39 lines
718 B
Go
Raw Normal View History

2024-04-04 01:12:42 +02:00
package main
import (
"os"
"os/signal"
"syscall"
"time"
2024-04-08 03:56:21 +02:00
"git.gnous.eu/ada/spiegel/internal/config"
"git.gnous.eu/ada/spiegel/internal/cron"
"git.gnous.eu/ada/spiegel/internal/git"
2024-04-04 01:12:42 +02:00
"github.com/sirupsen/logrus"
)
func main() {
initConfig, err := config.LoadToml("config.example.toml")
if err != nil {
logrus.Fatal(err)
}
err = initConfig.Verify()
if err != nil {
logrus.Fatal(err)
}
2024-04-04 01:12:42 +02:00
initConfig.Log.Init()
logrus.Info("Config loaded")
logrus.Debug("Config: ", initConfig)
git.StartClone(initConfig.RepoList)
cron.Launch(time.Minute, initConfig.RepoList)
quitSignal := make(chan os.Signal, 1)
signal.Notify(quitSignal, syscall.SIGINT, syscall.SIGTERM)
<-quitSignal
logrus.Info("Bye!")
2024-04-04 01:12:42 +02:00
}