Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support importing/exporting uploads folder #122

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

dustin-jw
Copy link
Contributor

Description

This work adds sync scripts to help with keeping different environments up to date, in this case for the uploads folder. It adds two shell scripts to handle the underlying functionality and uses npm scripts to simplify usage. Notable changes include:

  • Supporting uploads backups and exports
  • Supporting uploads imports
  • Updating the npm scripts to use the naming convention that works best with npm-run-all
  • Supporting sequential DB and uploads operations with single import/export/backup scripts
  • Changing which folder SQL dumps go in, so all sync files can be organized more easily in sync/sql and sync/uploads folders

Closes #103

To Validate

  1. Make sure all PR Checks have passed
  2. Pull down this branch
  3. Run npm start
  4. Run npm run export:uploads and confirm that a timestamped zip file is created in sync/uploads/exports
  5. Run npm run backup:uploads and confirm that a timestamped zip file is created in sync/uploads/backups
  6. Add or delete some files from your uploads folder so you can tell that it's different after importing in the next step
  7. Copy one of the exported zip files into sync/uploads and run npm run import:uploads, confirming that your uploads folder contains the contents of the zip file that was used
  8. Try each of the scripts listed in the README's "Syncing Environments" section, making sure they each work as expected

@dustin-jw dustin-jw force-pushed the chore--import-export-images branch 2 times, most recently from 9ab2542 to 0e5f578 Compare November 3, 2023 16:35
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@jonoliver jonoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dustin! I think I've tested every permutation of this and the behavior works as expected. I only have a few suggestions to clarify where files are moved during the import process.

@dustin-jw dustin-jw requested a review from jonoliver November 6, 2023 20:26
Copy link
Member

@jonoliver jonoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates Dustin!

- ignore folder used for staging upload imports and exports
- add script for exporting/backing up uploads
- update naming convention for import/export npm scripts
- add script to import uploads
- group sql dumps and uploads zip files in sync folder
- support simultaneous named exports/backups
@dustin-jw dustin-jw force-pushed the chore--import-export-images branch from 1511a76 to 764f424 Compare November 7, 2023 16:17
@dustin-jw dustin-jw merged commit 764f424 into main Nov 7, 2023
2 checks passed
@dustin-jw dustin-jw deleted the chore--import-export-images branch November 7, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support importing and exporting images
2 participants