Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6204d01

Browse files
feat: allow customising notify url for branches (#4303)
fix: allow customising notify url for branches
1 parent 0f33436 commit 6204d01

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎cmd/branches.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var (
3535
}
3636
persistent bool
3737
withData bool
38+
notifyURL string
3839

3940
branchCreateCmd = &cobra.Command{
4041
Use: "create [name]",
@@ -59,6 +60,9 @@ var (
5960
if cmdFlags.Changed("with-data") {
6061
body.WithData = &withData
6162
}
63+
if cmdFlags.Changed("notify-url") {
64+
body.NotifyUrl = &notifyURL
65+
}
6266
return create.Run(cmd.Context(), body, afero.NewOsFs())
6367
},
6468
}
@@ -124,6 +128,9 @@ var (
124128
if cmdFlags.Changed("status") {
125129
body.Status = (*api.UpdateBranchBodyStatus)(&branchStatus.Value)
126130
}
131+
if cmdFlags.Changed("notify-url") {
132+
body.NotifyUrl = &notifyURL
133+
}
127134
ctx := cmd.Context()
128135
fsys := afero.NewOsFs()
129136
if len(args) > 0 {
@@ -203,6 +210,7 @@ func init() {
203210
createFlags.Var(&size, "size", "Select a desired instance size for the branch database.")
204211
createFlags.BoolVar(&persistent, "persistent", false, "Whether to create a persistent branch.")
205212
createFlags.BoolVar(&withData, "with-data", false, "Whether to clone production data to the branch database.")
213+
createFlags.StringVar(&notifyURL, "notify-url", "", "URL to notify when branch is active healthy.")
206214
branchesCmd.AddCommand(branchCreateCmd)
207215
branchesCmd.AddCommand(branchListCmd)
208216
branchesCmd.AddCommand(branchGetCmd)
@@ -211,6 +219,7 @@ func init() {
211219
updateFlags.StringVar(&gitBranch, "git-branch", "", "Change the associated git branch.")
212220
updateFlags.BoolVar(&persistent, "persistent", false, "Switch between ephemeral and persistent branch.")
213221
updateFlags.Var(&branchStatus, "status", "Override the current branch status.")
222+
updateFlags.StringVar(&notifyURL, "notify-url", "", "URL to notify when branch is active healthy.")
214223
branchesCmd.AddCommand(branchUpdateCmd)
215224
branchesCmd.AddCommand(branchDeleteCmd)
216225
branchesCmd.AddCommand(branchDisableCmd)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /