Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16

require (
bunnyshell.com/dev v0.7.2
bunnyshell.com/sdk v0.20.3
bunnyshell.com/sdk v0.20.4
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/MakeNowJust/heredoc v1.0.0
github.com/avast/retry-go/v4 v4.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bunnyshell.com/dev v0.7.2 h1:fa0ZvnIAXLVJINCJqo7uenjHmjPrlHmY18Zc8ypo/6E=
bunnyshell.com/dev v0.7.2/go.mod h1:+Xk46UXX9AW0nHrFMdO/IwpUPfALrck1/qI+LIXsDmE=
bunnyshell.com/sdk v0.20.3 h1:Kd2s/fhkMrn6Jqp9UmnXfNu12Oiwg+hgNSNBOIBYPH8=
bunnyshell.com/sdk v0.20.3/go.mod h1:RfgfUzZ4WHZGCkToUfu2/hoQS6XsQc8IdPTVAlpS138=
bunnyshell.com/sdk v0.20.4 h1:Na2e4xKdtbnZZ/+ACpjzM7fvBFriJWC3bVgNFSmqcJs=
bunnyshell.com/sdk v0.20.4/go.mod h1:RfgfUzZ4WHZGCkToUfu2/hoQS6XsQc8IdPTVAlpS138=
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
Expand Down
12 changes: 11 additions & 1 deletion pkg/api/environment/action_delete.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package environment

import (
"github.com/spf13/pflag"
"net/http"

"bunnyshell.com/cli/pkg/api"
Expand All @@ -11,14 +12,23 @@ import (

type DeleteOptions struct {
common.ActionOptions

QueueIfSomethingInProgress bool
}

func NewDeleteOptions(id string) *DeleteOptions {
return &DeleteOptions{
ActionOptions: *common.NewActionOptions(id),
ActionOptions: *common.NewActionOptions(id),
QueueIfSomethingInProgress: false,
}
}

func (options *DeleteOptions) UpdateFlagSet(flags *pflag.FlagSet) {
options.ActionOptions.UpdateFlagSet(flags)

//flags.BoolVar(&options.QueueIfSomethingInProgress, "queue", options.QueueIfSomethingInProgress, "Queue the delete pipeline if another operation is in progress now")
}

func Delete(options *DeleteOptions) (*sdk.EventItem, error) {
model, resp, err := DeleteRaw(options)
if err != nil {
Expand Down
25 changes: 15 additions & 10 deletions pkg/api/environment/action_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,32 @@ import (
)

const (
IncludedDepdendenciesNone string = "none"
IncludedDepdendenciesAll string = "all"
IncludedDepdendenciesMissing string = "missing"
IncludedDependenciesNone string = "none"
IncludedDependenciesAll string = "all"
IncludedDependenciesMissing string = "missing"
)

type DeployOptions struct {
common.PartialActionOptions

IncludedDepdendencies string
IncludedDependencies string

QueueIfSomethingInProgress bool
}

func NewDeployOptions(id string) *DeployOptions {
return &DeployOptions{
PartialActionOptions: *common.NewPartialActionOptions(id),
IncludedDepdendencies: IncludedDepdendenciesNone,
PartialActionOptions: *common.NewPartialActionOptions(id),
IncludedDependencies: IncludedDependenciesNone,
QueueIfSomethingInProgress: false,
}
}

func (options *DeployOptions) UpdateFlagSet(flags *pflag.FlagSet) {
options.PartialActionOptions.UpdateFlagSet(flags)

flags.StringVar(&options.IncludedDepdendencies, "included-dependencies", options.IncludedDepdendencies, "Include dependencies in the deployment (none, all, missing)")
flags.StringVar(&options.IncludedDependencies, "included-dependencies", options.IncludedDependencies, "Include dependencies in the deployment (none, all, missing)")
flags.BoolVar(&options.QueueIfSomethingInProgress, "queue", options.QueueIfSomethingInProgress, "Queue the deploy pipeline if another operation is in progress now")
}

func Deploy(options *DeployOptions) (*sdk.EventItem, error) {
Expand All @@ -54,9 +58,10 @@ func DeployRaw(options *DeployOptions) (*sdk.EventItem, *http.Response, error) {

request := lib.GetAPIFromProfile(profile).EnvironmentAPI.EnvironmentDeploy(ctx, options.ID).
EnvironmentPartialDeployAction(sdk.EnvironmentPartialDeployAction{
IsPartial: &isPartialAction,
Components: options.GetActionComponents(),
IncludedDependencies: &options.IncludedDepdendencies,
IsPartial: &isPartialAction,
Components: options.GetActionComponents(),
IncludedDependencies: &options.IncludedDependencies,
QueueIfSomethingInProgress: &options.QueueIfSomethingInProgress,
})

return request.Execute()
Expand Down
5 changes: 3 additions & 2 deletions pkg/formatter/stylish.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,12 @@ func tabulateEnvironmentItem(w *tabwriter.Writer, item *sdk.EnvironmentItem) {
fmt.Fprintf(w, "%v\t %v\n", "Create Ephemeral On PR", item.GetHasEphemeralCreateOnPr())
fmt.Fprintf(w, "%v\t %v\n", "Destroy Ephemeral On PR Close", item.GetHasEphemeralDestroyOnPrClose())
fmt.Fprintf(w, "%v\t %v\n", "Auto Deploy Ephemeral", item.GetHasEphemeralAutoDeploy())
fmt.Fprintf(w, "%v\t %v\n", "Termination Protection", item.GetHasTerminationProtection())

if item.GetHasEphemeralBranchWhitelist() {
fmt.Fprintf(w, "%v\t %v\n", "Ephemeral Branch Whitelist", item.GetEphemeralBranchWhitelistRegex())
}

fmt.Fprintf(w, "%v\t %v\n", "Termination Protection", item.GetHasTerminationProtection())
fmt.Fprintf(w, "%v\t %v\n", "Auto Update", item.GetHasAutoUpdate())
}
}

Expand Down
Loading