fix: add compose.yml before commiting with recipe release; reset parts of tag according to semver when releasing
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
knoflook 2021-10-05 16:06:17 +02:00
parent 3cd2399cca
commit 1cb5e3509d
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C

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")
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()