So I have all my shared npm packages in separate git repositories.
I can use one of them in another repo by using npm install git:url/to/repository
.
Now I need to create a Google cloud function.
How do I add my private git URL as a dependency?
Is there some file I can use to specify git credentials, and some way of getting those from an environment variable so I don't have to hardcode them (for security reasons)?
If not, I'll have to install them locally or in CI and upload the node_modules
directory along everything else, which is fine too.
It's not possible to use private repository. You have to embed your lib with your code when you deploy. Or, if you can use http trigger, have a look to cloud run you can package your container and thus do what you want at build phase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With