Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload single file to firebase hosting via CLI or other without deleting existing ones?

Tags:

Question:

How to upload a single file to firebase without deleting existing files?

Details:

  • Intent: upload single file without deleting existing files on server

  • Usage: have separate directories on local machine each uploading to a specific folder on server

  • What I've tried: overriding the public dir with firebase deploy -p file.txt, this results in setting root public dir to use that dir.

like image 303
adamszone Avatar asked Jun 05 '15 23:06

adamszone


People also ask

How do you update a file that I deployed to Firebase Hosting?

You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.

Should Firebase json be committed?

firebaserc is environment/machine specific, and thus should not be committed to the repository.


1 Answers

Disclosure: I work at Firebase

Firebase hosting's command line tools currently requires that you have the entire web site locally, even though it will only upload the files that were modified since the last deploy.

So your only workaround for not would be to have a single machine where all those directories exist, e.g. something like a build or staging server.

We are aware that this is limiting the number of cases that it can be used for.

Update (December 2018): Firebase Hosting now has a REST API. While this still doesn't officially allow you to deploy a single file, you can use it creatively to get what you want. See my Gist here: https://gist.github.com/puf/e00c34dd82b35c56e91adbc3a9b1c412

like image 51
Frank van Puffelen Avatar answered Oct 07 '22 02:10

Frank van Puffelen