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 - }