Add plan with a fail-on-diff option.
- on exception, exit script with exit code > 0
This commit is contained in:
parent
51f07bbc78
commit
cf0a195efb
1 changed files with 3 additions and 1 deletions
|
@ -148,11 +148,13 @@ class DevopsTerraformBuild(DevopsBuild):
|
|||
|
||||
def plan_fail_on_diff(self):
|
||||
tf = self.init_client()
|
||||
tf.plan(detailed_exitcode=IsFlagged, capture_output=False, raise_on_error=False,
|
||||
return_code = tf.plan(detailed_exitcode=IsFlagged, capture_output=False, raise_on_error=False,
|
||||
var=self.project_vars(),
|
||||
var_file=self.additional_tfvar_files)
|
||||
self.post_build()
|
||||
self.print_terraform_command(tf)
|
||||
if (return_code > 0):
|
||||
sys.exit(return_code)
|
||||
|
||||
|
||||
def apply(self, auto_approve=False):
|
||||
|
|
Loading…
Reference in a new issue