Skip to main content

Mutagen Helper to help you manage sessions

Project description

Mutagen Helper

Latest Version MIT License Build Status Coveralls

Mutagen Helper allow you to define Mutagen synchronisation sessions inside a configuration file on directories you want to synchronise.

Install

or

  • run pip install mutagen-helper on Python 3.6+

Quickstart

  • Install mutagen as usual, and make it available in the user PATH or define MUTAGEN_HELPER_MUTAGEN_BIN environment variable to the path of the mutagen binary as an alternative (ie: C:\tools\mutagen\mutagen.exe).

  • Create .mutagen.yml file inside some local directory you want to synchronize and set beta property to the destination of the synchronisation.

project_name: 'helper-project' # Optional, it will fallback to directory name if not defined
beta: 'vagrant@192.168.1.100:/home/vagrant/projects' # Beta side of the synchronisation
options: # Options can be provided
  sync-mode: two-way-resolved
  default-file-mode-beta: 664
  default-directory-mode-beta: 775
  ignore-vcs: True
  ignore:
    - node_modules/
    - vendor/

important note: mutagen-helper automatically appends the project_name to the beta definition. It means that this directory will be synchronised to /home/vagrant/projects/helper-project.

  • Run mutagen-helper up from the project directory.

  • Run mutagen-helper list to see which sessions are running on which projects. Output match mutagen list command output, but as JSON and with Project name and Name additional properties.

  • Run mutagen-helper --help to check other available commands.

Usage

Usage: __main__.py [OPTIONS] COMMAND [ARGS]...

  Main command group :return:

Options:
  --version      Show the version and exit.
  -v, --verbose  Add more output
  -s, --silent   No output at all
  -h, --help     Show this message and exit.

Commands:
  up      Creates and starts a new synchronization sessions
  down    Permanently terminates synchronization sessions
  pause   Pauses synchronization sessions
  flush   Flush synchronization sessions
  resume  Resumes paused or disconnected synchronization sessions
  list    Lists existing synchronization sessions and their statuses

Multiple projects support

You may up multiple projects at the same time if all your projects lies in the same directory.

C:\workspace
    |- project1
        |- .mutagen.yml
        |- ...
    |- project2
        |- .mutagen.yml
        |- ...
    |- project3
        |- .mutagen.yml
        |- ...
mutagen-helper up --path C:\workspace

or

cd C:\workspace
mutagen-helper up

Those command will create all mutagen sessions defined in .mutagen.yml of each subdirectories of C:\workspace.

Advanced configuration

You may use environment variable expansion, with ${VARIABLE} syntax like in bash. Your can set a default value if variable is not defined with ${VARIABLE:-default}.

Your may also define multiple sessions under a sessions key. Properties defined at root of the configuration file will be inherited by each session.

You may also give names to sessions for them to be identified with precision, but keep in mind that changing name on running sessions could cause problem as they are used to find out the real mutagen session id.

beta: '${DOCKER_DEVBOX_URL}:/home/vagrant/projects'
sessions:
  - options:
      name: 'partial-watch-alpha'
      sync-mode: two-way-resolved
      default-file-mode-beta: 664
      default-directory-mode-beta: 775
      ignore-vcs: True
      ignore:
        - node_modules/
        - vendor/
      max-staging-file-size: 1MB
      watch-mode-beta: no-watch
  - options:
      name: 'full-no-watch'
      sync-mode: two-way-resolved
      default-file-mode-beta: 664
      default-directory-mode-beta: 775
      max-staging-file-size: 1MB
      watch-mode: no-watch

Some properties have default values.

  • alpha
    • MUTAGEN_HELPER_ALPHA environment variable, or
    • Directory when the .mutagen.yml resides
  • beta:
    • MUTAGEN_HELPER_BETA environment variable, or
    • mandatory in the .mutagen.yml
  • append_project_name_to_beta:
    • MUTAGEN_HELPER_APPEND_PROJECT_NAME_TO_BETA, or
    • True

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

mutagen-helper-1.0.0b3.tar.gz (23.0 kB view details)

Uploaded Source

File details

Details for the file mutagen-helper-1.0.0b3.tar.gz.

File metadata

  • Download URL: mutagen-helper-1.0.0b3.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for mutagen-helper-1.0.0b3.tar.gz
Algorithm Hash digest
SHA256 747ea1f8fc46b292989738c94b1b1ecbdbc93b9954ee3ce449269fbd645b3ec8
MD5 c8cb9386b3265dfd6c77d10c443115be
BLAKE2b-256 e68d7d20fcf379fad6a571591c9fe2cb9989c83cdd6cc0ce0b40fea8f7963094

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