Skip to content

Commit

Permalink
feat: allowing to set auto-deploy param on app update
Browse files Browse the repository at this point in the history
Ticket: ENG-1710
  • Loading branch information
benjaminch committed Mar 27, 2024
1 parent 917d21a commit eb775c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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")
}

0 comments on commit eb775c2

Please sign in to comment.