Skip to content

Commit 3178860

Browse files
authored
Update host name of the repositories (#82)
* Update host name of the repositories * Update elastio-repo package version
1 parent 64f27b8 commit 3178860

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

scripts/install-elastio.sh

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ cent_fedora_install()
7676
esac
7777
fi
7878

79-
# The elastio-repo package is going to be moved from the x86_64/Packages to the noarch/Packages
80-
# This process can take some time and the package location can be different between branches for
81-
# some period of time. That's why trying both paths.
82-
url=$repo_url/rpm/$1/$2/noarch/Packages/elastio-repo-0.0.2-1.$3$2.noarch.rpm
83-
if (($(curl -s -I -L -m 2 "$url" | grep -E "^HTTP" | awk '{ print $2 }' | tail -1) != 200)) ; then
84-
url=$repo_url/rpm/$1/$2/x86_64/Packages/elastio-repo-0.0.2-1.$3$2.noarch.rpm
85-
fi
79+
# Looking for the latest version of the elastio-repo package from 0.0.3 to 0.0.1
80+
for pkg_version in $(seq 3 -1 1); do
81+
repo_package_url=$repo_url/rpm/$1/$2/noarch/Packages/elastio-repo-0.0.$pkg_version-1.$3$2.noarch.rpm
82+
83+
if (($(curl -sIL -m 2 "$repo_package_url" -w "%{http_code}" | tail -1) == 200)) ; then
84+
break
85+
fi
86+
done
8687

87-
rpm --import https://repo.assur.io/GPG-KEY-elastio
88-
yum localinstall -y $url
88+
rpm --import https://$repo_host/GPG-KEY-elastio
89+
yum localinstall -y $repo_package_url
8990
which dnf >/dev/null 2>&1 &&
9091
cent8_fedora_install $1 $2 $3 ||
9192
cent7_amazon_install $1 $2 $3
@@ -125,8 +126,17 @@ deb_ubu_install()
125126
inst_name=${dist_name^}
126127
fi
127128

128-
repo_package=elastio-repo_0.0.2-1${dist_name}${dist_ver_dot}_all.deb
129-
wget $repo_url/deb/${inst_name}/${inst_ver}/pool/$repo_package
129+
# Looking for the latest version of elastio-repo package from 0.0.3 to 0.0.1
130+
for pkg_version in $(seq 3 -1 1); do
131+
repo_package=elastio-repo_0.0.${pkg_version}-1${dist_name}${dist_ver_dot}_all.deb
132+
repo_package_url=$repo_url/deb/${inst_name}/${inst_ver}/pool/$repo_package
133+
134+
if (($(curl -sIL -m 2 "$repo_package_url" -w "%{http_code}" | tail -1) == 200)) ; then
135+
break
136+
fi
137+
done
138+
139+
wget $repo_package_url
130140
dpkg -i $repo_package && rm -f $repo_package
131141
apt-get update
132142
# Maybe new kernel was installed recently but machine was not yet booted into it.
@@ -229,7 +239,15 @@ fi
229239
set -e
230240

231241
[ -z "$branch" ] && branch=$default_branch
232-
repo_url=https://repo.assur.io/$branch/linux
242+
243+
repo_host="repo.elastio.us"
244+
case "$branch" in
245+
"nightly"|"release-candidate"|"release")
246+
repo_host="repo.elastio.com"
247+
;;
248+
esac
249+
250+
repo_url="https://$repo_host/$branch/linux"
233251

234252
if [ ! -z "$uninstall" ]; then
235253
uninstall_all

0 commit comments

Comments
 (0)