1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +01:00

cibuild: tag tagged build with latest when building docker image

This commit is contained in:
Johan Andersson 2019-08-22 08:01:25 +02:00
parent 93088a76cc
commit a89c54dabf

View File

@ -45,18 +45,16 @@ def branch():
return travis_branch or appveyor_branch return travis_branch or appveyor_branch
def docker_name(): def docker_name(version="dev"):
if tag(): if tag():
ver = tag() version = tag()
else: return "spaam/svtplay-dl:{}".format(version)
ver = "dev"
return "spaam/svtplay-dl:{}".format(ver)
def build_docker(): def build_docker():
logger.info("Building docker") logger.info("Building docker")
subprocess.check_output([ subprocess.check_output([
"docker", "build", "-f", "dockerfile/Dockerfile", "-t", docker_name(), "." "docker", "build", "-f", "dockerfile/Dockerfile", "-t", docker_name(), "."
]) ])
subprocess.check_call([ subprocess.check_call([
"docker", "login", "-u", docker_username, "-p", docker_password "docker", "login", "-u", docker_username, "-p", docker_password
@ -65,6 +63,14 @@ def build_docker():
"docker", "push", docker_name() "docker", "push", docker_name()
]) ])
if tag():
subprocess.check_output([
"docker", "tag", docker_name(), docker_name("latest")
])
subprocess.check_call([
"docker", "push", docker_name("latest")
])
def build_package(): def build_package():
logger.info("Building python package") logger.info("Building python package")