mirror of
https://gitlab.sectorq.eu/home/docker-compose.git
synced 2025-12-14 18:34:53 +01:00
build
This commit is contained in:
@@ -47,7 +47,7 @@ def ensure_labels_as_string(labels):
|
||||
|
||||
def convert_compose_to_swarm(data):
|
||||
services = data.get("services", {})
|
||||
input(services)
|
||||
#input(services)
|
||||
for name, svc in services.items():
|
||||
print(f"Converting service: {name} , svc: {svc}")
|
||||
if name in ["container_name", "restart", "depends_on"]:
|
||||
@@ -85,7 +85,7 @@ def convert_compose_to_swarm(data):
|
||||
|
||||
# 6) Convert ports to long format
|
||||
if "ports" in svc:
|
||||
input(svc)
|
||||
#input(svc)
|
||||
svc["ports"] = convert_ports(svc["ports"])
|
||||
|
||||
# 7) Remove container_name (not allowed in Swarm)
|
||||
@@ -96,7 +96,7 @@ def convert_compose_to_swarm(data):
|
||||
def main():
|
||||
with open(INPUT_FILE, "r") as f:
|
||||
compose = yaml.safe_load(f)
|
||||
input(compose)
|
||||
#input(compose)
|
||||
swarm = convert_compose_to_swarm(compose)
|
||||
|
||||
with open(OUTPUT_FILE, "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user