-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement better release commit
- Loading branch information
1 parent
45a6991
commit 2b0a628
Showing
9 changed files
with
662 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/naveego/bosun/pkg/bosun" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
var releaseCommitCmd = addCommand(releaseCmd, &cobra.Command{ | ||
Use: "commit", | ||
Short: "Commands for merging a release branch back to develop and master.", | ||
SilenceErrors: true, | ||
SilenceUsage: true, | ||
}) | ||
|
||
var releaseCommitPlanCmd = addCommand(releaseCommitCmd, &cobra.Command{ | ||
Use: "plan", | ||
Short: "Plans the commit of the release branch back to master for each app in the release, and the platform repository.", | ||
SilenceErrors: true, | ||
SilenceUsage: true, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
|
||
b := MustGetBosun() | ||
|
||
p, err := b.GetCurrentPlatform() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
committer, err := bosun.NewReleaseCommitter(p, b) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
err = committer.Plan() | ||
|
||
return err | ||
}, | ||
}) | ||
|
||
var releaseCommitShowCmd = addCommand(releaseCommitCmd, &cobra.Command{ | ||
Use: "show", | ||
Short: "Shows the plan the commit of the release branch back to master for each app in the release, and the platform repository.", | ||
SilenceErrors: true, | ||
SilenceUsage: true, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
|
||
b := MustGetBosun() | ||
|
||
p, err := b.GetCurrentPlatform() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
committer, err := bosun.NewReleaseCommitter(p, b) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
plan, err := committer.GetPlan() | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
return printOutput(plan) | ||
}, | ||
}) | ||
|
||
var releaseCommitExecuteCmd = addCommand(releaseCommitCmd, &cobra.Command{ | ||
Use: "execute", | ||
Short: "Merges the release branch back to master for each app in the release, and the platform repository.", | ||
SilenceErrors: true, | ||
SilenceUsage: true, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
viper.BindPFlags(cmd.Flags()) | ||
|
||
b := MustGetBosun() | ||
|
||
p, err := b.GetCurrentPlatform() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
committer, err := bosun.NewReleaseCommitter(p, b) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
|
||
err = committer.Execute() | ||
|
||
return err | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.