-
Notifications
You must be signed in to change notification settings - Fork 1
/
debian_chrootbuild
executable file
·64 lines (59 loc) · 2.29 KB
/
debian_chrootbuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -uex
if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then
echo "MIRRORSITE=${ARTIFACTORY_URL}artifactory/ubuntu-proxy" | sudo tee /root/.pbuilderrc
fi
# shellcheck disable=SC2086
sudo pbuilder create \
--extrapackages "gnupg ca-certificates" \
$DISTRO_ID_OPT
repo_args=""
repos_added=()
for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
branch="master"
build_number="lastSuccessfulBuild"
if [[ $repo = *@* ]]; then
branch="${repo#*@}"
repo="${repo%@*}"
if [[ $branch = *:* ]]; then
build_number="${branch#*:}"
branch="${branch%:*}"
fi
fi
if [[ " ${repos_added[*]} " = *\ ${repo}\ * ]]; then
# don't add duplicates, first found wins
continue
fi
repos_added+=("$repo")
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/ ./"
done
repo_args+="|$(curl -sSf "$REPO_FILE_URL"daos_ci-"$DISTRO"-artifactory.list |
sed -e 's/#.*//' -e '/ubuntu-proxy/d' -e '/^$/d' -e '/^$/d' \
-e 's/signed-by=.*\.gpg/trusted=yes/' |
sed -e ':a; N; $!ba; s/\n/|/g')"
for repo in $JOB_REPOS; do
repo_name=${repo##*://}
repo_name=${repo_name//\//_}
if [[ " ${repos_added[*]} " = *\ ${repo_name}\ * ]]; then
# don't add duplicates, first found wins
continue
fi
repos_added+=("$repo_name")
repo_args+="|deb ${repo} $VERSION_CODENAME main"
done
# NB: This PPA is needed to support modern go toolchains on ubuntu 20.04.
# After the build is updated to use 22.04, which supports go >= 1.18, it
# should no longer be needed.
repo_args="$repo_args|deb [trusted=yes] https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $VERSION_CODENAME main"
echo "$repo_args"
if [ "$repo_args" = "|" ]; then
repo_args=""
else
#repo_args="--othermirror"${repo_args#|}\""
repo_args="${repo_args#|}"
fi
cd "$DEB_TOP"
# shellcheck disable=SC2086
sudo pbuilder update --override-config $DISTRO_ID_OPT ${repo_args:+--othermirror "$repo_args"}
# fail the build if the *.symbols file(s) need updating
sudo DPKG_GENSYMBOLS_CHECK_LEVEL="${DPKG_GENSYMBOLS_CHECK_LEVEL:-4}" pbuilder build "$DEB_DSC"