forked from toolshed/abra
fix: ensure tags & commits are pushed
This commit is contained in:
@ -230,7 +230,7 @@ func btoi(b bool) int {
|
||||
func getTagCreateOptions() (git.CreateTagOptions, error) {
|
||||
if internal.TagMessage == "" && !internal.NoInput {
|
||||
prompt := &survey.Input{
|
||||
Message: "git tag message",
|
||||
Message: "git tag message?",
|
||||
Default: "chore: publish new release",
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ func commitRelease(recipe recipe.Recipe) error {
|
||||
|
||||
if internal.CommitMessage == "" && !internal.NoInput && internal.Commit {
|
||||
prompt := &survey.Input{
|
||||
Message: "commit message",
|
||||
Message: "git commit message?",
|
||||
Default: "chore: publish new version",
|
||||
}
|
||||
if err := survey.AskOne(prompt, &internal.CommitMessage); err != nil {
|
||||
@ -270,7 +270,7 @@ func commitRelease(recipe recipe.Recipe) error {
|
||||
|
||||
if internal.Commit {
|
||||
repoPath := path.Join(config.APPS_DIR, recipe.Name)
|
||||
if err := gitPkg.Commit(repoPath, "compose.**yml", internal.CommitMessage, internal.Dry, false); err != nil {
|
||||
if err := gitPkg.Commit(repoPath, "compose.**yml", internal.CommitMessage, internal.Dry); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -322,6 +322,10 @@ func pushRelease(tagString string, repo *git.Repository) error {
|
||||
}
|
||||
|
||||
if internal.Push {
|
||||
if err := repo.Push(&git.PushOptions{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tagRef := fmt.Sprintf("+refs/tags/%s:refs/tags/%s", tagString, tagString)
|
||||
pushOpts := &git.PushOptions{
|
||||
RefSpecs: []configPkg.RefSpec{
|
||||
@ -331,6 +335,7 @@ func pushRelease(tagString string, repo *git.Repository) error {
|
||||
if err := repo.Push(pushOpts); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
logrus.Info(fmt.Sprintf("pushed tag %s to remote", tagString))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user