This commit is contained in:
2026-03-24 12:26:15 +01:00
parent a9a4de2038
commit bc984f05d2
2 changed files with 36 additions and 0 deletions
+34
View File
@@ -16,6 +16,8 @@ import time
import base64
import shutil
import requests
import tempfile
import subprocess
from portainer.api import PortainerApi
from git import Repo
from concurrent.futures import ThreadPoolExecutor
@@ -224,6 +226,37 @@ def wl(msg):
if args.debug:
print(msg)
def run(cmd, cwd=None):
result = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(result.stderr)
return result.stdout.strip()
def get_compose_files():
#git clone --depth=1 --filter=blob:none --no-checkout https://github.com/user/repo.git
with tempfile.TemporaryDirectory() as tmpdir:
repo_path = os.path.join(tmpdir, "repo")
# Clone with minimal data (no checkout, no blobs)
run([
"git", "clone",
"--depth=1",
"--filter=blob:none",
"--no-checkout",
"git@gitlab.sectorq.eu:/jaydee/docker-compose.git",
repo_path
])
# List files in HEAD
output = run([
"git", "ls-tree",
"-r",
"HEAD",
"--name-only"
], cwd=repo_path)
print(output)
def prompt_missing_args(args_in, defaults_in, fields, action=None,stacks=None):
"""
@@ -259,6 +292,7 @@ def prompt_missing_args(args_in, defaults_in, fields, action=None,stacks=None):
elif field == "stack":
if args.action == "create_stack":
# input(json.dumps(stacks, indent=2))
get_compose_files()
commands = [
'api_server', 'authentik', 'bitwarden', 'bookstack', 'databasus', 'dockermon', 'duplicati', 'fail2ban', 'filebrowser', 'gitea', 'gitlab', 'grafana', 'grocy',
'hashicorp', 'home-assistant', 'homebox','homepage', 'immich', 'influxdb', 'jupyter', 'kestra', 'kopia', 'linkding', 'linkwarden', 'mailu3',
+2
View File
@@ -13,6 +13,8 @@ import tabulate
from git import Repo
import requests
import hvac
import subprocess
import tempfile
from prompt_toolkit import prompt
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.shortcuts import checkboxlist_dialog