mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-01-29 12:59:44 +01:00
build
This commit is contained in:
12
port.py
12
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)
|
||||
|
||||
Reference in New Issue
Block a user