guireleaser/mergeAll.go

72 lines
1.7 KiB
Go

package main
import (
"go.wit.com/log"
)
func mergeAllDevelToMain() bool {
log.Info("merge all here")
loop := me.repos.View.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
if repo.ReadOnly() {
log.Info("skipping readonly", repo.Name(), repo.State())
continue
}
if repo.State() != "merge to main" {
log.Info("skipping. not merge to main", repo.Name(), repo.State())
continue
}
if repo.CheckDirty() {
log.Info("skipping dirty", repo.Name(), repo.State())
continue
}
log.Info("found", repo.Name(), repo.State())
repo.NewScan()
if repo.Status.MergeDevelToMaster() {
log.Warn("THINGS SEEM OK fullAutomation() returned true.")
} else {
log.Warn("last repo:", repo.Name())
log.Warn("THINGS FAILED fullAutomation() returned false")
return false
}
repo.NewScan()
}
log.Warn("EVERYTHING WORKED")
return true
}
func mergeAllUserToDevel() bool {
log.Info("merge all here")
loop := me.repos.View.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
if repo.ReadOnly() {
log.Info("skipping readonly", repo.Name(), repo.State())
continue
}
if repo.State() != "merge to devel" {
log.Info("skipping. not merge to devel", repo.Name(), repo.State())
continue
}
if repo.CheckDirty() {
log.Info("skipping dirty", repo.Name(), repo.State())
continue
}
log.Info("found", repo.Name(), repo.State())
repo.NewScan()
if repo.Status.MergeUserToDevel() {
log.Warn("THINGS SEEM OK fullAutomation() returned true.")
} else {
log.Warn("last repo:", repo.Status.Path())
log.Warn("THINGS FAILED fullAutomation() returned false")
return false
}
repo.NewScan()
}
log.Warn("EVERYTHING WORKED")
return true
}