Closed msuterski closed 6 years ago
@msuterski Do you have thoughts on how you would implement this?
I was thinking of making some changes that may require a major release. This would include:
validate
key and default it to true
plan
key default to true
apply
key and default it to true
This would then keep current default behavior to apply if changes found. It would also run all 3 commands by default. Breaking change would be that a "dry run" would require apply: false
to be set.
So then the following would validate
, plan
and apply
pipeline:
terraform:
image: jmccann/drone-terraform:latest
The following would "dry run" and validate
and plan
only:
pipeline:
terraform:
image: jmccann/drone-terraform:latest
apply: false
The following would "validate" only:
pipeline:
terraform:
image: jmccann/drone-terraform:latest
apply: false
plan: false
@jmccann I think it should work. I'm a bit worried about apply
defaulting to true
. It is not now (semi-directly) and might cause problems. The other two are harmless.
I was thinking about exposing something like a command
that would be one of them (or more in the future), but that would make it even more backwards incompatible.
I'll think about your suggestion more and maybe try it out ... I think I may like it better. 😛
This should be addressed with merge of #58
Terraform has the
validate
command that can be run to simply validate the syntax of.tf
file.It would be great to be able to execute it without executing any of the other commands like plan, apply or destroy.