mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 07:19:20 +01:00
feat(terraform): auto approve and plan
This commit is contained in:
parent
79008d1458
commit
f608c7805d
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user