From 2bab6be3913add3cbed5bc01204d02e237a5114b Mon Sep 17 00:00:00 2001 From: daniwe4 Date: Wed, 24 Sep 2025 14:06:38 +0200 Subject: [PATCH] master pack/export:536 execute git command inside container --- app/src/App.php | 2 +- app/src/Commands/Pack/ExportCommand.php | 5 +++-- app/src/Lib/Git/Git.php | 1 - app/src/Lib/Git/GitShell.php | 19 ------------------- setup/updates/update-20250924.sh | 7 +++++++ 5 files changed, 11 insertions(+), 23 deletions(-) create mode 100644 setup/updates/update-20250924.sh diff --git a/app/src/App.php b/app/src/App.php index 1a1cd4ae..9cf93b74 100644 --- a/app/src/App.php +++ b/app/src/App.php @@ -9,7 +9,7 @@ class App extends Application { - const NAME = "Doil Version 20250918 - build 2025-09-18"; + const NAME = "Doil Version 20250924 - build 2025-09-24"; public function __construct(Command ...$commands) { diff --git a/app/src/Commands/Pack/ExportCommand.php b/app/src/Commands/Pack/ExportCommand.php index bbf2deca..3d327a99 100644 --- a/app/src/Commands/Pack/ExportCommand.php +++ b/app/src/Commands/Pack/ExportCommand.php @@ -252,8 +252,9 @@ protected function exportProjectConfig(OutputInterface $output, string $path, st } if (count($remotes) > 1) { - $remotes = array_filter($remotes, function ($url) use ($branch, $path) { - return $this->git->isBranchInRepo($path . "/volumes/ilias", $url, $branch); + $remotes = array_filter($remotes, function ($url) use ($branch, $instance) { + $cmd = "git ls-remote --heads {$url} refs/heads/{$branch}"; + return $this->docker->executeDockerCommandWithReturn($instance, $cmd); }); if (count($remotes) == 0) { diff --git a/app/src/Lib/Git/Git.php b/app/src/Lib/Git/Git.php index 1402491b..8237cdb4 100644 --- a/app/src/Lib/Git/Git.php +++ b/app/src/Lib/Git/Git.php @@ -13,5 +13,4 @@ public function cloneBare(string $url, string $path) : void; public function setLocalConfig(string $path, ...$commands) : void; public function checkoutRemote(string $path, string $branch) : void; public function getRemotes(string $path) : array; - public function isBranchInRepo(string $path, string $url, string $branch) : bool; } \ No newline at end of file diff --git a/app/src/Lib/Git/GitShell.php b/app/src/Lib/Git/GitShell.php index 74a65be4..bd3cc7bb 100644 --- a/app/src/Lib/Git/GitShell.php +++ b/app/src/Lib/Git/GitShell.php @@ -126,23 +126,4 @@ public function getRemotes(string $path) : array return $arr; } - - public function isBranchInRepo(string $path, string $url, string $branch) : bool - { - $cmd = [ - "git", - "ls-remote", - "--heads", - $url, - "refs/heads/$branch" - ]; - - $this->logger->info("Get remote repos for $path"); - $result = $this->run($cmd, $this->logger); - - if ($result == "") { - return false; - } - return true; - } } \ No newline at end of file diff --git a/setup/updates/update-20250924.sh b/setup/updates/update-20250924.sh new file mode 100644 index 00000000..25943811 --- /dev/null +++ b/setup/updates/update-20250924.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +doil_update_20250924() { + cp -r ${SCRIPT_DIR}/../app/src/* /usr/local/lib/doil/app/src/ + + return $? +} \ No newline at end of file