@@ -13,21 +13,25 @@ finish() {
1313setup_environment () {
1414 local tmpfile
1515 tmpfile=" $( mktemp) "
16- echo " ${SERVICE_ACCOUNT_JSON} " > " ${tmpfile} "
16+
17+ echo " $GOOGLE_APPLICATION_CREDENTIALS " > " ${tmpfile} "
1718
1819 # Terraform and most other tools respect GOOGLE_CREDENTIALS
19- export GOOGLE_CREDENTIALS=" ${SERVICE_ACCOUNT_JSON} "
20+ export GOOGLE_CREDENTIALS=" $GOOGLE_APPLICATION_CREDENTIALS "
21+
2022 # gcloud variables
21- export CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=" ${tmpfile} "
2223 export CLOUDSDK_CORE_PROJECT=" ${PROJECT_ID} "
2324 export GOOGLE_APPLICATION_CREDENTIALS=" ${tmpfile} "
25+ gcloud auth activate-service-account --key-file=" ${tmpfile} "
26+ gcloud compute networks list --format=json
2427
2528 # Terraform input variables
2629 export TF_VAR_project_id=" ${PROJECT_ID} "
2730 TF_VAR_random_string_for_testing=" ${RANDOM_STRING_FOR_TESTING:- $(LC_ALL=C tr -dc ' a-z0-9' < / dev/ urandom | fold -w 5 | head -n 1)} "
2831 export TF_VAR_random_string_for_testing
2932
30- gcloud auth activate-service-account --key-file " $GOOGLE_APPLICATION_CREDENTIALS "
33+ # Setup auth for service account
34+ gcloud auth activate-service-account --key-file=" ${tmpfile} "
3135}
3236
3337main () {
@@ -38,9 +42,9 @@ main() {
3842
3943 # Setup environment
4044 setup_environment
45+
4146 set -x
4247 # Execute the test lifecycle
43- bundle install --path vendor
4448 bundle exec kitchen create
4549 bundle exec kitchen converge -c 4
4650 bundle exec kitchen verify
0 commit comments