feat: version arguments, local tag lookups & release notes

See:
* coop-cloud/organising#441
* coop-cloud/organising#204
* coop-cloud/organising#493
This commit is contained in:
2023-09-23 09:15:27 +02:00
parent 82631d9ab1
commit 510ce66570
4 changed files with 118 additions and 42 deletions

View File

@ -32,17 +32,9 @@ func NewVersionOverview(app config.App, currentVersion, newVersion, releaseNotes
table.Append([]string{server, app.Recipe, deployConfig, app.Domain, currentVersion, newVersion})
table.Render()
if releaseNotes == "" {
var err error
releaseNotes, err = GetReleaseNotes(app.Recipe, newVersion)
if err != nil {
return err
}
}
if releaseNotes != "" && newVersion != "" {
fmt.Println()
fmt.Println(fmt.Sprintf("%s release notes:\n\n%s", newVersion, releaseNotes))
fmt.Print(releaseNotes)
} else {
logrus.Warnf("no release notes available for %s", newVersion)
}
@ -80,7 +72,8 @@ func GetReleaseNotes(recipeName, version string) (string, error) {
if err != nil {
return "", err
}
return string(releaseNotes), nil
withTitle := fmt.Sprintf("%s release notes:\n%s", version, string(releaseNotes))
return withTitle, nil
}
return "", nil