migrating elastic,ELK,erlang,gitlab-ce

This commit is contained in:
z4yx 2020-04-05 13:44:16 +08:00
parent c384adafae
commit e8c9b17760
4 changed files with 10 additions and 61 deletions

8
ELK.sh
View File

@ -3,9 +3,7 @@ set -e
set -o pipefail set -o pipefail
_here=`dirname $(realpath $0)` _here=`dirname $(realpath $0)`
. ${_here}/helpers/apt-download apt_sync="${_here}/apt-sync.py"
[ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
BASE_PATH="${TUNASYNC_WORKING_DIR}" BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://packages.elastic.co"} BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://packages.elastic.co"}
@ -33,9 +31,7 @@ for repo in "${!REPO_VERSIONS[@]}"; do
echo $repo-$version echo $repo-$version
apt_url="${BASE_URL}/${repo}/${version}/debian" apt_url="${BASE_URL}/${repo}/${version}/debian"
dest_path="${APT_PATH}/${repo}/${version}" dest_path="${APT_PATH}/${repo}/${version}"
[[ ! -d ${dest_path} ]] && mkdir -p ${dest_path} "$apt_sync" "$apt_url" stable main amd64,i386 "$dest_path"
apt-download-binary ${apt_url} "stable" "main" "amd64" "${dest_path}" || true
apt-download-binary ${apt_url} "stable" "main" "i386" "${dest_path}" || true
done done
done done

View File

@ -3,9 +3,7 @@ set -e
set -o pipefail set -o pipefail
_here=`dirname $(realpath $0)` _here=`dirname $(realpath $0)`
. ${_here}/helpers/apt-download apt_sync="${_here}/apt-sync.py"
[ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://artifacts.elastic.co"} BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://artifacts.elastic.co"}
@ -20,18 +18,9 @@ APT_PATH="${BASE_PATH}/apt"
mkdir -p ${YUM_PATH} ${APT_PATH} mkdir -p ${YUM_PATH} ${APT_PATH}
# =================== APT repos =============================== # =================== APT repos ===============================
if [[ ! -z ${DRY_RUN:-} ]]; then
export APT_DRY_RUN=1
fi
for elsver in "${ELASTIC_VERSION[@]}"; do for elsver in "${ELASTIC_VERSION[@]}"; do
mkdir -p ${BASE_PATH}/${elsver} "$apt_sync" "${BASE_URL}/packages/${elsver}/apt" stable main amd64,i386 "${APT_PATH}/${elsver}"
apt_url="${BASE_URL}/packages/${elsver}/apt"
dest_path="${APT_PATH}/${elsver}"
apt-download-binary ${apt_url} "stable" "main" "amd64" "${dest_path}" || true
apt-download-binary ${apt_url} "stable" "main" "i386" "${dest_path}" || true
(cd ${BASE_PATH}/${elsver}; ln -sf ../apt/${elsver} apt) (cd ${BASE_PATH}/${elsver}; ln -sf ../apt/${elsver} apt)
done done

View File

@ -3,9 +3,7 @@ set -e
set -o pipefail set -o pipefail
_here=`dirname $(realpath $0)` _here=`dirname $(realpath $0)`
. ${_here}/helpers/apt-download apt_sync="${_here}/apt-sync.py"
[ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
BASE_PATH="${TUNASYNC_WORKING_DIR}" BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL="https://packages.erlang-solutions.com" BASE_URL="https://packages.erlang-solutions.com"
@ -14,29 +12,12 @@ YUM_PATH="${BASE_PATH}/centos"
UBUNTU_PATH="${BASE_PATH}/ubuntu" UBUNTU_PATH="${BASE_PATH}/ubuntu"
DEBIAN_PATH="${BASE_PATH}/debian" DEBIAN_PATH="${BASE_PATH}/debian"
UBUNTU_VERSIONS=("trusty" "xenial" "bionic")
DEBIAN_VERSIONS=("wheezy" "jessie" "stretch" "buster")
EL_VERSIONS=("6" "7" "8") EL_VERSIONS=("6" "7" "8")
# =================== APT repos =============================== # =================== APT repos ===============================
if [[ ! -z ${DRY_RUN:-} ]]; then "$apt_sync" "${BASE_URL}/ubuntu" @ubuntu-lts contrib amd64,i386 "$UBUNTU_PATH"
export APT_DRY_RUN=1
fi
base_url="${BASE_URL}/ubuntu"
for version in ${UBUNTU_VERSIONS[@]}; do
for arch in "amd64" "i386"; do
apt-download-binary ${base_url} "$version" "contrib" "$arch" "${UBUNTU_PATH}" || true
done
done
echo "Ubuntu finished" echo "Ubuntu finished"
"$apt_sync" "${BASE_URL}/debian" @debian-current contrib amd64,i386 "$DEBIAN_PATH"
base_url="${BASE_URL}/debian"
for version in ${DEBIAN_VERSIONS[@]}; do
for arch in "amd64" "i386"; do
apt-download-binary ${base_url} "$version" "contrib" "$arch" "${DEBIAN_PATH}" || true
done
done
echo "Debian finished" echo "Debian finished"
# =================== YUM repos =============================== # =================== YUM repos ===============================

View File

@ -3,9 +3,7 @@ set -e
set -o pipefail set -o pipefail
_here=`dirname $(realpath $0)` _here=`dirname $(realpath $0)`
. ${_here}/helpers/apt-download apt_sync="${_here}/apt-sync.py"
[ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/gitlab/gitlab-ce"} UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/gitlab/gitlab-ce"}
@ -14,8 +12,6 @@ BASE_PATH="${TUNASYNC_WORKING_DIR}"
YUM_PATH="${BASE_PATH}/yum" YUM_PATH="${BASE_PATH}/yum"
EL_VERSIONS=(6 7 8) EL_VERSIONS=(6 7 8)
UBUNTU_VERSIONS=("trusty" "xenial" "bionic")
DEBIAN_VERSIONS=("wheezy" "jessie" "stretch" "buster")
UBUNTU_PATH="${BASE_PATH}/ubuntu/" UBUNTU_PATH="${BASE_PATH}/ubuntu/"
DEBIAN_PATH="${BASE_PATH}/debian/" DEBIAN_PATH="${BASE_PATH}/debian/"
@ -49,22 +45,9 @@ if [[ -z ${DRY_RUN:-} ]]; then
fi fi
rm $cfg rm $cfg
if [[ ! -z ${DRY_RUN:-} ]]; then "$apt_sync" "${UPSTREAM}/ubuntu" @ubuntu-lts main amd64,i386 "$UBUNTU_PATH"
export APT_DRY_RUN=1
fi
base_url="${UPSTREAM}/ubuntu"
for version in ${UBUNTU_VERSIONS[@]}; do
apt-download-binary ${base_url} "$version" "main" "amd64" "${UBUNTU_PATH}" || true
apt-download-binary ${base_url} "$version" "main" "i386" "${UBUNTU_PATH}" || true
done
echo "Ubuntu finished" echo "Ubuntu finished"
"$apt_sync" "${UPSTREAM}/debian" @debian-current main amd64,i386 "$DEBIAN_PATH"
base_url="${UPSTREAM}/debian"
for version in ${DEBIAN_VERSIONS[@]}; do
apt-download-binary ${base_url} "$version" "main" "amd64" "${DEBIAN_PATH}" || true
apt-download-binary ${base_url} "$version" "main" "i386" "${DEBIAN_PATH}" || true
done
echo "Debian finished" echo "Debian finished"