firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 932 forks source link

Working gulp integration instructions for v3.0 #136

Closed tamalsaha closed 5 years ago

tamalsaha commented 8 years ago

I had a working gulp task for 2.x cli. My gulp task looks like this:

gulp.task('deploy:dev', ['hugo:dev'], function(done) { const fbtools = require('firebase-tools'); fbtools.deploy.hosting({ firebase: '', token: process.env.FIREBASE_TOKEN, public: 'public' }).then(function() { console.log('Website has been deployed'); done(); process.exit(0); }).catch(function(err) { done(err); process.exit(1); }); });

After upgrading to the new 3.0 cli, I am getting the following error:

[02:53:07] TypeError: fbtools.deploy.hosting is not a function

I am using Node 4 LTS version. I have updated the firebase.json file and also have the new .firebaserc file. I see that the instructions in the readme files have not been updated. Is the library usage mode still supported? How do I specify which firebase to use? Some working example snippet will be greatly appreciated.

Thanks.

mbleigh commented 8 years ago

Give this a try:

fbtools.deploy({
  only: 'hosting'
  token: process.env.FIREBASE_TOKEN,
  public: 'public'
})
tamalsaha commented 8 years ago

Thanks for the reply. But I am getting exception:

[05:27:48] TypeError: options.config.importLegacyKeys is not a function at module.exports (/Users/tamal/Source/myapp/node_modules/firebase-tools/lib/deploy/hosting/prepare.js:19:20) at _chain (/Users/tamal/Source/myapp/node_modules/firebase-tools/lib/deploy/index.js:21:45) at deploy (/Users/tamal/Source/myapp/node_modules/firebase-tools/lib/deploy/index.js:88:10) at null._action (/Users/tamal/Source/myapp/node_modules/firebase-tools/commands/deploy.js:32:12) at /Users/tamal/Source/myapp/node_modules/firebase-tools/lib/command.js:168:29

Also, how do I specify which Firebase to use?

samtstern commented 5 years ago

Going through some very old issues, I think the issue in https://github.com/firebase/firebase-tools/issues/136#issuecomment-220188284 is a duplicate of #210 so I am going to close this one.