forked from mariadb-corporation/mariadb-columnstore-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-repo.sh
executable file
·48 lines (40 loc) · 903 Bytes
/
setup-repo.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
#!/usr/bin/env sh
set -ex
REPOFILE='mariadb-columnstore'
if [ -n "$1" ]; then
REPOFILE=$1
fi
REPO_PACKAGES_URL=${PACKAGES_URL}
if [ -n "$2" ]; then
REPO_PACKAGES_URL=$2
fi
. /etc/os-release
ARCH=$(expr "$(uname -m)" : "arm64\|aarch64" > /dev/null && echo "arm64" || echo "amd64")
case "$ID" in
ubuntu|debian)
apt update -y
apt install -y ca-certificates
echo "deb [trusted=yes] ${REPO_PACKAGES_URL}/${ARCH}/ ${OS}/" > /etc/apt/sources.list.d/${REPOFILE}.list
cat /etc/apt/sources.list.d/${REPOFILE}.list
cat << EOF > /etc/apt/preferences
Package: *
Pin: origin cspkg.s3.amazonaws.com
Pin-Priority: 1700
EOF
apt update -y
;;
rocky|centos)
cat << EOF > /etc/yum.repos.d/${REPOFILE}.repo
[repo]
name=${REPOFILE}
baseurl=${REPO_PACKAGES_URL}/${ARCH}/${OS}
enabled=1
gpgcheck=0
module_hotfixes=1
EOF
;;
*)
echo "$ID is unknown!"
exit 1
;;
esac