Home:ALL Converter>Is it possible to only deploy specific Firebase functions that changed with GitLab CI/CD?

Is it possible to only deploy specific Firebase functions that changed with GitLab CI/CD?

Ask Time:2021-01-04T19:27:01         Author:huonderv

Json Formatter

Deploying all Firebase functions at once is quite easy with GitLab CI/CD (How to leverage GitLab CI/CD for Google Firebase):

deploy-functions:
  stage: deploy
  script:
    - cd functions
    - npm install
    - cd ..
    - firebase deploy --only functions --token $FIREBASE_TOKEN
  only:
    refs:
      - master
    changes:
      - functions/**/*

However, when "deploying large numbers of functions, you may exceed the standard quota and receive HTTP 429 or 500 error messages. To solve this, deploy functions in groups of 10 or fewer." (see Manage functions deployment and runtime options).

With the Firebase CLI, specific functions (e.g. addMessage and makeUppercase) can be deployed using firebase deploy --only functions:addMessage,functions:makeUppercase.

Now, is there an easy way to automatically detect which functions are affected by changes in the code base and build a gitlab-ci.yml that only deploys the corresponding functions?

Author:huonderv,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/65561926/is-it-possible-to-only-deploy-specific-firebase-functions-that-changed-with-gitl
yy