0

i am trying to use google's functions framework to develop a typescript based http function. My project also uses a private NPM repository.

Generally when we deploy a cloud function with functions framework i see that they take the source code as such and run the build steps (npm install etc) in Cloud Build.

But in my case since i am using private NPM repositories, the build fails because Cloud Build does not have access to the private repo's.

I want to grant access to private repo during by Github CI/CD pipelines and generate a final compiled JS code and provide that as input to the gcloud deploy function and skip the Cloud Build step of npm install etc.

Is this possible with the functions framework? If so can someone suggest a way to do this? I could not find any documentation regarding this in functions framework or google cloud functions docs.

Tried deploying only the build folder into the gcloud repo, but faced other errors like function does not export Function and cannot find module error's.

AnandShiva
  • 906
  • 11
  • 22
  • Have you gone through this stakoverflow [link](https://stackoverflow.com/a/66057039/18265638) whic – Sathi Aiswarya Mar 24 '23 at 08:03
  • Is it recommended to zip the node_modules and replace them after google build steps ? Is there no google recommended way of doing it? – AnandShiva Mar 24 '23 at 08:21
  • can you check this [link](https://stackoverflow.com/questions/75658814/firebase-invalid-project-selection) which uses CICD workflows to define the steps – Sathi Aiswarya Mar 24 '23 at 12:08

0 Answers0