From c15c3962a7b6ebf3facf87068ce882fd24cd03e0 Mon Sep 17 00:00:00 2001 From: DavidCroftDKFZ <46788708+DavidCroftDKFZ@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:24:37 +0200 Subject: [PATCH] Switched to bridgehead user for git to avoid auth problems --- lib/functions.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/functions.sh b/lib/functions.sh index 112e8d6..9c4f80d 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -258,8 +258,8 @@ function clone_repo_if_nonexistent() { cd "$target_dir" # Checkout the specified branch - git checkout "$branch_name" - echo "Checked out branch '$branch_name'." + chown -R bridgehead . + su bridgehead -c "git checkout $branch_name" cd - } @@ -286,8 +286,9 @@ function build_transfair() { # 2. There is no data lock file (which means that no ETL has yet been run). if ls ../ecdc/data/*.[cC][sS][vV] 1> /dev/null 2>&1 && [ ! -f ../ecdc/data/lock ]; then cd $base_dir/transfair - git pull + su bridgehead -c "git pull" docker build --progress=plain -t samply/transfair --no-cache . + chown -R bridgehead . cd - fi } @@ -296,8 +297,9 @@ function build_focus() { local base_dir="$1" cd $base_dir/focus - git pull + su bridgehead -c "git pull" docker build --progress=plain -f DockerfileWithBuild -t samply/focus --no-cache . + chown -R bridgehead . cd - }