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

cibuild: fix some docker issues

This commit is contained in:
Johan Andersson 2019-09-06 18:53:05 +02:00
parent bb0689d300
commit cf2d50125b

View File

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