mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 19:15:37 +00:00
fix: init tf in subdirectory
This commit is contained in:
parent
e7f8d706b2
commit
a7be0ed5cc
@ -6,14 +6,15 @@ BUCKET_NAME_PART_1="t2"
|
|||||||
BUCKET_NAME_PART_2="global"
|
BUCKET_NAME_PART_2="global"
|
||||||
BUCKET_NAME_PART_3="terraformstate"
|
BUCKET_NAME_PART_3="terraformstate"
|
||||||
|
|
||||||
WORKFLOW_FILE=".github/workflows/terraform.yml"
|
PROJECT_ROOT=$(git rev-parse --show-toplevel)
|
||||||
|
WORKFLOW_FILE="${PROJECT_ROOT}/.github/workflows/terraform.yml"
|
||||||
|
|
||||||
if [ ! -f $WORKFLOW_FILE ]; then
|
if [ ! -f "$WORKFLOW_FILE" ]; then
|
||||||
WORKFLOW_FILE=".github/workflows/apply.yml"
|
WORKFLOW_FILE="${PROJECT_ROOT}/.github/workflows/apply.yml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AWS_ACCOUNT_NUMBER=$(
|
AWS_ACCOUNT_NUMBER=$(
|
||||||
awk '/aws_account_number: .*/ {print $2}' $WORKFLOW_FILE | # Grab account number
|
awk '/aws_account_number: .*/ {print $2}' "$WORKFLOW_FILE" | # Grab account number
|
||||||
echo "$(
|
echo "$(
|
||||||
read -r s
|
read -r s
|
||||||
s=${s//\'/}
|
s=${s//\'/}
|
||||||
@ -23,7 +24,7 @@ AWS_ACCOUNT_NUMBER=$(
|
|||||||
|
|
||||||
if [ -z "${AWS_ACCOUNT_NUMBER}" ]; then
|
if [ -z "${AWS_ACCOUNT_NUMBER}" ]; then
|
||||||
AWS_ACCOUNT_NUMBER=$(
|
AWS_ACCOUNT_NUMBER=$(
|
||||||
awk '/AWS_ACCOUNT_NUMBER: .*/ {print $2}' $WORKFLOW_FILE | # Grab account number
|
awk '/AWS_ACCOUNT_NUMBER: .*/ {print $2}' "$WORKFLOW_FILE" | # Grab account number
|
||||||
echo "$(
|
echo "$(
|
||||||
read -r s
|
read -r s
|
||||||
s=${s//\'/}
|
s=${s//\'/}
|
||||||
|
Loading…
Reference in New Issue
Block a user