There is a way to sync files from folder to Google Cloud Storage bucket with gsutil
command line tool like:
gsutil rsync -r <src> gs://<bucket>
Is there any way to do the same on development server?
There is a way to sync files from folder to Google Cloud Storage bucket with gsutil
command line tool like:
gsutil rsync -r <src> gs://<bucket>
Is there any way to do the same on development server?
I'm replaying to myself as I couldn't find any other solution so I've implemented my own. I'm not sure if that's the proper way of doing that thing but it does what I want. Maybe someone else will find it useful as well.
I've created upload handler for webapp2 that will allow me to upload multipart-encoded files via http POST request.
Then I've created CLI task that can be used to upload files from console:
When dev server is running I can simple upload files from specified disk location to desire local storage bucket with preserving source file names:
where
<dir>
has the same name as bucket to witch you want to send files.When files are uploaded you can list bucket by going to:
Since Development Server emulates Cloud Storage via local directory specified by
--storage_path=
when runningdev_appserver.py
parameter, you can do run the rsync using regular linux tools, i.e. something like this (if you sync files between different servers):Or, if you're syncing files on the local system, use something like this: