-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtask
More file actions
executable file
·31 lines (23 loc) · 866 Bytes
/
task
File metadata and controls
executable file
·31 lines (23 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set -eux
root_dir=${PWD}
VARIABLE_DIR=${root_dir}/bbl-state/${VARS_DIR}
cd bbl-state/$BBL_STATE_DIR
set +x
echo "Initializing Terraform..."
pushd "./terraform"
terraform init
popd
echo "Grabbing public ips"
echo "Outputting public ips to ${VARIABLE_DIR}/external-public-ip-vars.yml"
bbl outputs | grep public_ip > ${VARIABLE_DIR}/external-public-ip-vars.yml
echo "Grabbing DB HOST"
DB_HOST=$(bbl outputs | grep db_host | awk '{print $2}')
echo "Outputting db host to ${VARIABLE_DIR}/external-db-host-vars.yml"
rm -f ${VARIABLE_DIR}/external-db-host-vars.yml
for key in {cc,uaa,bbs,routing_api,policy_server,silk_controller,locket,credhub}; do
echo "external_${key}_database_address: ${DB_HOST}" >> ${VARIABLE_DIR}/external-db-host-vars.yml;
done
set -x
cd $root_dir
cp -r bbl-state/. updated-bbl-state