-
Notifications
You must be signed in to change notification settings - Fork 446
/
pin_repos.go
30 lines (25 loc) · 924 Bytes
/
pin_repos.go
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
package main
import (
"github.com/solo-io/gloo/pkg/version"
"github.com/solo-io/go-utils/log"
"github.com/solo-io/go-utils/versionutils"
"github.com/solo-io/go-utils/versionutils/dep"
"github.com/solo-io/go-utils/versionutils/git"
)
func main() {
tomlTree, err := versionutils.ParseFullToml()
fatalCheck(err, "parsing error")
soloKitVersion, err := versionutils.GetDependencyVersionInfo(version.SoloKitPkg, tomlTree)
fatalCheck(err, "getting solo-kit version")
targetVersion := soloKitVersion.Version
if soloKitVersion.Type == dep.Version {
// If the toml version attribute is "version", we are looking for a tag
targetVersion = git.AppendTagPrefix(targetVersion)
}
fatalCheck(git.PinDependencyVersion("../solo-kit", targetVersion), "consider git fetching in solo-kit repo")
}
func fatalCheck(err error, msg string) {
if err != nil {
log.Fatalf("Error (%v) unable to pin repos!: %v", msg, err)
}
}