Add option for speculative plans

This commit is contained in:
2023-10-31 23:23:41 +01:00
parent 834825ff53
commit a9bff7a23a

View File

@ -9,6 +9,12 @@ then
else else
auto_approve="" auto_approve=""
fi fi
TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN terraform apply -input=false"$auto_approve" if [ "$PLUGIN_SPECULATIVE" = "true" ]
then
command="plan"
else
command="apply"
fi
TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN terraform "$command" -input=false"$auto_approve"
TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN terraform output -json > "$working_dir/terraform_output" TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN terraform output -json > "$working_dir/terraform_output"
cd "$working_dir" || exit 1 cd "$working_dir" || exit 1