Skip to content

Commit 1dd9bcb

Browse files
authored
scripts: allow to configure PROXMOX_GIT_URL (#102)
1 parent df28817 commit 1dd9bcb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

scripts/build/git-clone.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then
77
exit 1
88
fi
99

10+
PROXMOX_GIT_URL="${PROXMOX_GIT_URL:-git://git.proxmox.com/git}"
11+
1012
perform() {
1113
if [[ ! -d "$1" ]]; then
12-
git clone "git://git.proxmox.com/git/${3:-$1}.git" "$1"
14+
git clone "${PROXMOX_GIT_URL}/${3:-$1}.git" "$1"
1315
else
1416
git -C "$1" fetch
1517
fi
@@ -24,7 +26,9 @@ perform() {
2426
}
2527

2628
while read REPO COMMIT_SHA REST; do
29+
[[ -n "$REPO" ]] || continue
2730
[[ -n "$2" ]] && [[ "$REPO" != "$2" ]] && continue
31+
2832
echo "$REPO $COMMIT_SHA..." 1>&2
2933
REPO_URL=${REST%%#*}
3034
( perform "$REPO" "$COMMIT_SHA" $REPO_URL )

scripts/update-version.bash

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
2525
SCRIPT_ROOT=$(realpath "$0")
2626
ROOT_REV="${2}"
2727
ROOT_TS=""
28+
PROXMOX_GIT_URL="${PROXMOX_GIT_URL:-git://git.proxmox.com/git}"
2829

2930
if [[ -z "$TMP_DIR" ]]; then
3031
export TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX)
@@ -33,7 +34,9 @@ if [[ -z "$TMP_DIR" ]]; then
3334
fi
3435

3536
perform() {
36-
[[ -d "$1" ]] || git clone "git://git.proxmox.com/git/${3:-$1}.git" "$1" 2>/dev/null
37+
if [[ ! -d "$1" ]]; then
38+
git clone "${PROXMOX_GIT_URL}/${3:-$1}.git" "$1" 2>/dev/null
39+
fi
3740

3841
if [[ "$ROOT_REV" == "HEAD" ]] || [[ -z "$ROOT_TS" ]]; then
3942
REPO_REV=$(git -C "$1" rev-parse "${ROOT_REV:-HEAD}")
@@ -54,6 +57,8 @@ perform() {
5457
}
5558

5659
while read REPO COMMIT_SHA REST; do
60+
[[ -n "$REPO" ]] || continue
61+
5762
echo "$REPO $COMMIT_SHA..." 1>&2
5863
REPO_TS=
5964
REPO_REV=

0 commit comments

Comments
 (0)