Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud functions install package from private git repo

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.

like image 596
David Callanan Avatar asked Sep 20 '25 22:09

David Callanan


1 Answers

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.

like image 67
guillaume blaquiere Avatar answered Sep 22 '25 15:09

guillaume blaquiere