6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-14 06:58:21 +00:00
tutor/tutor/images.py

23 lines
584 B
Python
Raw Normal View History

from . import fmt, utils
from .types import Config, get_typed
def get_tag(config: Config, name: str) -> str:
key = "DOCKER_IMAGE_" + name.upper().replace("-", "_")
return get_typed(config, key, str)
def build(path: str, tag: str, *args: str) -> None:
fmt.echo_info("Building image {}".format(tag))
utils.docker("build", "-t", tag, *args, path)
2019-07-03 14:09:33 +00:00
def pull(tag: str) -> None:
fmt.echo_info("Pulling image {}".format(tag))
utils.docker("pull", tag)
2019-07-03 14:09:33 +00:00
def push(tag: str) -> None:
fmt.echo_info("Pushing image {}".format(tag))
utils.docker("push", tag)