Upload tools
This commit is contained in:
24
trefresh
Executable file
24
trefresh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Pick tfvars file
|
||||
TFVAR_COUNT=$( find . -type f -name "*.tfvars" | wc -l )
|
||||
if (( TFVAR_COUNT <= 0 )); then
|
||||
printf "No tfvars file found.\n"
|
||||
exit 1
|
||||
fi
|
||||
printf "${TFVAR_COUNT} tfvar files found. Pick the number.\n"
|
||||
FILELIST_OUTPUT=$(find . -type f -name "*.tfvars")
|
||||
printf "${FILELIST_OUTPUT}\n" | nl
|
||||
read -p "Pick file number (1): " TFVAR_PICK
|
||||
if (( TFVAR_PICK > 0 )) && (( TFVAR_PICK <= TFVAR_COUNT )); then
|
||||
:
|
||||
else
|
||||
printf "Pick is invalid\n" && exit 1
|
||||
fi
|
||||
|
||||
# Get picked file
|
||||
TFVAR_PICK_FILE=$( printf "${FILELIST_OUTPUT}\n" | head -n "${TFVAR_PICK}" | tail -1 )
|
||||
|
||||
terraform plan -refresh-only -var-file="${TFVAR_PICK_FILE}"
|
Reference in New Issue
Block a user