summaryrefslogtreecommitdiff
path: root/checkReady.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-30 14:40:41 -0600
committerJeff Carr <[email protected]>2024-01-30 14:40:41 -0600
commita3a1c09005f2092efae0b9704ea415e5df1c196f (patch)
treec7bdd39aaa701bc72d6a432c7b8d53f326196407 /checkReady.go
parentc401c6039988554b084c3e9ea3b1001109ac906f (diff)
more checks
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'checkReady.go')
-rw-r--r--checkReady.go48
1 files changed, 48 insertions, 0 deletions
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
+}