This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * Extract PostgreSQL credentials from a bound service for use in this PCF app. | |
# ! Your manfiest file must bind the app to an existing PostgreSQL service via 'services'. | |
# @env VCAP_SERVICES - The Cloud Foundry services this app is bound to. This is set automatically for you. | |
# @env POSTGRES_SERVICE - The name of the specific PostgreSQL service to use. This is useful if your app is bound to multiple services. | |
# @env POSTGRES_SERVICE_KEY - The PostgreSQL service vendor key. Defaults to aws-rds-postgres for AWS. | |
# ? Reference: https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES | |
function getDBCredentials { | |
echo "[INFO] Extracting DB credentials from VCAP_SERVICES..."; | |
# Assume it is an AWS RDS PostgreSQL service if not specified. |