Firebase-tools: firebase deploy --only functions:groupName-fnName doesn't work to deploy a specific function in a group

Created on 4 Feb 2020  Â·  4Comments  Â·  Source: firebase/firebase-tools

[REQUIRED] Environment info


firebase-tools: 7.12.1


Platform: macOS

[REQUIRED] Test case


Run firebase deploy --only functions:myGroup-fn1 with the following index.js file:

const functions = require('firebase-functions');
exports.myGroup = {
    fn1: functions.https.onRequest(function(request, response) {
        response.status(200).send("fn1");
    }
};

[REQUIRED] Steps to reproduce


firebase deploy --only functions:myGroup-fn1 (or any way of trying to reference only fn1)

[REQUIRED] Expected behavior


The function to get deployed.

[REQUIRED] Actual behavior


The function is skipped with an error:
âš  functions: the following filters were specified but do not match any functions in the project: myGroup-fn1

Also note: firebase deploy initially timed out on a couple of functions and it gave me this command to retry only those failed functions which didn't work which is how I discovered this issue.

functions bug

Most helpful comment

try firebase deploy --only functions:myGroup.fn1

i believe you need to use the dot notation when referring to a specific function in a group. but it does get confusing because the name of the function itself uses the dash.

All 4 comments

Thanks for the simple reproduction! I was able to reproduce this with these functions:

const functions = require('firebase-functions');

exports.outside = functions.https.onRequest(function(req, res) {
    res.status(200).send("outside");
});


exports.myGroup = {
    fn1: functions.https.onRequest(function(request, response) {
        response.status(200).send("fn1");
    })
}

Deploying --only functions:outside and --functions:myGroup works but not --functions:myGroup-fn1

try firebase deploy --only functions:myGroup.fn1

i believe you need to use the dot notation when referring to a specific function in a group. but it does get confusing because the name of the function itself uses the dash.

@eleith - yep! Looks like that worked. Could have sworn I tried that originally but I must not have.

D'oh I make this mistake all the time. @eleith thanks for pointing this out. Even though the actual deployed name of the function contains a dash, we should always use the dot notation with the firebase CLI (in deploy, functions:shell, etc)

Was this page helpful?
0 / 5 - 0 ratings