-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathci-update-yum
executable file
·263 lines (234 loc) · 6.92 KB
/
ci-update-yum
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#!/bin/sh
set -ev
cd /root
$HOME/ci-tools/ci-update-common
yum clean all
# Enable OpenStack repos for fence-agents build dependencies
case "${NODE_NAME}" in
rhel*x86*|rhel*power*)
rpm -qa | grep rhos-release || yum install -y http://download.eng.brq.redhat.com/rcm-guest/puddles/OpenStack/rhos-release/rhos-release-latest.noarch.rpm
RHELVER=$(echo $NODE_NAME | sed -e 's/rhel//g' -e 's/z-.*//g' | cut --characters 1-1,2-2 --output-delimiter '.')
echo "Detected RHEL version: $RHELVER"
;;
centos-7.2*)
EXTRAOPTS="--skip-broken"
;;
centos-7*)
yum install -y centos-release-openstack-stein epel-release
EXTRAOPTS="--skip-broken"
;;
centos-8*|anvil-ci-centos-8*|anvil-ci-bm*)
yum install -y centos-release-openstack-ussuri epel-release
;;
anvil-ci-centos-9*)
yum install -y epel-release
;;
esac
case "${NODE_NAME}" in
anvil-ci-centos-9*|anvil-ci-rhel-9*|centos-9*|rhel9*power9*)
cd /etc/yum.repos.d/
rm -rf delorean*.repo
wget https://trunk.rdoproject.org/centos9/current/delorean.repo
wget https://trunk.rdoproject.org/centos9-master-preview/delorean-deps.repo
;;
esac
case "${NODE_NAME}" in
anvil-ci*)
yum install -y fence-agents-common resource-agents mock wget rpm-build createrepo_c yum-utils
;;
esac
case "${NODE_NAME}" in
anvil-ci-bm*)
EXTRAOPTS="--exclude=neo4j --exclude=cypher-shell"
;;
esac
#case "${NODE_NAME}" in
# rhel7*x86*|rhel7*power*)
# rhos-release 14
# ;;
# rhel8*x86*|rhel8*power*)
# rhos-release 15
# ;;
#esac
# Disable repos that don´t exist or are "bad"
case "${NODE_NAME}" in
rhel7*power*)
yum-config-manager --save --setopt=rhelosp-14.0-optools-puddle.skip_if_unavailable=true
yum-config-manager --save --setopt=rhelosp-ceph-3-mon.skip_if_unavailable=true
yum-config-manager --save --setopt=rhelosp-ceph-3-osd.skip_if_unavailable=true
yum-config-manager --save --setopt=rhelosp-ceph-3-tools.skip_if_unavailable=true
yum-config-manager --save --setopt=rhelosp-rhel-${RHELVER}-ha.skip_if_unavailable=true
yum-config-manager --save --setopt=rhelosp-rhel-${RHELVER}-server.skip_if_unavailable=true
;;
esac
# not all yum based distro have python3, deal with it
if [ -z "$python" ]; then
python=python3
fi
POSTOPTS=""
case "${NODE_NAME}" in
rhel7*|centos-7*|jenkins-jumphost)
;;
*)
POSTOPTS="--nobest"
;;
esac
yum -y $EXTRAOPTS update $POSTOPTS
EXTRADEPS=""
case "${NODE_NAME}" in
*centos-7.2*)
PYTHONDEV="python34 python34-devel"
;;
*)
PYTHONDEV="python-devel python3-devel"
;;
esac
# Install special case packages
for i in $PYTHONDEV python3-setuptools python3-pip python3-rpm-macros platform-python-devel libzstd-devel libcgroup-devel; do
yum -y install $i || true
done
yum -y install systemd-python || yum -y install python3-systemd
EXTRADEPS="systemd-devel $EXTRADEPS"
# available only on ppc
yum -y install libservicelog-devel || true
# pcs builds only on recent distros
case "${NODE_NAME}" in
fedora*|rhel8*|centos-8*|centos-9*|anvil-ci*|rhel9*)
EXTRADEPS="ruby ruby-devel rubygems rubygem-bundler fontconfig liberation-sans-fonts overpass-fonts npm rpmdevtools python3-lxml python3-wheel python3-setuptools_scm python3-cryptography $EXTRADEPS"
;;
esac
# available only with python3
if [ "$python" = python3 ]; then
EXTRADEPS="execstack python3-pexpect python3-pycurl python3-suds python3-requests openwsman-python3 python3-pyroute2 python3-httplib2 $EXTRADEPS"
else
EXTRADEPS="pexpect openwsman-python python-suds python2-google-api-client python-requests $EXTRADEPS"
if [ "$epel" = new ]; then
EXTRADEPS="python-boto3 python-s3transfer $EXTRADEPS"
else
EXTRADEPS="python2-boto3 $EXTRADEPS"
fi
fi
# Cloud packages
case "${NODE_NAME}" in
rhel*s390*|rhel9*power*|centos*s390*|centos*power*|anvil*centos*9*)
;;
*centos-7.2*)
EXTRADEPS="python34"
;;
*)
EXTRADEPS="${python}-keystoneclient ${python}-keystoneauth1 ${python}-novaclient $EXTRADEPS"
if [ "$python" = python3 ]; then
for i in python3-boto3 python3-google-api-client; do
yum -y install $i || true
done
fi
;;
esac
# knet rust bindings
if [ -n "$RUSTBINDINGS" ] && [ "$RUSTBINDINGS" = yes ]; then
EXTRADEPS="$EXTRADEPS cargo rust bindgen clippy rustfmt"
fi
case "${NODE_NAME}" in
rhel9*|centos-9*|rhel8*|centos-8*)
EXTRADEPS="$EXTRADEPS rust cargo"
;;
esac
# shellcheck for resource-agents ci/build.sh
case "${NODE_NAME}" in
fedora*)
EXTRADEPS="ShellCheck $EXTRADEPS"
;;
esac
# annobin-annocheck is off sync on rhel85 power
case "${NODE_NAME}" in
*power*)
;;
*)
EXTRADEPS="annobin-annocheck $EXTRADEPS"
;;
esac
# rhel9 language pack
case "${NODE_NAME}" in
rhel9*)
EXTRADEPS="glibc-all-langpacks $EXTRADEPS"
;;
esac
yum -y install \
OpenIPMI-devel \
asciidoc \
autoconf \
automake \
bison \
byacc \
bzip2-devel \
check-devel \
clang \
curl \
dbus-devel \
docbook-style-xsl \
doxygen \
flex \
gcc \
gettext-devel \
git \
glib2-devel \
gnutls-devel \
groff \
help2man \
inkscape \
jq \
libaio-devel \
libblkid-devel \
libcmocka-devel \
libcurl-devel \
libffi-devel \
libgcrypt-devel \
libnet-devel \
libnl3-devel \
libqb-devel \
libtool \
libtool-ltdl-devel \
libuuid-devel \
libvirt-devel \
libxml2-devel \
libxslt \
libxslt-devel \
lksctp-tools-devel \
lz4-devel \
lzo-devel \
make \
net-snmp-devel \
ncurses-devel \
nss-devel \
nss-tools \
openssl-devel \
pam-devel \
perl \
psmisc \
rpm-build \
rpmlint \
rsync \
time \
valgrind \
which \
xz-devel \
zlib-devel \
$EXTRADEPS
case "${NODE_NAME}" in
*vapor*)
wget -O /etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt https://password.corp.redhat.com/RH-IT-Root-CA.crt
wget -O /etc/pki/ca-trust/source/anchors/Eng-CA.crt https://engineering.redhat.com/Eng-CA.crt
update-ca-trust
if [ ! -f $HOME/.config/openstack/clouds.yaml ]; then
echo "Install manually openstack cloud config!"
exit 1
fi
yum -y module enable python39
yum -y install brewkoji createrepo python39 python39-devel python39-pip
alternatives --set python3 /usr/bin/python3.9
pip3 uninstall --yes vapor || true
pip3 --disable-pip-version-check --use-feature=2020-resolver install --user colorlog "git+https://gitlab.cee.redhat.com/clusterqe/vapor.git@main#egg=vapor"
;;
esac
getent group haclient >/dev/null || groupadd -r haclient -g 189
getent passwd hacluster >/dev/null || useradd -r -g haclient -u 189 -s /sbin/nologin -c "cluster user" hacluster