22
33set -uex
44
5+ : " ${REPO_FILE_URL:= } "
6+ : " ${HTTPS_PROXY:= } "
7+
8+ # Currently not fully working behind a proxy
59if [ -n " ${ARTIFACTORY_URL:- } " ] && " $LOCAL_REPOS " ; then
6- echo " MIRRORSITE=${ARTIFACTORY_URL} artifactory/ubuntu-proxy" | sudo tee /root/.pbuilderrc
10+ pbuilderrc=" ./pbuilder_rc.txt"
11+ rm -f " $pbuilderrc "
12+ if [ -n " ${HTTPS_PROXY} " ]; then
13+ echo " export http_proxy=\" ${HTTPS_PROXY} \" " >> " $pbuilderrc "
14+ else
15+ echo " MIRRORSITE=${ARTIFACTORY_URL} /ubuntu-proxy/ubuntu" > " $pbuilderrc "
16+ fi
17+ # if [ -n "$REPO_FILE_URL" ]; then
18+ # direct="${REPO_FILE_URL##*//}"
19+ # direct="${direct%%/*}"
20+ # echo "no_proxy=\"${direct}\"" >> "$pbuilderrc"
21+ # fi
22+ # shellcheck disable=SC2002
23+ cat " $pbuilderrc " | sudo tee /root/.pbuilderrc
724fi
825
926# shellcheck disable=SC2086
1027sudo pbuilder create \
1128 --extrapackages " gnupg ca-certificates" \
12- $DISTRO_ID_OPT
29+ $DISTRO_ID_OPT || true # Ignore error status for now.
1330
1431repo_args=" "
1532repos_added=()
33+ # currently a bit broken, pbuilder will not accept user provided CAs.
1634for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS ; do
1735 branch=" master"
1836 build_number=" lastSuccessfulBuild"
@@ -32,31 +50,34 @@ for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
3250 repo_args=" $repo_args |deb [trusted=yes] ${JENKINS_URL:- https:// build.hpdd.intel.com/ } job/daos-stack/job/$repo /job/$branch /$build_number /artifact/artifacts/$DISTRO / ./"
3351done
3452
35- repo_args+=" |$( curl -sSf " $REPO_FILE_URL " daos_ci-" $DISTRO " -artifactory.list |
36- sed -e ' s/#.*//' -e ' /ubuntu-proxy/d' -e ' /^$/d' -e ' /^$/d' \
37- -e ' s/signed-by=.*\.gpg/trusted=yes/' |
38- sed -e ' :a; N; $!ba; s/\n/|/g' ) "
39- for repo in $JOB_REPOS ; do
40- repo_name=${repo##*:// }
41- repo_name=${repo_name// \/ / _}
42- if [[ " ${repos_added[*]} " = * \ ${repo_name} \ * ]]; then
43- # don't add duplicates, first found wins
44- continue
45- fi
46- repos_added+=(" $repo_name " )
47- repo_args+=" |deb ${repo} $VERSION_CODENAME main"
48- done
49- # NB: This PPA is needed to support modern go toolchains on ubuntu 20.04.
50- # After the build is updated to use 22.04, which supports go >= 1.18, it
51- # should no longer be needed.
52- repo_args=" $repo_args |deb [trusted=yes] https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $VERSION_CODENAME main"
53- echo " $repo_args "
54- if [ " $repo_args " = " |" ]; then
55- repo_args=" "
56- else
57- # repo_args="--othermirror"${repo_args#|}\""
58- repo_args=" ${repo_args# |} "
59- fi
53+ # currently broken, builder will not accept internal certs.
54+ # repo_args+="|$(curl -sSf "$REPO_FILE_URL"daos_ci-"$DISTRO"-artifactory.list |
55+ # sed -e 's/#.*//' -e '/ubuntu-proxy/d' -e '/^$/d' -e '/^$/d' \
56+ # -e 's/signed-by=.*\.gpg/trusted=yes/' |
57+ # sed -e ':a; N; $!ba; s/\n/|/g')"
58+ # for repo in $JOB_REPOS; do
59+ # repo_name=${repo##*://}
60+ # repo_name=${repo_name//\//_}
61+ # if [[ " ${repos_added[*]} " = *\ ${repo_name}\ * ]]; then
62+ # # don't add duplicates, first found wins
63+ # continue
64+ # fi
65+ # repos_added+=("$repo_name")
66+ # repo_args+="|deb ${repo} $VERSION_CODENAME main"
67+ # done
68+
69+ # # NB: This PPA is needed to support modern go toolchains on ubuntu 20.04.
70+ # # After the build is updated to use 22.04, which supports go >= 1.18, it
71+ # # should no longer be needed.
72+ # currently broken - claim is public key not available.
73+ # repo_args="$repo_args|deb [trusted=yes] https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $VERSION_CODENAME main"
74+ # echo "$repo_args"
75+ # if [ "$repo_args" = "|" ]; then
76+ # repo_args=""
77+ # else
78+ # #repo_args="--othermirror"${repo_args#|}\""
79+ # repo_args="${repo_args#|}"
80+ # fi
6081cd " $DEB_TOP "
6182# shellcheck disable=SC2086
6283sudo pbuilder update --override-config $DISTRO_ID_OPT ${repo_args: +--othermirror " $repo_args " }
0 commit comments