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

feat: build environment variables #267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shekhirin
Copy link

@shekhirin shekhirin commented Jul 7, 2021

Google allows to update Build Environment Variables on deploy, so let's make use of such opportunity: https://cloud.google.com/functions/docs/env-var#updating_build_environment_variables.

buildEnvironmentVariables property is from REST API documentation https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions


Now we have a better solution for private Go dependencies than having a vendor. With build env vars, you can set GOPROXY and buildpack will fetch needed private dependencies through it. Yay.

@shekhirin shekhirin changed the title Support build environment variables feat: build environment variables Jul 7, 2021
@shekhirin shekhirin force-pushed the build-environment-variables branch from 443ebac to 0e77730 Compare July 7, 2021 20:58
@shekhirin
Copy link
Author

Hi @medikoo! Could you please review the PR when you have a time?

@pgrzesik
Copy link
Collaborator

pgrzesik commented Sep 3, 2021

Hello @shekhirin - sorry for not getting into your Pr sooner - could you please rebase it on top of current master and request a review from me? Thanks 🙇

@shekhirin
Copy link
Author

Hey @pgrzesik, just rebased! Seems like I don't have access to requesting a review 🤷‍♂️

Copy link
Collaborator

@pgrzesik pgrzesik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shekhirin 🙇 It looks great in general, I only have one minor concern, please let me know what do you think

cloudFunctionBuildEnvironmentVariables: {
type: 'object',
patternProperties: {
'^.*$': { type: 'string' },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that regex really be this permissive? It accepts white spaces, etc, which I'm guessing might be not valid properties here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't got permission to push to @shekhirin 's fork, but I believe a sane regex would be [a-zA-Z_][a-zA-Z0-9_]* based on this answer and the first comment on it https://stackoverflow.com/a/2821183/9997939

@and3rson
Copy link

Just found this while looking for a way to set GOOGLE_FUNCTION_SOURCE which is critical for our deployment process and is the only thing blocking us from moving to GCP.

Any chance of getting this merged anytime soon? Thanks!

@PrimeDominus
Copy link

@shekhirin Maybe you need to rebase this to resolve conflicts?

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

4 participants