-
Notifications
You must be signed in to change notification settings - Fork 8
/
prepare.sh
executable file
·50 lines (40 loc) · 1.67 KB
/
prepare.sh
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
#!/usr/bin/bash
RET_NO_RPMS_IN_BREW=7
RET_NO_RPMS_IN_REPOS=8
RET_EMPTY_REPOQUERY=11
set -e
# sanity checks
[ -z "$TASK_ID" ] && { echo "TASK_ID missing in the environment"; exit 1; }
[ -z "$PROFILE_NAME" ] && { echo "PROFILE_NAME missing in the environment"; exit 1; }
# install mini-tps
dnf -y copr enable @osci/mini-tps
dnf -y install mini-tps
dnf -y copr disable @osci/mini-tps
# make sure mini-tps can find Koji
# TODO: can mini-tps RPM package provide this configuration automatically?
mkdir -p /var/tmp/mini-tps/ /usr/local/libexec/mini-tps/
cat << EOF > /var/tmp/mini-tps/env
export BREWHUB=https://koji.fedoraproject.org/kojihub
export BREWROOT=https://kojipkgs.fedoraproject.org
EOF
cp installability_runner.sh /usr/local/libexec/mini-tps/installability_runner.sh
chmod +x /usr/local/libexec/mini-tps/installability_runner.sh
. /var/tmp/mini-tps/env
# from now on, not all non-zero return codes are real errors
set +e
# prepare the system for testing
mtps-prepare-system -p "${PROFILE_NAME}" --fixrepo --enablebuildroot
mtps-get-task --createrepo --installrepofile --recursive --task="$TASK_ID" --download=/var/lib/brew-repo
rc="$?"
if [[ "$rc" -ne 0 ]]; then
if [[ "$rc" -eq $RET_NO_RPMS_IN_BREW || "$rc" -eq $RET_NO_RPMS_IN_REPOS || "$rc" -eq $RET_EMPTY_REPOQUERY ]]; then
echo "Skipped. See 'download build' (or /prepare) logs for info." > SKIP_TEST
else # unknown error
exit "$rc"
fi
fi
if [ -n "$ADDITIONAL_TASK_IDS" ]; then
for additional_task_id in ${ADDITIONAL_TASK_IDS}; do
mtps-get-task --createrepo --installrepofile --recursive --task="$additional_task_id" --download='/var/lib/repo-for-side-tag' --repofilename=side-tag
done
fi