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

Read GOOGLE_CREDENTIALS during startup, not app compilation #5

Closed
wants to merge 1 commit into from
Closed

Conversation

sineraves
Copy link

@sineraves sineraves commented Oct 30, 2019

This pull request escapes the reference to the GOOGLE_CREDENTIALS environment variable when creating the $BUILD_DIR/.profile.d/google-credentials.sh script, so the script ends up containing:

echo ${GOOGLE_CREDENTIALS} > /app/google-credentials.json

This variable is then read during startup when the profile.d script runs and its current contents written to /app/google-credentials.json. (Prior to this change it was being read during compilation, and not with the suggested approach of going via $ENV_DIR).

Tested against heroku-18 stack.

@sineraves
Copy link
Author

We've since added the echo ${GOOGLE_CREDENTIALS} > /app/google-credentials.json line to a .profile file in our repository.

It still reads the credentials from the $GOOGLE_CREDENTIALS environment variable, but removes the need for using a Buildpack.

I'll leave this PR up in case it's useful for anyone who doesn't want to use that approach.

@playerla
Copy link

The fix work for me

s2t2 added a commit to s2t2/heroku-google-application-credentials-buildpack that referenced this pull request Apr 1, 2020
@sineraves sineraves closed this Apr 3, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants