fix: add compose.yml before commiting with recipe release; reset parts of tag according to semver when releasing #106

Merged
decentral1se merged 1 commits from knoflook/abra:recipe-release into main 2021-10-05 14:58:37 +00:00
+11 -1
View File
@@ -36,7 +36,7 @@ var DryFlag = &cli.BoolFlag{
var CommitMessage string
var CommitMessageFlag = &cli.StringFlag{
Name: "commit-message",
Usage: "commit message",
Usage: "commit message. Implies --commit",
Aliases: []string{"cm"},
Destination: &CommitMessage,
}
@@ -44,6 +44,7 @@ var CommitMessageFlag = &cli.StringFlag{
var Commit bool
var CommitFlag = &cli.BoolFlag{
Name: "commit",
Usage: "add compose.yml to staging area and commit changes",
Value: false,
Aliases: []string{"c"},
Destination: &Commit,
@@ -118,6 +119,12 @@ or a rollback of an app.
}
survey.AskOne(prompt, &CommitMessage)
}
err = commitWorktree.AddGlob("compose.**yml")
knoflook marked this conversation as resolved Outdated
Outdated
Review

You might want to glob for compose.**.yml here since the recipes can have multiple compose files?

You might want to glob for `compose.**.yml` here since the recipes can have multiple compose files?
Outdated
Review

yess, I'm also a bit worried about annotated vs unannotated tags because the stupid git library allows listing either one or the other and uses different return formats for them (https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.TagObjects and https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.Tags)

yess, I'm also a bit worried about annotated vs unannotated tags because the stupid git library allows listing either one or the other and uses different return formats for them (https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.TagObjects and https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.Tags)
if err != nil {
logrus.Fatal(err)
}
logrus.Debug("staged compose.**yml for commit")
_, err = commitWorktree.Commit(CommitMessage, &git.CommitOptions{})
if err != nil {
logrus.Fatal(err)
@@ -214,12 +221,15 @@ or a rollback of an app.
if err != nil {
logrus.Fatal(err)
}
newTag.Patch = "0"
newTag.Minor = strconv.Itoa(now + 1)
} else if Major {
now, err := strconv.Atoi(newTag.Major)
if err != nil {
logrus.Fatal(err)
}
newTag.Patch = "0"
newTag.Minor = "0"
newTag.Major = strconv.Itoa(now + 1)
}
newTagString = newTag.String()