Browse Source

Add data volumes

jherve 1 month ago
parent
commit
682df60fd7
1 changed files with 10 additions and 1 deletions
  1. 10 1
      start.py

+ 10 - 1
start.py

@@ -3,7 +3,13 @@ import subprocess
 import socket
 from pathlib import Path
 
-def to_volume_string(vol: str):
+
+data_sources = [
+    Path.home() / "Documents" / "cv",
+    Path.home() / "Documents" / "formations" / "5_jours"
+]
+
+def to_volume_string(vol: str | Path):
     return f"-v {vol}:/mnt/source{vol}:ro"
 
 def main():
@@ -23,6 +29,9 @@ def main():
     ]
     if ssh_auth_sock:
         volumes += [f"{ssh_auth_sock}:{ssh_auth_sock}:Z"]
+    volumes += [
+        f"{vol}:/mnt/source{vol}:ro" for vol in data_sources
+    ]
 
     volume_args = [a for vol in volumes for a in ["-v", vol]]
     image_name = "ghcr.io/borgmatic-collective/borgmatic"