Modules

base.py

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

Bases: ABC

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

static 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() None[source]
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(tasks: list[str] | None = None, targets: list[str] | None = None, deploydir: str = 'deploy', *args: Any, **kwargs: Any)[source]

Bases: CLIBase

enter_deploy_targets(compose: dict[str, Any]) list[str][source]

Receive deploy targets names from user input

enter_deploy_tasks(configs: Configs) list[str][source]

Receive deploy tasks names from user input

execute_pipeline(configs: Configs, environ: dict[str, Any], deploy_tasks: list[str]) None[source]

Execute commands from configs pipeline

load_compose(path: str | Path, environ: dict[str, Any]) dict[str, Any][source]

Load docker-compose data

load_configs(path: str | Path) Configs[source]

Load deploy configs

load_environ(env_file: str | Path) dict[str, Any][source]

Load environment variables from .env files (if exists)

save_environment_compose(compose: dict[str, Any], deploy_targets: list[str], env: str) Path[source]

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

start() None[source]

Controller for all operations performed by pydeployhelp

validate_docker_binaries() None[source]

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

pydeployhelp.deploy.main(task: ~typing.Annotated[list[str], <typer.models.OptionInfo object at 0x7b4f81a7ffa0>] = (), target: ~typing.Annotated[list[str], <typer.models.OptionInfo object at 0x7b4f81aae860>] = (), deploydir: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7b4f81aae950>] = 'deploy', silent: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7b4f81aaea40>] = False, version: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7b4f81aaeb00>] = False) None[source]

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

pydeployhelp.deploy.run() None[source]

quickstart.py

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

Bases: CLIBase

create_compose(deploy_dir: Path, project_name: str) None[source]
create_config_file(deploy_dir: Path, deploy_tasks: list[str]) None[source]

Create file with deploy configs and tasks pipeline

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

Create file with instructions for Docker daemon to build an image

enter_deploy_dir() 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() None[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(silent: bool = <typer.models.OptionInfo object>, version: bool = <typer.models.OptionInfo object>) None[source]
pydeployhelp.quickstart.run() None[source]