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.3.post3.tar.gz (34.4 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.3.post3-py3-none-any.whl (61.9 kB view details)

Uploaded Python 3

File details

Details for the file wesync-0.0.3.post3.tar.gz.

File metadata

  • Download URL: wesync-0.0.3.post3.tar.gz
  • Upload date:
  • Size: 34.4 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.3.post3.tar.gz
Algorithm Hash digest
SHA256 aff89ca179303884ab9f17053866b5d2ea14e84a163825f7f75acfd56a91a89c
MD5 57d8c518330c51c890b23002b5cdfd14
BLAKE2b-256 57071b6472ae7caf4b9a011775e14be8010ba1d8eb229e3cc4ecbeaacbd716ef

See more details on using hashes here.

File details

Details for the file wesync-0.0.3.post3-py3-none-any.whl.

File metadata

  • Download URL: wesync-0.0.3.post3-py3-none-any.whl
  • Upload date:
  • Size: 61.9 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.3.post3-py3-none-any.whl
Algorithm Hash digest
SHA256 38421152a479816d4ffc6467cecb9c413ec790334d2ee3e7b2064f775db78ee8
MD5 fa6c99d9f9978150076f608e18cd03b1
BLAKE2b-256 8d9ecb424f98ec6558c265f588b41fa0cb8bfbc86274fa237a27211dd796b5e1

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