Stop deploying everything. Detect what functions to deploy with
Under active development. Not ready for usage.
Have you ever needed a tool to automate deployments without pushing all the functions, all the time?
ffd allows you to deploy only functions that changed since your last deploy.
ffd works by scanning the file where your function is declared. If the file content changes, even if the change is within the dependency tree (via
require) the script spots the difference and generates a new hash for the file.
File hashes are stored in a file called
functions-lock.json created by
To generate a
ffd needs a config file. The config file includes information about your functions and their path location.
Sample config file:
Note: In an ideal world, each function you want to deploy would be stored in their own file. If you are not there yet, and
ffd spots a file with more than one function, any changes within that file would trigger an update on every function. That is due to how
ffd works, and the best you can do to avoid this scenario is splitting functions into their own files.
// `myFunctionName1` has same path as `myFunctionName3`. Changes within `./myFunctionName1.js` scope// updates both `myFunctionName1` and `myFunctionName3`. Split functions into files to prevent this."myFunctionName1": "./myFunctionName__shared.js""myFunctionName2": "./myFunctionName2.js""myFunctionName3": "./myFunctionName__shared.js"
# works via npm too. volta too.yarn add firebase-functions-deployer
Package comes with an alias
ffd. Acronym means
(f)irebase-(f)unctions-(d)eployer. As a CLI tool, you should run it via
npx. The CLI expects a
--config parameter to work.
npx ffd --config <path_to_config_file> <options>
Options:-V, --version output the version number-c, --config <path_to_config_file> set config file path-d, --debug <none|errors-only|errors-warnings> output debug info-h, --help display help