File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ set -o errexit
1717set -o nounset
1818set -o pipefail
1919
20- # for Prow we use the provided AZURE_CREDENTIALS file
20+ # for Prow we use the provided AZURE_CREDENTIALS file.
21+ # the file is expected to be in toml format.
2122if [[ -n " ${AZURE_CREDENTIALS:- } " ]]; then
22- export AZURE_SUBSCRIPTION_ID=" $( cat ${AZURE_CREDENTIALS} | grep SubscriptionID | cut -d ' =' -f 2) "
23- export AZURE_TENANT_ID=" $( cat ${AZURE_CREDENTIALS} | grep TenantID | cut -d ' =' -f 2) "
24- export AZURE_CLIENT_ID=" $( cat ${AZURE_CREDENTIALS} | grep ClientID | cut -d ' =' -f 2) "
25- # password might contain an '=' sign so we need to get all the fields after the first '='
26- export AZURE_CLIENT_SECRET=" $( cat ${AZURE_CREDENTIALS} | grep ClientSecret | cut -d ' =' -f 2-) "
23+ export AZURE_SUBSCRIPTION_ID=" $( cat ${AZURE_CREDENTIALS} | grep -E -o ' SubscriptionID[[:blank:]]*=[[:blank:]]*"[^[:space:]"]+"' | cut -d ' "' -f 2) "
24+ export AZURE_TENANT_ID=" $( cat ${AZURE_CREDENTIALS} | grep -E -o ' TenantID[[:blank:]]*=[[:blank:]]*"[^[:space:]"]+"' | cut -d ' "' -f 2) "
25+ export AZURE_CLIENT_ID=" $( cat ${AZURE_CREDENTIALS} | grep -E -o ' ClientID[[:blank:]]*=[[:blank:]]*"[^[:space:]"]+"' | cut -d ' "' -f 2) "
26+ export AZURE_CLIENT_SECRET=" $( cat ${AZURE_CREDENTIALS} | grep -E -o ' ClientSecret[[:blank:]]*=[[:blank:]]*"[^[:space:]"]+"' | cut -d ' "' -f 2) "
2727fi
2828
2929# Verify the required Environment Variables are present.
You can’t perform that action at this time.
0 commit comments