summaryrefslogtreecommitdiff
path: root/makePrepareRelease.go
blob: 645ea57a9f83995f284bf211db67f7428d7f09e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main

import (
	"os"

	"go.wit.com/log"
)

func makePrepareRelease() {
	me.Disable()
	me.release.box.Disable()
	defer me.Enable()
	loop := me.repos.View.ReposSortByName()
	for loop.Scan() {
		repo := loop.Repo()
		// check if the package dependancies changed, if so, re-publish
		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())
		}

		// see if there is a new version
		master := repo.Status.GetMasterVersion()
		lastTag := repo.Status.LastTag()
		if master == lastTag {
			repo.Status.SetTargetVersion(master)
		} else {
			repo.Status.IncrementRevisionVersion("Nov 2024 test")
			target := repo.Status.GetTargetVersion()
			check.SetTargetVersion(target)
		}
	}
	findNext()
	if setAllBranchesToMaster() {
		// if it succeeds, disable this button
		me.setBranchesToMasterB.Disable()
		me.release.box.Enable()
		PrintReleaseReport("", "")
	} else {
		log.Info("setAllBranchesToMaster() failed")
	}
}