Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push files to firebase storage using firebase cli

I have used firebase cli to host a website.Today i tried to push my files from my local machine to firebase storage using firebase cli but when i give the command firebase deploy nothing happened.can anyone tell me how to push my files to firebase storage.

like image 263
Nidhin Kumar Avatar asked May 24 '18 17:05

Nidhin Kumar


People also ask

How do I upload files to Firebase Storage?

To upload a file to Cloud Storage, you first create a reference to the full path of the file, including the file name. Once you've created an appropriate reference, you then call the putBytes() , putFile() , or putStream() method to upload the file to Cloud Storage.

How do I upload files to the Cloud Storage?

Drag and drop the desired files from your desktop or file manager to the main pane in the Google Cloud console. Click the Upload Files button, select the files you want to upload in the dialog that appears, and click Open.


1 Answers

Install gsutil using tutorial

https://cloud.google.com/storage/docs/gsutil_install#deb

Example for Ubuntu:

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
apt-get install apt-transport-https ca-certificates -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk

Login to google cloud

gcloud auth login

Go to displayed link, login and paste verification code back to console. Select project

gcloud config set project PROJECT_ID

Send file. For example:

gsutil cp backup.$(date +%F).gz.gpg gs://PROJECT_ID.appspot.com/backups
like image 170
Daniel Avatar answered Sep 21 '22 00:09

Daniel