From b0c570d7ba80e4762dd9c50196cf45273cc6007c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 23 Dec 2025 11:16:56 +0100 Subject: [PATCH] build --- port.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/port.py b/port.py index 7405f27..919f124 100644 --- a/port.py +++ b/port.py @@ -914,6 +914,7 @@ class Portainer: #print(longest) ok = "\033[92m✔\033[0m" err = "\033[91m✖\033[0m" + updates = [] for service_id in service_ids: # print(self.all_data["containers"][self.args.endpoint_id]) @@ -934,7 +935,7 @@ class Portainer: #print("Recreate") self.recreate_container(service_id, pull) #print(f"Service {service_dict[service_id]:<{longest}} : updated") - self.gotify_message(f"Service {service_dict[service_id]} updated") + updates.append(service_dict[service_id]) print(ok, end=" ") for name, hash_, image in self.all_data["containers"][self.args.endpoint_id]: if name.startswith(service_dict[service_id]): @@ -942,7 +943,7 @@ class Portainer: else: print(f"\r\033[4m{service_dict[service_id]:<{longest}}\033[0m ", end="", flush=True) #print(f"\033[4m{service_dict[service_id]:<{longest}} {err}\033[0m") - self.gotify_message(f"Service update available for {service_dict[service_id]}") + updates.append(service_dict[service_id]) print(err, end=" ") for name, hash_, image in self.all_data["containers"][self.args.endpoint_id]: if name.startswith(service_dict[service_id]): @@ -952,6 +953,11 @@ class Portainer: for name, hash_, image in self.all_data["containers"][self.args.endpoint_id]: if name.startswith(service_dict[service_id]): print(image) + if len(updates) > 0: + if pull: + self.gotify_message(f"Services updated: {", ".join(updates)}") + else: + self.gotify_message(f"Services updates available: {', '.join(updates)}") print("\033[?25h", end="") return True @@ -1352,5 +1358,5 @@ class Portainer: path = f"/endpoints/{endpoint_id}/docker/secrets/create" encoded = base64.b64encode(value.encode()).decode() data = {"Name": name, "Data": encoded} - + return self._api_post(path, data, timeout=timeout)