Modules

task

class refit.task.Concurrent(host_class)[source]

Bases: refit.task.Task

Bundles several tasks to be run concurrently.

async run()[source]

Override in subclasses. This is what does the actual work in the task, and is awaited when the Task is run.

class refit.task.Task(host_class)[source]

Bases: refit.mixins.apt.AptMixin, refit.mixins.docker.DockerMixin, refit.mixins.file.FileMixin, refit.mixins.path.PathMixin, refit.mixins.python.PythonMixin, refit.mixins.template.TemplateMixin

classmethod create(host_registry, environment)[source]

Creates and runs a task for all matching hosts.

Return type

None

async entrypoint()[source]

Kicks off the task, along with printing some info.

Return type

None

async raw(command, raise_exception=True)[source]

Execute a raw shell command on the remote server.

abstract async run()[source]

Override in subclasses. This is what does the actual work in the task, and is awaited when the Task is run.

Return type

None

sub_tasks = []
tags = ['all']
refit.task.new_gathered_task(tasks)[source]

Task definitions are classes, not instances, hence why we require this.

Parameters

tasks (Iterable[Type[Task]]) – A list of Task classes to execute.

Return type

Type[Concurrent]

registry

class refit.registry.HostRegistry[source]
get_host_classes(environment, tags)[source]

Returns hosts matching the given tags.

If no tags are given, all hosts match.

Return type

Sequence[Type[Host]]

register(*host_classes, environment='production', tags=[])[source]

Register hosts as possible deployment targets.

Return type

Union[Callable, Type[Host]]

async run_tasks(tasks, environment)[source]

Create and execute a Task for each matching host.

Return type

None

class refit.registry.TaskRegistry[source]
gather(*task_classes, tags=['all'])[source]

Register tasks, which will execute concurrently.

Return type

None

register(*task_classes, tags=['all'])[source]

Register tasks for execution - used either directly, or as a decorator.

Return type

Union[Callable, Type[Task]]