Merge pull request #173 from GSA/cf-cli-8

Tweak tail & jq usage to parse cf-cli@8 output
This commit is contained in:
Ryan Ahearn
2023-01-27 15:33:08 -05:00
committed by GitHub

View File

@@ -18,9 +18,16 @@ Options:
-o <ORG NAME>: configure the organization to act on. Default: $org
Notes:
OrgManager is required for terraform to create <env>-egress spaces
* OrgManager is required for terraform to create <env>-egress spaces
* Requires cf-cli@8
"
cf_version=`cf --version | cut -d " " -f 3`
if [[ $cf_version != 8.* ]]; then
echo "$usage"
exit 1
fi
set -e
set -o pipefail
@@ -67,7 +74,7 @@ cf create-service cloud-gov-service-account $role $service 1>&2
cf create-service-key $service service-account-key 1>&2
# output service key to stdout in secrets.auto.tfvars format
creds=`cf service-key $service service-account-key | tail -n 4`
creds=`cf service-key $service service-account-key | tail -n +2 | jq '.credentials'`
username=`echo $creds | jq -r '.username'`
password=`echo $creds | jq -r '.password'`