Phani
Phani

Reputation: 1901

microservice deployment in firebase hosting for an app

I've built an app with polymer 2.0 and polymerfire and deployed it into firebase hosting. This part is smooth.

But I wanted to maintain all my cloud functions as separate modules / separate projects and deploy them independently into firebase hosting. As per the Google IO 2017 talks, it is advised to go microservice style for the cloud functions.

The problem I am facing:

Whenever I deploy an individual module, it erases all the previously deployed cloud functions. Meaning firebase deploy from a project with only firebase functions enabled, will erase all the other cloud functions and deploy the ones declared in this project.

In a nutshell, it looks like I need to create a single monolith with the complete web application, all the cloud functions all in one single fat project and deploy the whole thing. This defeats the point of being microservice style!

Please advise if I am missing something important in the whole setup procedure?

Upvotes: 2

Views: 745

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 600100

You can deploy/undeploy individual functions with the Firebase tools/CLI version 3.8 or higher by specifying what function(s) to update: firebase deploy --only functions:function1,function2. It will still deploy all the code in your project, since the CLI doesn't "know" what file(s) are needed for each specific function. But it will then only update the function(s) that you specify.

Upvotes: 3

Related Questions