Skip to main content

Deployment synchronization tool

Project description

Usage

General information

When you run the command in a directory that is known to the configuration (host and path both match), the default project and deployment are determined automatically and used in subsequent commands.

In that case there is no need to issue --project or --deployment commands

  • --workdir: The working directory for wesync. Default is ~/wesync
  • --verbose: Additional working information
  • --debug: Also print debug messages
  • --stash: The directory of the stash, relative to workdir. Default is stash

Snapshots

Snapshots are locally stored backups of the project according to it's configuration or type

It usually contains the database and one or more file archives.

Create a new snapshot

wesync snapshot export --project <projectName> --deployment <deploymentName> [--only-database] [label]

This saves a snapshot locally.

  • label Sets the label for the export. A random hex will be generated if missing

Restore a snapshot

wesync snapshot import --project <projectName> --deployment <deploymentName> [--only-database] [--label <label>] [--path <path>]

This uses the local snapshot to restore the project database and files

  • --only-database: This flag export/imports only the database from the snapshot
  • label: Import the snapshot by the specified label
  • path: Import the snapshot using the specified path.

If both path and label are missing, the most recent snapshot for the project will be imported.

List snapshot

wesync snapshot list --project <projectName>

This list snapshots for the specified project. If project is omitted all snapshots are listed

Delete snapshots

wesync snapshot delete --project <projectName> --label <label> --path <path>

Delete a snapshot either by label or path. Project is required when deleting a single snapshot.

Purge all snapshots

wesync snapshot purge --project <projectName>

Delete all snapshots for a project. If project name is omitted all snapshots will be deleted for all projects.

Sync

The sync command uses different strategies to export data from a project and import it in another project in the same command The command requires a project, a source and destination deployment

wesync sync --project <projectName> sourceDeployment destinationDeployment [--sync-strategy] [--only-database]
  • --only-database: This flag syncs only the database between deployments
  • --sync-strategy: Determines the method that sync will use. Options are described below

Sync strategies

  • snapshot: Export a snapshot on the sourceDeployment, copy it to the destinationDeployment using rsync, and import it
  • snapshotScp: Same as snapshot, but transfer the data using scp instead of rsync
  • scp: Stream the database and copy the files from source location to destination location using SCP
  • rsync: Stream the database and sync the files from source location to destination location using rsync

Streaming the database implies piping the database export to the database import command

Other commands

Configuration update/push

  • Create a new work directory
wesync config init
  • Purge the work directory
wesync config purge [--full]

--full: Delete entire directory, not just configuration

  • update / commmit
wesync config update|commit

Fetches new configuration from the repository or commits changes and pushed to remote

Building

Install build tools

pip3 install --upgrade build
pip3 install virtualenv

Go to project root directory and run build module

python3 -m build

Find the whl file and install it globally (for testing)

pip3 install --force-reinstall dist/wesync-0.0.1-py3-none-any.whl

Test the package:

wesync --help
python3
>>> import wesync

python3 -m wesync

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wesync-0.0.4.post1.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wesync-0.0.4.post1-py3-none-any.whl (72.8 kB view details)

Uploaded Python 3

File details

Details for the file wesync-0.0.4.post1.tar.gz.

File metadata

  • Download URL: wesync-0.0.4.post1.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for wesync-0.0.4.post1.tar.gz
Algorithm Hash digest
SHA256 b80ad7a29ebb7fe3bd173c26d0e300d6f9c0970c282d07e5a2e006a401a167cf
MD5 eaae56e46238e2e36ecea46de67c5f14
BLAKE2b-256 6d53203939b4d99dd223a5f223258a0956714a9f61ae107774cc4da4d1000da3

See more details on using hashes here.

File details

Details for the file wesync-0.0.4.post1-py3-none-any.whl.

File metadata

  • Download URL: wesync-0.0.4.post1-py3-none-any.whl
  • Upload date:
  • Size: 72.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for wesync-0.0.4.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 04bf6158afb4a3150432ca2e87ed1687b9c7e071c9a1f7ee29756cd9b38c9ca0
MD5 e524a783a7cca461f7874eb77d2b8a14
BLAKE2b-256 adf691e5a6245f36af39c9a71804c6badd2a869df11ea21f210950a7ad9db5b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page