feat: push the new tag with --push
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
cd179175f5
commit
9faefd2592
|
@ -17,6 +17,13 @@ import (
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var Push bool
|
||||||
|
var PushFlag = &cli.BoolFlag{
|
||||||
|
Name: "push",
|
||||||
|
Value: false,
|
||||||
|
Destination: &Push,
|
||||||
|
}
|
||||||
|
|
||||||
var Dry bool
|
var Dry bool
|
||||||
var DryFlag = &cli.BoolFlag{
|
var DryFlag = &cli.BoolFlag{
|
||||||
Name: "dry-run",
|
Name: "dry-run",
|
||||||
|
@ -59,6 +66,7 @@ var recipeReleaseCommand = &cli.Command{
|
||||||
PatchFlag,
|
PatchFlag,
|
||||||
MinorFlag,
|
MinorFlag,
|
||||||
MajorFlag,
|
MajorFlag,
|
||||||
|
PushFlag,
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
recipe := internal.ValidateRecipe(c)
|
recipe := internal.ValidateRecipe(c)
|
||||||
|
@ -85,6 +93,12 @@ var recipeReleaseCommand = &cli.Command{
|
||||||
Message: tag,
|
Message: tag,
|
||||||
})*/
|
})*/
|
||||||
logrus.Info(fmt.Sprintf("Created tag %s at %s.", tagstring, head.Hash()))
|
logrus.Info(fmt.Sprintf("Created tag %s at %s.", tagstring, head.Hash()))
|
||||||
|
if Push {
|
||||||
|
if err := repo.Push(&git.PushOptions{}); err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
|
logrus.Info(fmt.Sprintf("Pushed tag %s to remote.", tagstring))
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -164,6 +178,12 @@ var recipeReleaseCommand = &cli.Command{
|
||||||
Message: tag,
|
Message: tag,
|
||||||
})*/
|
})*/
|
||||||
logrus.Info(fmt.Sprintf("Created tag %s at %s.", newTagString, head.Hash()))
|
logrus.Info(fmt.Sprintf("Created tag %s at %s.", newTagString, head.Hash()))
|
||||||
|
if Push {
|
||||||
|
if err := repo.Push(&git.PushOptions{}); err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
|
logrus.Info(fmt.Sprintf("Pushed tag %s to remote.", newTagString))
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue