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.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-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wesync-0.0.4.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.tar.gz
Algorithm Hash digest
SHA256 9d73d9a308d3d1cb761b384c9764a84f41e1646ec9ceeff2c497a080f4f6d4d4
MD5 07340c19aa64f2aee99a8bd00daa20c7
BLAKE2b-256 ca6755cb2de29d799aa9a64ecc921deaed842518257c79e23813ded0dc0a5f8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wesync-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 72.7 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-py3-none-any.whl
Algorithm Hash digest
SHA256 7319762a64348d6d5d02a04dd7868665d76078d9dbee3625971d70996f73ba3f
MD5 60f9c43f5136e1a0b88b3bfd57c1a5ad
BLAKE2b-256 5a4040aea5d3d4987a86df978359750b34d2d958ce0dd3f7de314114052704e3

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