Modules

base.py

class pydeployhelp.base.ABC(silent: bool = False)[source]

Bases: abc.ABC

Parent class for all CLI tools, contains common methods related to user i/o

ask_to_continue() None[source]

Receive agreement from user input to continue

enter(allowed_items: List[str], default: str, items_name: str) List[str][source]

Receive answer from user input for provided list of available choices

abstract start()[source]
class pydeployhelp.base.Colors(black: sty.primitive.Style = '\x1b[30m', red: sty.primitive.Style = '\x1b[31m', green: sty.primitive.Style = '\x1b[32m', yellow: sty.primitive.Style = '\x1b[33m', blue: sty.primitive.Style = '\x1b[34m', magenta: sty.primitive.Style = '\x1b[35m', cyan: sty.primitive.Style = '\x1b[36m', white: sty.primitive.Style = '\x1b[97m')[source]

Bases: object

black: sty.primitive.Style = '\x1b[30m'
blue: sty.primitive.Style = '\x1b[34m'
cyan: sty.primitive.Style = '\x1b[36m'
green: sty.primitive.Style = '\x1b[32m'
magenta: sty.primitive.Style = '\x1b[35m'
red: sty.primitive.Style = '\x1b[31m'
white: sty.primitive.Style = '\x1b[97m'
yellow: sty.primitive.Style = '\x1b[33m'
class pydeployhelp.base.Configs(context: Dict = <factory>, tasks: Dict = <factory>)[source]

Bases: object

context: Dict
dict() Dict[source]
tasks: Dict

deploy.py

class pydeployhelp.deploy.Deploy(deploydir: str = 'deploy', *args, **kwargs)[source]

Bases: pydeployhelp.base.ABC

enter_deploy_targets(compose: Dict) List[str][source]

Receive deploy targets names from user input

enter_deploy_tasks(configs: pydeployhelp.base.Configs) List[str][source]

Receive deploy tasks names from user input

execute_pipeline(configs: pydeployhelp.base.Configs, environ: Dict, deploy_tasks: List[str]) None[source]

Execute commands from configs pipeline

load_compose(path: Union[str, pathlib.Path], environ: Dict) Dict[source]

Load docker-compose data

load_configs(path: Union[str, pathlib.Path]) pydeployhelp.base.Configs[source]

Load deploy configs

load_environ(env_file: Union[str, pathlib.Path]) Dict[source]

Load environment variables from .env files (if exists)

save_environment_compose(compose: Dict, deploy_targets: List[str], env: str) pathlib.Path[source]

Filter docker-compose services according to deploy_targets, rename main components according to env and save to new file

start()[source]

Controller for all operations performed by pydeployhelp

validate_docker_binaries()[source]

Check that all required binaries exist and are accessible by current user

pydeployhelp.deploy.main()[source]

Main entrypoint, which will be called when executing pydeployhelp in console

pydeployhelp.deploy.parse_args() argparse.Namespace[source]

Create stdin arguments parser and parse args from user input

quickstart.py

class pydeployhelp.quickstart.Quickstart(*args, **kwargs)[source]

Bases: pydeployhelp.base.ABC

create_compose(deploy_dir: pathlib.Path, project_name: str)[source]
create_config_file(deploy_dir: pathlib.Path, deploy_tasks: List[str])[source]

Create file with deploy configs and tasks pipeline

create_dockerfile(deploy_dir: pathlib.Path, project_name: str)[source]

Create file with instructions for Docker daemon to build an image

enter_deploy_dir() pathlib.Path[source]

Receive deploy directory path from user input

enter_deploy_tasks() List[str][source]

Receive deploy tasks names from user input

enter_project_name() str[source]

Receive project name from user input

start()[source]

Receive info from user input and create deploy directory scripts

class pydeployhelp.quickstart.QuickstartDefaults(deploy_dir: str, deploy_tasks: Set[str], dockerfile: str)[source]

Bases: object

deploy_dir: str
deploy_tasks: Set[str]
dockerfile: str
pydeployhelp.quickstart.main()[source]
pydeployhelp.quickstart.parse_args() argparse.Namespace[source]

utils.py

pydeployhelp.utils.read_env_file(path: Union[str, pathlib.Path], default_value='') Dict[source]

Read environment variables from .env file