From eb775c279bcfa5d6b5539d4d35831367fa34a068 Mon Sep 17 00:00:00 2001 From: BenjaminCh Date: Wed, 27 Mar 2024 15:52:02 +0100 Subject: [PATCH] feat: allowing to set auto-deploy param on app update Ticket: ENG-1710 --- cmd/application.go | 1 + cmd/application_update.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cmd/application.go b/cmd/application.go index 3db47002..00f007af 100644 --- a/cmd/application.go +++ b/cmd/application.go @@ -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", diff --git a/cmd/application_update.go b/cmd/application_update.go index 14523475..602af56b 100644 --- a/cmd/application_update.go +++ b/cmd/application_update.go @@ -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 { @@ -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") }