2019-07-02 20:16:44 +00:00
|
|
|
from . import fmt
|
|
|
|
from . import utils
|
|
|
|
|
|
|
|
|
2019-10-22 14:13:50 +00:00
|
|
|
def get_tag(config, name):
|
2020-07-21 07:13:00 +00:00
|
|
|
return config["DOCKER_IMAGE_" + name.upper().replace("-", "_")]
|
2019-10-22 14:13:50 +00:00
|
|
|
|
|
|
|
|
2020-09-04 10:35:44 +00:00
|
|
|
def build(path, tag, *args):
|
2019-07-02 20:16:44 +00:00
|
|
|
fmt.echo_info("Building image {}".format(tag))
|
2020-09-04 10:35:44 +00:00
|
|
|
utils.docker("build", "-t", tag, *args, path)
|
2019-07-02 20:16:44 +00:00
|
|
|
|
2019-07-03 14:09:33 +00:00
|
|
|
|
2019-07-02 20:16:44 +00:00
|
|
|
def pull(tag):
|
|
|
|
fmt.echo_info("Pulling image {}".format(tag))
|
|
|
|
utils.execute("docker", "pull", tag)
|
|
|
|
|
2019-07-03 14:09:33 +00:00
|
|
|
|
2019-07-02 20:16:44 +00:00
|
|
|
def push(tag):
|
|
|
|
fmt.echo_info("Pushing image {}".format(tag))
|
2019-07-03 14:09:33 +00:00
|
|
|
utils.execute("docker", "push", tag)
|