feat(terraform): auto approve and plan

This commit is contained in:
Denis Gukov 2024-11-24 15:35:26 +05:00
parent 79008d1458
commit f608c7805d

View File

@ -154,13 +154,20 @@ func (t *TerraformApp) Run(args LocalAppRunningArgs) error {
return err
}
if t.noChanges {
params := args.TaskParams.(db.TerraformTaskParams)
if t.noChanges || params.Plan {
t.Logger.SetStatus(task_logger.TaskSuccessStatus)
return nil
}
t.Logger.SetStatus(task_logger.TaskWaitingConfirmation)
if params.AutoApprove {
t.Logger.SetStatus(task_logger.TaskRunningStatus)
return t.Apply(args.CliArgs, args.EnvironmentVars, args.Inputs, args.Callback)
}
for {
time.Sleep(time.Second * 3)
if t.reader.result != nil {