"""
Tasks for running the server and seeing its configuration.

:copyright: Copyright 2013-2017, Dorian Puła
    <dorian.pula@amber-penguin-software.ca>
:license: AGPL v3+
"""

import invoke as inv


@inv.task
def wait(ctx, timeout=10):
    """
    Wait for the Dockerized server to start-up and respond.

    :param ctx: Context of the invoke task.
    :param timeout: The time in seconds to wait for the server.  Defaults
        to 10 seconds.
    """
    ctx.run(f'dockerize -wait http://rookeries:5000/status -timeout {timeout}s')
