summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doBuild.debian.go10
-rw-r--r--doBuild.go25
-rw-r--r--doPublish.go63
-rw-r--r--prepareReleaseNew.go2
4 files changed, 23 insertions, 77 deletions
diff --git a/doBuild.debian.go b/doBuild.debian.go
index 4944907..6906c14 100644
--- a/doBuild.debian.go
+++ b/doBuild.debian.go
@@ -118,13 +118,8 @@ func doBuildDeb(all *gitpb.Repos) (string, error) {
}
me.forge.ConfigRill(16, 16)
- stats := me.forge.RunOnRepos(all, runFromDL)
- for s, stat := range stats {
- if stat.Err != nil {
- return "ERROR WITH buildDeb " + s, stat.Err
- }
- }
- if totalBuilt == 0 {
+ built := me.forge.RunOnRepos(all, runFromDL)
+ if built.Len() == 0 {
if argv.DryRun {
log.Info("")
return "--dry-run TRUE (nothing done)", nil
@@ -143,6 +138,7 @@ func doBuildDeb(all *gitpb.Repos) (string, error) {
return "all .deb built ok", nil
}
+// build a .deb package for a repo
func runFromDL(repo *gitpb.Repo) error {
var err error
cmd := repo.DirtyList
diff --git a/doBuild.go b/doBuild.go
index 2d84dc9..5e6f86a 100644
--- a/doBuild.go
+++ b/doBuild.go
@@ -154,29 +154,14 @@ func doInstall(all *gitpb.Repos) error {
me.forge.ConfigRill(16, 16)
os.Setenv("GO111MODULE", "off")
- stats := me.forge.RunOnRepos(found, doInstallRepo)
+ failed := me.forge.RunOnRepos(found, doInstallRepo)
os.Unsetenv("GO111MODULE")
- failed := gitpb.NewRepos()
- for s, stat := range stats {
- if stat.Err == nil {
- continue
- }
- // log.Info("CRAP. INSTALL FAILED", config.FormatDuration(dur), s, stat.Err)
- msg := "go install FAILED " + s
- log.Info(msg)
- found := me.forge.Repos.FindByFullPath(s)
- if found == nil {
- log.Info("found", found, "'"+s+"'")
- panic("wrong namespace logic. couldn't find repo from stats")
- }
- failed.Append(found)
- }
os.Remove(filepath.Join(env.Get("homedir"), "go/bin/forged"))
if failed.Len() > 0 {
- for r := range failed.IterAll() {
- log.Info("r.Namespace", r.Namespace)
- }
- failed.SortNamespace()
+ // for r := range failed.IterAll() {
+ // log.Info("r.Namespace", r.Namespace)
+ // }
+ // failed.SortNamespace()
footer = failed.PrintForgedTable()
log.Info("TABLE WITH NULLS", footer)
argvpb.BadExit("go install Failed for: "+footer, nil)
diff --git a/doPublish.go b/doPublish.go
index 9ac5ea8..e081b7a 100644
--- a/doPublish.go
+++ b/doPublish.go
@@ -36,6 +36,12 @@ func rillRestore(repo *gitpb.Repo) error {
} else {
_, err = repo.RunQuiet(cmd)
}
+
+ if env.True("--strict") {
+ cmd = []string{"go-mod-clean", "strict"}
+ _, err = repo.RunQuiet(cmd)
+ }
+
if err != nil {
errs := fmt.Sprintf("%v failed (%v)", cmd, err)
return errors.New(errs)
@@ -43,23 +49,28 @@ func rillRestore(repo *gitpb.Repo) error {
return nil
}
+// fuck you prior self. this code is garbage
+// nevermind, I knew that when I wrote it.
+// I'm back now to fix it. Thank you for making it work until I got back here
+// shame you aren't as smart as fabrice. you might have done this on the first go around
+// fine though, you have different talents. Also, Mariam loves you.
func doPublish() error {
initForge()
env.PrintTable()
log.Printf("Running go-mod-clean on (%d) repos. (1 second per hundred)\n", me.forge.Repos.Len())
- restored := me.forge.RunOnReposNew(me.forge.Repos, rillRestore)
+ restored := me.forge.RunOnRepos(me.forge.Repos, rillRestore)
restored = restored.SortActual()
footer := restored.PrintPublishNewTB()
fmt.Printf("restored.len(%d) with errors: %s\n", restored.Len(), footer)
- // publish := me.forge.RunOnReposNewDumb(me.forge.Repos, rePrepareReleaseNew) // doesn't use Rill()
- publish := me.forge.RunOnReposNew(me.forge.Repos, rePrepareReleaseNew)
+ // publish := me.forge.RunOnReposSlow(me.forge.Repos, rePrepareReleaseNew) // doesn't use Rill()
+ publish := me.forge.RunOnRepos(me.forge.Repos, rePrepareReleaseNew)
if publish == nil {
return errors.New("nothing to publish. you actually have to write code first")
}
for repo := range publish.IterAll() {
- err := me.forge.CheckUpdatingGoDeps(repo.GoDeps, publish)
+ err := me.forge.CheckUpdatingGoDeps(repo.GoInfo.GoDeps, publish)
if err != nil {
repo.State = fmt.Sprintf("%s err (%v)\n", repo.Namespace, err)
} else {
@@ -114,50 +125,6 @@ func doPublish() error {
if !env.True("--doit") {
return errors.New("run with --doit to actually try to publish")
}
- // me.forge.RillFuncError(rillPurge)
-
- /*
- saferepo := me.forge.Repos.FindByNamespace("go.wit.com/lib/xgb") // safe to run things here
- if saferepo == nil {
- return log.Errorf("need a safe place to run GO commands from")
- }
- os.Chdir(saferepo.FullPath)
-
- if os.Getenv("GUIRELEASE_REASON") == "" {
- log.Info("$ENV[GUIRELEASE_REASON] was not set")
- reason := fhelp.InputFromUser("set tag message:")
- if reason == "" {
- argvpb.BadExit("merge failed", fmt.Errorf("GUIRELEASE_REASON was blank"))
- }
- os.Setenv("GUIRELEASE_REASON", reason)
- }
-
- var cmd []string
-
- cmd = []string{"forge", "merge", "--all"}
- if _, err := shell.RunRealtimeError(cmd); err != nil {
- argvpb.BadExit("merge failed", nil)
- }
-
- cmd = []string{"forge", "merge", "check"}
- if _, err := shell.RunRealtimeError(cmd); err != nil {
- if _, err := shell.RunVerbose(cmd); err != nil {
- argvpb.BadExit("merge failed", nil)
- }
- }
- // todo: os.Stat() file
- time.Sleep(time.Second)
- me.forge.Repos.Load()
-
- if err := doInstall(me.forge.Repos); err != nil {
- log.Info("doInstall() failed", err)
- argvpb.BadExit("merge failed", nil)
- }
-
- if os.Getenv("GUIRELEASE_REASON") == "" {
- os.Setenv("GUIRELEASE_REASON", "automated")
- }
- */
argvpb.GoodExit("PUBLISH WORKED")
return nil
diff --git a/prepareReleaseNew.go b/prepareReleaseNew.go
index 667f7b1..551b055 100644
--- a/prepareReleaseNew.go
+++ b/prepareReleaseNew.go
@@ -11,8 +11,6 @@ import (
)
func rePrepareReleaseNew(check *gitpb.Repo) error {
- // me.forge.RillFuncError(rillRestore)
-
if me.forge.Config.IsReadOnly(check.GetGoPath()) {
// can't release readonly repos
return nil