Skip to main content

Tool for easier switching between projects that uses docker containers to set up working environment

Project description

https://img.shields.io/pypi/v/dockswap.svg https://img.shields.io/travis/VagifMammadaliyev/dockswap.svg https://img.shields.io/badge/code%20style-black-000000.svg

Tool for easier switching between projects that uses docker containers to set up working environment

Installation

pip install dockswap

Usage

Usage: dockswap [OPTIONS] COMMAND [ARGS]...

DockSwap. Tool for swapping projects.

Commands:
  add      Register a composer for project
  delete   Delete registered composer
  list     List all registered composers
  prune    Prune existing registered composers.
  start    Start containers for registered composer
  stop     Stop containers for registered composer
  stopall  Stop (and/or remove) all running containers
  version  Show version of currently used dockswap

Adding composer

Usage: dockswap add [OPTIONS] PROJECT_NAME

  Register a composer for project

Arguments:
  PROJECT_NAME  [required]

Options:
  --path PATH      Path to .yml or .json file that must be run using docker-
                   compose  [required]

  --env-path PATH  If your docker-compose file uses env_file then specify path
                   for that file

Showing composers

Usage: dockswap list [OPTIONS]

  List all registered composers

Options:
  --full / --no-full  show more info  [default: False]

Starting

Usage: dockswap start [OPTIONS] PROJECT_NAME

  Start containers for registered composer

Arguments:
  PROJECT_NAME  [required]

Options:
  --remove-other / --no-remove-other
                                  Remove stopped containers  [default: False]
  --dry / --no-dry                Do not run command, instead just print it
                                  [default: False]

Why?

If your are using docker containers to set up your working environment then this tool is for you. I used to do like this:

$ cd ~/projects/foo
$ docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
$ docker-compose -f _dev/docker-compose.yml up -d

Then I want to switch to another project, and again:

$ cd ~/projects/bar
$ docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
$ docker-compose -f _directory_with_another_name/docker-compose.yml up -d

This is a bit verbose for such a simple task. Now what I do is just:

$ dockswap start foo --remove-other

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

dockswap-0.3.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

dockswap-0.3.0-py2.py3-none-any.whl (9.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dockswap-0.3.0.tar.gz.

File metadata

  • Download URL: dockswap-0.3.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.0

File hashes

Hashes for dockswap-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5c96aec740a981f32f4c19787973edcc6410c2d5e4b49453c910ff56523407ac
MD5 5a536b7a8013614b70d14047ae36002b
BLAKE2b-256 0a05b5e8fa5a6b03151df776408162ce164c3f16aacbe7fe0fbfd1346f8b75aa

See more details on using hashes here.

File details

Details for the file dockswap-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: dockswap-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.0

File hashes

Hashes for dockswap-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 821cbed1a37c505ce9e47f41e3f9719db75b6ad688f5cfc915f0414c4571066a
MD5 ec2eb68152d3581fa8a58449f1f4af63
BLAKE2b-256 57fa7826c3f691bd03bd1551f772c7c5f9caa430c2fbbc714ffa5f2c066a7e61

See more details on using hashes here.

Supported by

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