summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-01 15:16:15 -0600
committerJeff Carr <[email protected]>2024-02-01 15:16:15 -0600
commitad2c989f77fac21e12d17e00998a0ff5e8be1989 (patch)
treef810fdfe023a938a9cf0228bd138417b0b510bdf
parent9c6890134a3fd3b3f95be0044c3744e47b569259 (diff)
updates with golang systems correctly
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--checkReady.go4
-rw-r--r--releaseWindow.go28
-rw-r--r--scan.go5
3 files changed, 33 insertions, 4 deletions
diff --git a/checkReady.go b/checkReady.go
index 0e7ff27..3cef23b 100644
--- a/checkReady.go
+++ b/checkReady.go
@@ -49,7 +49,7 @@ func CheckReady() bool {
}
return true
}
- if goSumS == "UNCHANGED" {
+ if goSumS == "UNRELEASED" {
return true
}
if goSumS == "READY" {
@@ -58,7 +58,7 @@ func CheckReady() bool {
return true
}
if lastS == currentS {
- release.current.setGoSumStatus("UNCHANGED")
+ release.current.setGoSumStatus("UNRELEASED")
}
return true
}
diff --git a/releaseWindow.go b/releaseWindow.go
index 9be9aea..252d3f8 100644
--- a/releaseWindow.go
+++ b/releaseWindow.go
@@ -41,6 +41,10 @@ type releaseStruct struct {
sendVersionB *gui.Node
checkSafeB *gui.Node
whitelist map[string]*repo
+
+ // store myself here. use myself to
+ // do garbage go get tests and other potential junk
+ guireleaser *repo
}
func (w *autoType) Disable() {
@@ -105,6 +109,10 @@ func createReleaseBox(box *gui.Node) {
log.Warn("attempting to release. TODO: recheck go.sum here", release.version.String())
log.Warn("Sleep 10")
log.Sleep(10)
+ case "UNRELEASED":
+ log.Warn("attempting to release. TODO: dig deep on go.sum here", release.version.String())
+ log.Warn("Sleep 10")
+ log.Sleep(10)
default:
log.Warn("what is this?", release.version.String(), release.status.String())
return
@@ -140,14 +148,24 @@ func createReleaseBox(box *gui.Node) {
log.Info("EVERYTHING OK")
release.current.setGoSumStatus("RELEASED")
- os.Unsetenv("GO111MODULE")
gopath := release.current.String()
cmd := []string{"go", "get", "-v", gopath + "@" + release.version.String()}
log.Info("SHOULD RUN cmd HERE to update myself:", cmd)
log.Info("SHOULD RUN cmd HERE:", cmd)
log.Info("SHOULD RUN cmd HERE:", cmd)
- // release.current.status.RunCmd(
+ if release.guireleaser != nil {
+ os.Unsetenv("GO111MODULE")
+ log.Info("TRYING TO SELF UPDATE HERE. cmd =", cmd)
+ err, out := release.guireleaser.status.RunCmd(cmd)
+ if err == nil {
+ log.Info("SELF UPDATE WORKED\n", out)
+ } else {
+ log.Info("SELF UPDATE FAILED err =", err)
+ log.Info("SELF UPDATE FAILED out =", out)
+ return
+ }
+ }
buttonEnable()
} else {
log.Info("SOMETHING FAILED")
@@ -428,6 +446,12 @@ func findNextDirty() bool {
if goSumS == "IGNORE" {
continue
}
+ if goSumS == "UNRELEASED" {
+ if setCurrentRepo(repo, "UNRELEASED", "manually check go.sum") {
+ return true
+ }
+ continue
+ }
if goSumS == "NOT READY" {
if setCurrentRepo(repo, "NOT READY", "manually check go.sum") {
return true
diff --git a/scan.go b/scan.go
index b0233be..2d2f78f 100644
--- a/scan.go
+++ b/scan.go
@@ -74,6 +74,11 @@ func (r *repo) checkSafeGoSumRemake() {
func scanGoSum() {
for _, repo := range me.allrepos {
+ if repo.String() == "go.wit.com/apps/guireleaser" {
+ if release.guireleaser == nil {
+ release.guireleaser = repo
+ }
+ }
latestversion := repo.status.GetLastTagVersion()
if repo.getGoSumStatus() == "BAD" {
continue