Using bridgehead user for performing git pull

Otherwise problems can arise with authentication.
This commit is contained in:
Gerhard Salvini
2024-07-16 16:06:10 +02:00
parent a8a15aaad8
commit 5b2c3d7725
3 changed files with 11 additions and 6 deletions

View File

@ -258,7 +258,8 @@ function clone_repo_if_nonexistent() {
cd "$target_dir"
# Checkout the specified branch
git checkout "$branch_name"
chown -R bridgehead .
su bridgehead -c "git checkout $branch_name"
echo "Checked out branch '$branch_name'."
cd -
@ -286,8 +287,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 +298,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 -
}