From 2f233c2350649cba6abe6e7c04990abfe559ff3a Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Fri, 12 Jan 2024 12:34:37 +0000 Subject: [PATCH] Added user feedback to `docker_deploy_stack` --- deploy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy b/deploy index 2e253dd..48dd281 100755 --- a/deploy +++ b/deploy @@ -23,6 +23,8 @@ def fetch_repository_url() -> str: def docker_deploy_stack(username: str, password: str, stack_name: Optional[str] = "stack"): """Deploys the stack using the portainer api from the github repo. This allows portainer to have full control over the stack""" + print("Deploying stack") + print("Logging in to portainer") # Create an API client client = portainer.ApiClient() client.configuration.host = "http://127.0.0.1:9000/api" @@ -40,6 +42,7 @@ def docker_deploy_stack(username: str, password: str, stack_name: Optional[str] endpoints = portainer.EndpointsApi(client) endpoint_id = next(filter(lambda e: e.name == "local", endpoints.endpoint_list())).id # Then, deploy the stack using the API + print("Deploying stack via portainer API") stacks = portainer.StacksApi(client) stacks.stack_create_docker_swarm_repository( endpoint_id=endpoint_id, @@ -53,6 +56,7 @@ def docker_deploy_stack(username: str, password: str, stack_name: Optional[str] repository_url=fetch_repository_url(), ) ) + print("Stack deployed") def docker_deploy_all(username: str, password: str, core_name: Optional[str] = "core", stack_name: Optional[str] = "stack"):