Skip to content

Commit d19c7fe

Browse files
authored
fix(utils): add centos 8 repo patch (#167)
1 parent 5ee99ef commit d19c7fe

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/package-apisix-dashboard-rpm-el8.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ jobs:
4949
5050
- name: Install rpm package
5151
run: |
52+
docker exec centos8Instance bash -c "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*"
53+
docker exec centos8Instance bash -c "sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*"
54+
docker exec centos8Instance bash -c "dnf install -y centos-release-stream"
55+
docker exec centos8Instance bash -c "dnf swap -y centos-{linux,stream}-repos"
56+
docker exec centos8Instance bash -c "dnf distro-sync -y"
57+
5258
docker exec centos8Instance bash -c "yum install -y /apisix-dashboard/apisix-dashboard-${DASHBOARD_VERSION}-0.el8.x86_64.rpm"
5359
docker logs centos8Instance
5460
docker exec centos8Instance bash -c "cd /usr/local/apisix/dashboard/ && nohup ./manager-api &"

utils/install-common.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,37 @@
22
set -euo pipefail
33
set -x
44

5+
patch_centos8_repo() {
6+
if [[ $(rpm --eval '%{centos_ver}') != "8" ]]; then
7+
return
8+
fi
9+
# switch yum repo source
10+
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
11+
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
12+
13+
# rebuild repo cache
14+
dnf install -y centos-release-stream
15+
dnf swap -y centos-{linux,stream}-repos
16+
dnf distro-sync -y
17+
}
18+
519
install_apisix_dependencies_deb() {
620
install_dependencies_deb
721
install_openresty_deb
822
install_luarocks
923
}
1024

1125
install_apisix_dependencies_rpm() {
26+
patch_centos8_repo
27+
1228
install_dependencies_rpm
1329
install_openresty_rpm
1430
install_luarocks
1531
}
1632

1733
install_dependencies_rpm() {
34+
patch_centos8_repo
35+
1836
# install basic dependencies
1937
yum -y install wget tar gcc automake autoconf libtool make curl git which unzip sudo
2038
yum -y install epel-release
@@ -110,6 +128,8 @@ install_golang() {
110128
}
111129

112130
install_dashboard_dependencies_rpm() {
131+
patch_centos8_repo
132+
113133
yum install -y wget curl git which gcc make
114134
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
115135
sh -c "$(curl -fsSL https://rpm.nodesource.com/setup_14.x)"

0 commit comments

Comments
 (0)