mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-05-04 15:39:50 +02:00
build
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user