fix scripts

This commit is contained in:
z4yx 2020-04-05 13:28:20 +08:00
parent 2835a3d4fa
commit 52d23375e1
2 changed files with 3 additions and 50 deletions

View File

@ -4,7 +4,7 @@ set -e
set -o pipefail set -o pipefail
_here=`dirname $(realpath $0)` _here=`dirname $(realpath $0)`
alias apt-sync="${_here}/apt-sync.py" apt_sync="${_here}/apt-sync.py"
BASE_PATH="${TUNASYNC_WORKING_DIR}" BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL="${TUNASYNC_UPSTREAM_URL:-"https://repo.mysql.com"}" BASE_URL="${TUNASYNC_UPSTREAM_URL:-"https://repo.mysql.com"}"
@ -26,9 +26,9 @@ mkdir -p ${YUM_PATH} ${UBUNTU_PATH} ${DEBIAN_PATH}
# =================== APT repos =============================== # =================== APT repos ===============================
MYSQL_APT_REPOS="mysql-5.6,mysql-5.7,mysql-tools,connector-python-2.1,mysql-8.0" MYSQL_APT_REPOS="mysql-5.6,mysql-5.7,mysql-tools,connector-python-2.1,mysql-8.0"
apt-sync "${BASE_URL}/apt/ubuntu" @ubuntu-lts $MYSQL_APT_REPOS amd64,i386 "${UBUNTU_PATH}" "$apt_sync" "${BASE_URL}/apt/ubuntu" @ubuntu-lts $MYSQL_APT_REPOS amd64,i386 "${UBUNTU_PATH}"
echo "Ubuntu finished" echo "Ubuntu finished"
apt-sync "${BASE_URL}/apt/debian" @debian-current $MYSQL_APT_REPOS amd64,i386 "${DEBIAN_PATH}" "$apt_sync" "${BASE_URL}/apt/debian" @debian-current $MYSQL_APT_REPOS amd64,i386 "${DEBIAN_PATH}"
echo "Debian finished" echo "Debian finished"
# =================== YUM/DNF repos ========================== # =================== YUM/DNF repos ==========================

View File

@ -1,47 +0,0 @@
#!/bin/bash
# requires: createrepo reposync wget curl
set -e
set -o pipefail
_here=`dirname $(realpath $0)`
alias apt-sync="${_here}/apt-sync.py"
BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://repo.percona.com"}
YUM_PATH="${BASE_PATH}/yum"
APT_PATH="${BASE_PATH}/apt"
EL_VERSIONS=("6" "7")
# =================== APT repos ===============================
apt-sync "${BASE_URL}/apt" @debian-current,@ubuntu-lts main amd64,i386 "${APT_PATH}"
echo "APT finished"
# =================== YUM/DNF repos ==========================
mkdir -p ${YUM_PATH}
cache_dir="/tmp/yum-percona-cache/"
cfg="/tmp/yum-percona.conf"
cat <<EOF > ${cfg}
[main]
keepcache=0
EOF
for elver in ${EL_VERSIONS[@]}; do
cat << EOF >> $cfg
[el${elver}]
name=el${elver}
baseurl=${BASE_URL}/centos/$elver/os/x86_64/
enabled=1
EOF
done
if [[ -z ${DRY_RUN:-} ]]; then
reposync -c $cfg -d -p ${YUM_PATH} -e $cache_dir
for elver in ${EL_VERSIONS[@]}; do
createrepo --update -v -c $cache_dir -o ${YUM_PATH}/el${elver}/ ${YUM_PATH}/el${elver}/
done
fi
rm $cfg