0

I am in the process of migrating from version 1 of Google Cloud Functions to generation 2 in cloud run. I've update my functions, but when they are deployed using --only functions:myFunction command with firebase tools it is deploying all my other functions in the file and other files with functions. I get the need for the package.json file, etc, but is there a way to deploy only the function code with the package.json, etc. files. I know there is a .gcloudignore, but to have to list and unlist files each time I need to push another function would be a real pain in the keyster. Not to mention you'll still end up with all the other functions in the file.

1 Answer 1

0

All files in your functions directory are deployed to each container, but only the identified function(s) are wired up. So in your scenario, all the code ends up in the new contains but only the myFunction function will be triggered/callable.

There is (as far as I know) no way to deploy just some of the files, but that also should make no significant difference (see What is the XY problem?)

If you want to have different sets of files being deployed to different containers, consider setting up a separate directory for each (running firebase init in each). That way you completely control what gets deployed for each directory.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you Frank, I was afraid this might be the case.
It looks like the codebase property might be useful here too btw: firebase.google.com/docs/functions/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.