Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swarm support #109

Open
towo opened this issue Mar 12, 2024 · 1 comment
Open

Swarm support #109

towo opened this issue Mar 12, 2024 · 1 comment

Comments

@towo
Copy link

towo commented Mar 12, 2024

Currently, the code is fixed on using docker compose for managing services. Is there any interest in developing Swarm support as an addition? I'd probably chip in on that, since this might be in the best interesting of the project I'm currently handling.

@pyhedgehog
Copy link

pyhedgehog commented Mar 13, 2024

You can add following fixtures and it will be almost all required "support":

@pytest.fixture(scope="session")
def docker_compose_command():
    return "docker stack"
@pytest.fixture(scope="session")
def docker_cleanup():
    return ["up"]
@pytest.fixture(scope="session")
def docker_cleanup():
    return ["down"]
@pytest.fixture(scope="session")
def docker_ip() -> str:
    info = json.loads(pytest_docker.plugin.execute("docker info -f json"))
    if info["Name"] == os.environ.get("HOSTNAME"):
        return "127.0.0.1"
    return info.get("Swarm",{}).get("NodeAddr")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants