diff options
Diffstat (limited to 'makePrepareRelease.go')
| -rw-r--r-- | makePrepareRelease.go | 94 |
1 files changed, 85 insertions, 9 deletions
diff --git a/makePrepareRelease.go b/makePrepareRelease.go index 645ea57..9832116 100644 --- a/makePrepareRelease.go +++ b/makePrepareRelease.go @@ -10,23 +10,80 @@ func makePrepareRelease() { me.Disable() me.release.box.Disable() defer me.Enable() + + // first reset all the target versions back to the current version + // incase there was a partial release process running that + // did not finish loop := me.repos.View.ReposSortByName() for loop.Scan() { repo := loop.Repo() - // check if the package dependancies changed, if so, re-publish + + // find the gitpb.Repo check := me.forge.Repos.FindByGoPath(repo.GoPath()) if check == nil { log.Info("boo, you didn't git clone", repo.GoPath()) os.Exit(-1) } - if me.forge.FinalGoDepsCheck(check) { - log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) - repo.Status.IncrementRevisionVersion("godeps changed") - target := repo.Status.GetTargetVersion() - check.SetTargetVersion(target) - continue - } else { - log.Printf("dependancies have not changed for %s\n", check.GetGoPath()) + + // set the target version to the current master version + curver := repo.Status.GetMasterVersion() + check.SetTargetVersion(curver) + } + + // on startup, run fixGoDeps() on every go.sum that didn't match + if argv.Fix { + loop = me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() + // find the gitpb.Repo + check := me.forge.Repos.FindByGoPath(repo.GoPath()) + if check == nil { + log.Info("boo, you didn't git clone", repo.GoPath()) + os.Exit(-1) + } + if !me.forge.FinalGoDepsCheckOk(check) { + fixGodeps(repo) + } + } + } + + // now figure out what to release and increment the version + loop = me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() + // find the gitpb.Repo + check := me.forge.Repos.FindByGoPath(repo.GoPath()) + if check == nil { + log.Info("boo, you didn't git clone", repo.GoPath()) + os.Exit(-1) + } + + // if check.GetGoPath() == "go.wit.com/dev/alexflint/arg" { + if check.GetGoPath() == "go.wit.com/gui" { + log.Info("arg", check.GetGoPath(), check.GetMasterVersion(), check.GoPrimitive) + if me.forge.FinalGoDepsCheckOk(check) { + log.Info("arg final check true", check.GetGoPath()) + } else { + log.Info("arg final check false", check.GetGoPath()) + os.Exit(-1) + } + // see if there is a new version + master := repo.Status.GetMasterVersion() + lastTag := repo.Status.LastTag() + log.Info("arg ", master, lastTag) + // os.Exit(-1) + } + // check if the package dependancies changed, if so, re-publish + if !check.GoPrimitive { + if me.forge.FinalGoDepsCheckOk(check) { + log.Printf("go.sum is perfect! %s\n", check.GetGoPath()) + } else { + log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath()) + repo.Status.IncrementRevisionVersion("godeps changed") + target := repo.Status.GetTargetVersion() + check.SetTargetVersion(target) + continue + } } // see if there is a new version @@ -39,6 +96,25 @@ func makePrepareRelease() { target := repo.Status.GetTargetVersion() check.SetTargetVersion(target) } + // if check.GetGoPath() == "go.wit.com/dev/alexflint/arg" { + // if check.GetGoPath() == "go.wit.com/gui" { + if check.GetGoPath() == "go.wit.com/dev/davecgh/spew" { + log.Info(repo.StandardReleaseHeader()) + log.Info(me.forge.StandardReleaseHeader(check, repo.State())) + log.Info("arg", check.GetGoPath(), check.GetMasterVersion(), check.GoPrimitive) + if me.forge.FinalGoDepsCheckOk(check) { + log.Info("go.sum is perfect") + } else { + log.Info("go.sum check false") + } + // see if there is a new version + master := repo.Status.GetMasterVersion() + lastTag := repo.Status.LastTag() + log.Info("arg ", master, lastTag) + if master != lastTag { + os.Exit(-1) + } + } } findNext() if setAllBranchesToMaster() { |
