From a3a1c09005f2092efae0b9704ea415e5df1c196f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 30 Jan 2024 14:40:41 -0600 Subject: more checks Signed-off-by: Jeff Carr --- checkReady.go | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 checkReady.go (limited to 'checkReady.go') diff --git a/checkReady.go b/checkReady.go new file mode 100644 index 0000000..11c1fca --- /dev/null +++ b/checkReady.go @@ -0,0 +1,48 @@ +// This is a simple example +package main + +import ( + "go.wit.com/log" +) + +func CheckReady() bool { + if release.current == nil { + log.Info("find the next repo first") + return false + } + goSumS := release.current.getGoSumStatus() + dirtyS := release.current.dirtyLabel.String() + lastS := release.current.status.GetLastTagVersion() + log.Info("repo:", release.current.String(), goSumS, dirtyS, lastS) + + if dirtyS == "ready to tag version" { + log.Info("\trepo is ready", release.current.String(), goSumS, dirtyS, lastS) + } else { + return false + } + + if release.current.status.ReadOnly() { + log.Info("\trepo is read only") + return false + } + + if release.versionS == lastS { + log.Info("\trepo is already done") + return false + } + + if goSumS == "BAD" { + log.Info("\trepo is ready", release.current.String(), goSumS, dirtyS, lastS) + } else { + log.Info("\trepo is ready maybe", release.current.String(), goSumS, dirtyS, lastS) + } + + if release.current.status.CheckDirty() { + log.Info("\trepo is dirty") + return false + } else { + log.Info("\trepo is ready", release.current.String(), goSumS, dirtyS, lastS) + } + + return true +} -- cgit v1.2.3