-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpm_chrootbuild
More file actions
executable file
·91 lines (80 loc) · 2.91 KB
/
rpm_chrootbuild
File metadata and controls
executable file
·91 lines (80 loc) · 2.91 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
set -uex
# shellcheck disable=SC2153
IFS=\| read -r -a distro_base_local_repos <<< "$DISTRO_BASE_LOCAL_REPOS"
repo_adds=()
repo_dels=()
: "${DISTRO_NAME:=$DISTRO}"
if [[ "${CHROOT_NAME}" = epel-8-* ]]; then
: "${DAOS_STACK_CENTOS_8_VERSION:=8}"
DISTRO_NAME="centos-${DAOS_STACK_CENTOS_8_VERSION}"
elif [[ "${CHROOT_NAME}" = opensuse-leap-15* ]]; then
: "${DAOS_STACK_LEAP_15_VERSION:=15.3}"
DISTRO_NAME="opensuse-${DAOS_STACK_LEAP_15_VERSION}"
fi
: "${REPOSITORY_URL:=}"
if [ -n "$REPOSITORY_URL" ] && [ -n "$DISTRO_REPOS" ]; then
repo_dels+=("--disablerepo=\*")
elif [ "${CHROOT_NAME}" == "epel-8-x86_64" ]; then
# Special code to force building on CentOS 8.3
if [ "${DOT_VER}" -eq 3 ]; then
repo_dels+=("--disablerepo=\*")
repo_base='http://mirror.centos.org/centos/8.3.2011/'
distro_base_local_repos=(\
"${repo_base}BaseOS/x86_64/os/" \
"${repo_base}AppStream/x86_64/os/" \
"${repo_base}extras/x86_64/os/" \
"${repo_base}PowerTools/x86_64/os/" \
https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/ )
fi
fi
: "${WORKSPACE:=$PWD}"
mock_config_dir="$WORKSPACE/mock"
original_cfg_file="/etc/mock/${CHROOT_NAME}.cfg"
cfg_file="$mock_config_dir/${CHROOT_NAME}_daos.cfg"
mkdir -p "$mock_config_dir"
ln -sf /etc/mock/templates "$mock_config_dir/"
ln -sf /etc/mock/logging.ini "$mock_config_dir/"
cp "$original_cfg_file" "$cfg_file"
if [ "${CHROOT_NAME}" == "epel-8-x86_64" ]; then
echo -e "config_opts['module_enable'] = ['javapackages-tools:201801']" \
>> "$cfg_file"
if [ -n "${DOT_VER}" ]; then
echo -e "config_opts['macros']['%dist'] = '.el8_${DOT_VER}'" >> "$cfg_file"
fi
fi
echo -e "config_opts['yum.conf'] += \"\"\"\n" >> "$cfg_file"
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
repo_adds+=("--enablerepo $repo:$branch:$build_number")
echo -e "[$repo:$branch:$build_number]\n\
name=$repo:$branch:$build_number\n\
baseurl=${JENKINS_URL:-https://build.hpdd.intel.com/}job/daos-stack/job/$repo/job/$branch/$build_number/artifact/artifacts/$DISTRO_NAME/\n\
enabled=1\n\
gpgcheck=False\n" >> "$cfg_file"
done
for repo in $JOB_REPOS "${distro_base_local_repos[@]}"; do
repo_name=${repo##*://}
repo_name=${repo_name//\//_}
repo_adds+=("--enablerepo $repo_name")
echo -e "[${repo_name//@/_}]\n\
name=${repo_name}\n\
baseurl=${repo}\n\
enabled=1\n" >> "$cfg_file"
done
echo "\"\"\"" >> "$cfg_file"
# shellcheck disable=SC2086
eval mock --configdir "$mock_config_dir" -r "${CHROOT_NAME}_daos" \
"${repo_dels[*]}" "${repo_adds[*]}" \
$MOCK_OPTIONS $RPM_BUILD_OPTIONS "$TARGET"
# For now just do an advisory check
rpmlint "/var/lib/mock/${CHROOT_NAME}/result/"*.rpm || true