Update tool to store output in JSON format in working directory
This commit is contained in:
15
tool.sh
15
tool.sh
@ -1,5 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cd "$PLUGIN_PATH" && \
|
working_dir=$(pwd)
|
||||||
TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN \
|
cd "$PLUGIN_PATH" || exit 1
|
||||||
terraform $PLUGIN_ARGS
|
terraform init
|
||||||
|
if [ "$PLUGIN_AUTO_APPROVE" = "true" ]
|
||||||
|
then
|
||||||
|
auto_approve=" -auto-approve"
|
||||||
|
else
|
||||||
|
auto_approve=""
|
||||||
|
fi
|
||||||
|
TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN terraform apply -input=false"$auto_approve"
|
||||||
|
TF_TOKEN_app_terraform_io=$PLUGIN_API_TOKEN terraform output -json > "$working_dir/terraform_output"
|
||||||
|
cd "$working_dir" || exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user