7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-05-29 20:30:48 +00:00
tutor/tutor/images.py
Régis Behmo 0a670d7ead refactor: add type annotations
Annotations were generated with pyannotate:
https://github.com/dropbox/pyannotate

We are running in strict mode, which is awesome!

This affects a large part of the code base, which might be an issue for
people running a fork of Tutor. Nonetheless, the behavior should not be
affected. If anything, this process has helped find and resolve a few
type-related bugs. Thus, this is not considered as a breaking change.
2021-03-15 21:46:55 +01:00

24 lines
568 B
Python

from typing import Any, Dict
from . import fmt
from . import utils
def get_tag(config: Dict[str, Any], name: str) -> Any:
return config["DOCKER_IMAGE_" + name.upper().replace("-", "_")]
def build(path: str, tag: str, *args: str) -> None:
fmt.echo_info("Building image {}".format(tag))
utils.docker("build", "-t", tag, *args, path)
def pull(tag: str) -> None:
fmt.echo_info("Pulling image {}".format(tag))
utils.docker("pull", tag)
def push(tag: str) -> None:
fmt.echo_info("Pushing image {}".format(tag))
utils.docker("push", tag)