Michal Knapcok
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
13 additions and
0 deletions
-
DOCS.md
-
main.go
-
plugin.go
|
|
@ -272,3 +272,6 @@ tf_data_dir |
|
|
|
|
|
|
|
disable_refresh |
|
|
|
: (default: `false`) - whether or not to disable refreshing state before `plan` and `apply` commands. |
|
|
|
|
|
|
|
detailed_exitcode |
|
|
|
: (default: `false`) - whether or not to use flag `-detailed-exitcode` with `plan` command. |
|
|
|
|
|
@ -119,6 +119,11 @@ func main() { |
|
|
|
Usage: "whether or not to disable refreshing state before `plan` and `apply` commands", |
|
|
|
EnvVar: "PLUGIN_DISABLE_REFRESH", |
|
|
|
}, |
|
|
|
cli.BoolFlag{ |
|
|
|
Name: "detailed_exitcode", |
|
|
|
Usage: "whether or not to use flag `-detailed-exitcode` with `plan` command", |
|
|
|
EnvVar: "PLUGIN_DETAILED_EXITCODE", |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
if err := app.Run(os.Args); err != nil { |
|
|
@ -169,6 +174,7 @@ func run(c *cli.Context) error { |
|
|
|
VarFiles: c.StringSlice("var_files"), |
|
|
|
TerraformDataDir: c.String("tf_data_dir"), |
|
|
|
DisableRefresh: c.Bool("disable_refresh"), |
|
|
|
DetailedExitcode: c.Bool("detailed_exitcode"), |
|
|
|
}, |
|
|
|
Netrc: Netrc{ |
|
|
|
Login: c.String("netrc.username"), |
|
|
|
|
|
@ -35,6 +35,7 @@ type ( |
|
|
|
VarFiles []string |
|
|
|
TerraformDataDir string |
|
|
|
DisableRefresh bool |
|
|
|
DetailedExitcode bool |
|
|
|
} |
|
|
|
|
|
|
|
// Netrc is credentials for cloning
|
|
|
@ -325,6 +326,9 @@ func tfPlan(config Config, destroy bool) *exec.Cmd { |
|
|
|
if config.DisableRefresh { |
|
|
|
args = append(args, "-refresh=false") |
|
|
|
} |
|
|
|
if config.DetailedExitcode { |
|
|
|
args = append(args, "-detailed-exitcode") |
|
|
|
} |
|
|
|
return exec.Command( |
|
|
|
"terraform", |
|
|
|
args..., |
|
|
|