Skip to content

Commit e4c3475

Browse files
committed
call "terraform init" before "bbl lbs"/"bbl outputs"
1 parent 38535b0 commit e4c3475

File tree

3 files changed

+10
-2
lines changed
  • tasks
    • generate-external-db-vars-file
    • generate-external-ip-db-vars
    • manage-gcp-dns

3 files changed

+10
-2
lines changed

tasks/generate-external-db-vars-file/task

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
set -euo pipefail
44

55
pushd "bbl-state/${BBL_STATE_DIR}"
6+
echo "Initializing Terraform..."
7+
pushd "./terraform"
8+
terraform init
9+
popd
610
echo "Retrieving DB name from bbl outputs..."
711
DB_NAME=$(bbl outputs | grep db_name | awk '{print $2}')
812
popd

tasks/generate-external-ip-db-vars/task

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ VARIABLE_DIR=${root_dir}/bbl-state/${VARS_DIR}
88
cd bbl-state/$BBL_STATE_DIR
99
set +x
1010

11+
echo "Initializing Terraform..."
12+
pushd "./terraform"
13+
terraform init
14+
popd
1115
echo "Grabbing public ips"
1216
echo "Outputting public ips to ${VARIABLE_DIR}/external-public-ip-vars.yml"
1317
bbl outputs | grep public_ip > ${VARIABLE_DIR}/external-public-ip-vars.yml

tasks/manage-gcp-dns/task

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ function main() {
2626
local dns_servers
2727
dns_servers=()
2828
if [[ -d "${ROOT}/bbl-state" ]]; then
29-
pushd "${ROOT}/bbl-state/${BBL_STATE_DIR}/terraform" > /dev/null
29+
pushd "${ROOT}/bbl-state/${BBL_STATE_DIR}/terraform"
3030
terraform init
31-
popd > /dev/null
31+
popd
3232
for dns_server in $(bbl --state-dir "${ROOT}/bbl-state/${BBL_STATE_DIR}" lbs --json | jq -r ".cf_system_domain_dns_servers[] | ."); do
3333
dns_servers+=("${dns_server}")
3434
done

0 commit comments

Comments
 (0)