I need to include support for pushing / downloading a local-db version to/from google drive
Requirements:
- The script must expose two commands:
push and pull.
- As part of config, we need to put a setting where local-db binary is. It can be provided as setting or as a var when invoking the command.
- At the moment only Google Drive should be supported, but we can leave it open for the future (ex: OneDrive).
- I think pydrive2 can be used for google drive; ensure invoke whatever is required to authenticate against your account
Behavior:
-
push [VERSION] [-o]:
- Run
./local-db stash VERSION.
- If VERSION is omitted, use today’s date in format
YYYY-mm-DD.
- The stash produces a binary file named
local-db-VERSION.bin.
- Upload that file to Google Drive inside the
/datastore folder.
- If
-o is passed, overwrite any existing file with the same name.
-
pull [VERSION]:
- If VERSION is omitted, download the latest backup from
/datastore.
- If VERSION is provided, download that specific file (
local-db-VERSION.bin).
- Save it locally and run
./local-db restore VERSION.
Other requirements:
- Fail fast if commands or files are missing.
- Script must be auditable, modular, and portable.
- Keep comments minimal, only if strictly necessary.
- It should be another command, following same format as the ones we have.
- As usual, add tests to cover as possible and ensure code is being compiled and executed without issues.
I need to include support for pushing / downloading a local-db version to/from google drive
Requirements:
pushandpull.Behavior:
push [VERSION] [-o]:./local-db stash VERSION.YYYY-mm-DD.local-db-VERSION.bin./datastorefolder.-ois passed, overwrite any existing file with the same name.pull [VERSION]:/datastore.local-db-VERSION.bin)../local-db restore VERSION.Other requirements: