I have a node-based rest api app running off of a single firebase function and I'm trying to setup a CD pipeline to deploy a staging function and another a production function.
The only way I've found to get this working was to have a 'production.ts' and 'staging.ts' and in each pipeline to rename the relevant one to index.ts.
This works and is successful but because it doesn't find the other function in there, it will not publish the new function, instead, it will revert everything?
This is the console output of my last run:
functions: creating Node.js 10 function StagingAPI (europe-west2)...
Error: The following functions are found in your project but do not exist in your local source code:
ProductionAPI (europe-west2)
Aborting because deletion cannot proceed in non-interactive mode. To fix, manually delete the functions by running:
firebase functions:delete ProductionAPI --region europe-west2
How could I achieve this differently without having another completely separate firebase project?
I can see there's some discussions on github about it and even a pull request that attempts to fix this by providing a flag: --ignore-existing-functions
But it doesn't look like its going to be merged.
This must be a common issue.