Commit dd754e54 authored by José Henrique's avatar José Henrique
Browse files

Fixup some race conditions

parent 017407b9
...@@ -9,7 +9,7 @@ docker_client = docker.from_env() ...@@ -9,7 +9,7 @@ docker_client = docker.from_env()
def stream_container_logs_thread(container_name): def stream_container_logs_thread(container_name):
time.sleep(1) time.sleep(3)
try: try:
container = docker_client.containers.get(container_name) container = docker_client.containers.get(container_name)
for line in container.logs(stream=True): for line in container.logs(stream=True):
...@@ -73,6 +73,7 @@ def start_build(environment_vars): ...@@ -73,6 +73,7 @@ def start_build(environment_vars):
pull_image(image_name) pull_image(image_name)
print("Starting container: " + container_name) print("Starting container: " + container_name)
stream_container_logs(container_name) stream_container_logs(container_name)
time.sleep(1)
docker_client.containers.run(image_name, docker_client.containers.run(image_name,
remove=True, remove=True,
name=container_name, name=container_name,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment