fix: Ensured use of HTTP_PROXY_URL in update job

This commit is contained in:
Torben Brenner 2022-09-30 11:49:18 +02:00
parent ab7565b150
commit caef43ec59
1 changed files with 9 additions and 3 deletions

View File

@ -26,9 +26,15 @@ for DIR in /etc/bridgehead $(pwd); do
git -C $DIR config credential.helper "$CREDHELPER" git -C $DIR config credential.helper "$CREDHELPER"
fi fi
old_git_hash="$(git -C $DIR rev-parse --verify HEAD)" old_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 fetch 2>&1
git -C $DIR pull 2>&1 git -C $DIR pull 2>&1
new_git_hash="$(git -C $DIR rev-parse --verify HEAD)" 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" git_updated="false"
if [ "$old_git_hash" != "$new_git_hash" ]; then if [ "$old_git_hash" != "$new_git_hash" ]; then
log "INFO" "Updated git repository in ${DIR} from commit $old_git_hash to $new_git_hash" log "INFO" "Updated git repository in ${DIR} from commit $old_git_hash to $new_git_hash"