From caef43ec59f9d1ab9e4496402a4be9b6e0b79280 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 30 Sep 2022 11:49:18 +0200 Subject: [PATCH] fix: Ensured use of HTTP_PROXY_URL in update job --- lib/update-bridgehead.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/update-bridgehead.sh b/lib/update-bridgehead.sh index b6cd317..6b4e0fe 100755 --- a/lib/update-bridgehead.sh +++ b/lib/update-bridgehead.sh @@ -26,9 +26,15 @@ for DIR in /etc/bridgehead $(pwd); do git -C $DIR config credential.helper "$CREDHELPER" fi old_git_hash="$(git -C $DIR rev-parse --verify HEAD)" - git -C $DIR fetch 2>&1 - git -C $DIR pull 2>&1 - new_git_hash="$(git -C $DIR rev-parse --verify HEAD)" + if [ -z "$HTTP_PROXY_URL" ]; then + log "INFO" "Git is using no proxy!" + git -C $DIR fetch 2>&1 + git -C $DIR pull 2>&1 + else + log "INFO" "Git is using proxy ${HTTP_PROXY_URL} from ${CONFFILE}" + git -c http.proxy=$HTTP_PROXY_URL -c http.proxy=$HTTP_PROXY_URL -C $DIR fetch 2>&1 + git -c http.proxy=$HTTP_PROXY_URL -c http.proxy=$HTTP_PROXY_URL -C $DIR pull 2>&1 + fi new_git_hash="$(git -C $DIR rev-parse --verify HEAD)" git_updated="false" if [ "$old_git_hash" != "$new_git_hash" ]; then log "INFO" "Updated git repository in ${DIR} from commit $old_git_hash to $new_git_hash"