Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allowing to set auto-deploy param on app update #267

Merged
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
1 change: 1 addition & 0 deletions cmd/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var applicationCommitId string
var applicationBranch string
var targetApplicationName string
var applicationCustomDomain string
var applicationAutoDeploy bool

var applicationCmd = &cobra.Command{
Use: "application",
Expand Down
5 changes: 5 additions & 0 deletions cmd/application_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ var applicationUpdateCmd = &cobra.Command{
req.GitRepository.Branch = &applicationBranch
}

if cmd.Flags().Changed("auto-deploy") {
req.AutoDeploy = *qovery.NewNullableBool(&applicationAutoDeploy)
}

_, _, err = client.ApplicationMainCallsAPI.EditApplication(context.Background(), application.Id).ApplicationEditRequest(req).Execute()

if err != nil {
Expand All @@ -107,6 +111,7 @@ func init() {
applicationUpdateCmd.Flags().StringVarP(&environmentName, "environment", "", "", "Environment Name")
applicationUpdateCmd.Flags().StringVarP(&applicationName, "application", "n", "", "Application Name")
applicationUpdateCmd.Flags().StringVarP(&applicationBranch, "branch", "", "", "Application Git Branch")
applicationUpdateCmd.Flags().BoolVarP(&applicationAutoDeploy, "auto-deploy", "", false, "Application Auto Deploy")

_ = applicationUpdateCmd.MarkFlagRequired("application")
}
Loading