mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 19:48:33 +00:00
adding -upgrade to init cmd
This commit is contained in:
@@ -16,12 +16,12 @@ func (i *InitStepRunner) Run(ctx models.ProjectCommandContext, extraArgs []strin
|
||||
if ctx.ProjectConfig != nil && ctx.ProjectConfig.TerraformVersion != nil {
|
||||
tfVersion = ctx.ProjectConfig.TerraformVersion
|
||||
}
|
||||
terraformInitCmd := append([]string{"init", "-input=false", "-no-color"}, extraArgs...)
|
||||
terraformInitCmd := append([]string{"init", "-input=false", "-no-color", "-upgrade"}, extraArgs...)
|
||||
|
||||
// If we're running < 0.9 we have to use `terraform get` instead of `init`.
|
||||
if MustConstraint("< 0.9.0").Check(tfVersion) {
|
||||
ctx.Log.Info("running terraform version %s so will use `get` instead of `init`", tfVersion)
|
||||
terraformInitCmd = append([]string{"get", "-no-color"}, extraArgs...)
|
||||
terraformInitCmd = append([]string{"get", "-no-color", "-upgrade"}, extraArgs...)
|
||||
}
|
||||
|
||||
out, err := i.TerraformExecutor.RunCommandWithVersion(ctx.Log, path, terraformInitCmd, tfVersion, ctx.Workspace)
|
||||
|
||||
Reference in New Issue
Block a user