Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call "terraform init" before "bbl lbs" / "bbl outputs" #205

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tasks/generate-external-db-vars-file/task
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
set -euo pipefail

pushd "bbl-state/${BBL_STATE_DIR}"
echo "Initializing Terraform..."
pushd "./terraform"
terraform init
popd
echo "Retrieving DB name from bbl outputs..."
DB_NAME=$(bbl outputs | grep db_name | awk '{print $2}')
popd
Expand Down
4 changes: 4 additions & 0 deletions tasks/generate-external-ip-db-vars/task
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ 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
Expand Down
3 changes: 3 additions & 0 deletions tasks/manage-gcp-dns/task
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ function main() {
local dns_servers
dns_servers=()
if [[ -d "${ROOT}/bbl-state" ]]; then
pushd "${ROOT}/bbl-state/${BBL_STATE_DIR}/terraform"
terraform init
popd
for dns_server in $(bbl --state-dir "${ROOT}/bbl-state/${BBL_STATE_DIR}" lbs --json | jq -r ".cf_system_domain_dns_servers[] | ."); do
dns_servers+=("${dns_server}")
done
Expand Down
3 changes: 2 additions & 1 deletion tasks/manage-gcp-dns/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ platform: linux
image_resource:
type: docker-image
source:
repository: cloudfoundry/cf-deployment-concourse-tasks
repository: appruntimedeployments/bbl-deployment
tag: v9.0.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


inputs:
- name: runtime-ci
Expand Down