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

Setup gcloud credentials when running interactively within docker #28

Closed
adrienthebo opened this issue Oct 31, 2018 · 1 comment
Closed

Comments

@adrienthebo
Copy link
Contributor

adrienthebo commented Oct 31, 2018

Pushing this out to a separate issue so that we can get #20 merged.

When using make docker_run, we should source the test config so that CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE is set in the shell environment.

diff --git i/Makefile w/Makefile
index 6e16919..73ff8bf 100644
--- i/Makefile
+++ w/Makefile
@@ -119,7 +119,7 @@ docker_run:
        docker run --rm -it \
                -v $(CURDIR):/cftk/workdir \
                ${DOCKER_IMAGE_KITCHEN_TERRAFORM}:${DOCKER_TAG_KITCHEN_TERRAFORM} \
-               /bin/bash
+               /bin/bash --rcfile ${TEST_CONFIG_FILE_LOCATION}

 .PHONY: docker_create
 docker_create: docker_build_terraform docker_build_kitchen_terraform

Alternately, we can set the environment variables within the tests, as such:

ENV['CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE'] = File.expand_path(
  File.join("../..", credentials_path),
  __FILE__)

Though this feels somewhat brittle.

@adrienthebo adrienthebo changed the title Source test source config before Setup gcloud credentials when running interactively within docker Oct 31, 2018
@Jberlinsky
Copy link
Contributor

This has been addressed for a while, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants