migrating gitlab-runner,influx,termux

This commit is contained in:
z4yx 2020-04-05 14:04:07 +08:00
parent e8c9b17760
commit d79cf7823e
5 changed files with 21 additions and 90 deletions

View File

@ -67,7 +67,7 @@ def main():
os, comp, arch, os, comp, arch,
str(args.working_dir.absolute()), str(args.working_dir.absolute()),
filelist[1] ] filelist[1] ]
print(shell_args) # print(shell_args)
sp.run(shell_args) sp.run(shell_args)
if args.delete: if args.delete:
pass #TODO pass #TODO

View File

@ -4,16 +4,12 @@ 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}"
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/runner/gitlab-ci-multi-runner"}
YUM_PATH="${BASE_PATH}/yum" YUM_PATH="${BASE_PATH}/yum"
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/"
@ -53,22 +49,10 @@ if [[ -z ${DRY_RUN:-} ]]; then
fi fi
rm $cfg rm $cfg
if [[ ! -z ${DRY_RUN:-} ]]; then
export APT_DRY_RUN=1
fi
base_url="https://packages.gitlab.com/runner/gitlab-ci-multi-runner/ubuntu" "$apt_sync" "${UPSTREAM}/ubuntu" @ubuntu-lts main amd64,i386 "$UBUNTU_PATH"
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="https://packages.gitlab.com/runner/gitlab-ci-multi-runner/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"

View File

@ -4,16 +4,12 @@ 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}"
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/runner/gitlab-runner"}
YUM_PATH="${BASE_PATH}/yum" YUM_PATH="${BASE_PATH}/yum"
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/"
@ -64,23 +60,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="https://packages.gitlab.com/runner/gitlab-runner/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="https://packages.gitlab.com/runner/gitlab-runner/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"
# vim: ts=4 sts=4 sw=4 # vim: ts=4 sts=4 sw=4

View File

@ -4,9 +4,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://repos.influxdata.com"} BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://repos.influxdata.com"}
@ -15,8 +13,6 @@ YUM_PATH="${BASE_PATH}/yum"
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")
mkdir -p ${YUM_PATH} ${UBUNTU_PATH} ${DEBIAN_PATH} mkdir -p ${YUM_PATH} ${UBUNTU_PATH} ${DEBIAN_PATH}
@ -24,23 +20,10 @@ mkdir -p ${YUM_PATH} ${UBUNTU_PATH} ${DEBIAN_PATH}
wget -O ${BASE_PATH}/influxdb.key ${BASE_URL}/influxdb.key wget -O ${BASE_PATH}/influxdb.key ${BASE_URL}/influxdb.key
# =================== APT repos =============================== # =================== APT repos ===============================
if [[ ! -z ${DRY_RUN:-} ]]; then
export APT_DRY_RUN=1
fi
base_url="${BASE_URL}/ubuntu"
for version in ${UBUNTU_VERSIONS[@]}; do
for arch in "amd64" "i386" "armhf" "arm64"; do
apt-download-binary ${base_url} "$version" "stable" "$arch" "${UBUNTU_PATH}" || true
done
done
echo "Ubuntu finished"
base_url="${BASE_URL}/debian" "$apt_sync" "${BASE_URL}/ubuntu" @ubuntu-lts stable amd64,i386,armhf,arm64 "$UBUNTU_PATH"
for version in ${DEBIAN_VERSIONS[@]}; do echo "Ubuntu finished"
for arch in "amd64" "i386" "armhf" "arm64"; do "$apt_sync" "${BASE_URL}/debian" @debian-current stable amd64,i386,armhf,arm64 "$DEBIAN_PATH"
apt-download-binary ${base_url} "$version" "stable" "$arch" "${DEBIAN_PATH}" || true
done
done
echo "Debian finished" echo "Debian finished"

View File

@ -2,35 +2,17 @@
set -e set -e
_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)
WORKING_DIR="${TUNASYNC_WORKING_DIR}" WORKING_DIR="${TUNASYNC_WORKING_DIR}"
ARCHES=("aarch64" "all" "arm" "i686" "x86_64") ARCH_LIST="aarch64,all,arm,i686,x86_64"
function sync_one_repo() { "$apt_sync" --delete "https://dl.bintray.com/termux/termux-packages-24" stable main $ARCH_LIST "${WORKING_DIR}/termux-packages-24"
base_url="$1" "$apt_sync" --delete "https://dl.bintray.com/xeffyr/unstable-packages" unstable main $ARCH_LIST "${WORKING_DIR}/unstable-packages"
BASE_PATH="$2" "$apt_sync" --delete "https://dl.bintray.com/xeffyr/x11-packages" x11 main $ARCH_LIST "${WORKING_DIR}/x11-packages"
suite="$3" "$apt_sync" --delete "https://dl.bintray.com/grimler/science-packages-24" science stable $ARCH_LIST "${WORKING_DIR}/science-packages-24"
component="$4" "$apt_sync" --delete "https://dl.bintray.com/grimler/game-packages-24" games stable $ARCH_LIST "${WORKING_DIR}/game-packages-24"
[[ ! -d "$BASE_PATH" ]] && mkdir -p "$BASE_PATH" "$apt_sync" --delete "https://dl.bintray.com/grimler/termux-root-packages-24" root stable $ARCH_LIST "${WORKING_DIR}/termux-root-packages-24"
remote_filelist="${BASE_PATH}/filelist"
[[ -f $remote_filelist ]] && rm $remote_filelist
for arch in ${ARCHES[@]}; do
echo "start syncing: $base_url ${arch}"
apt-download-binary "${base_url}" "$suite" "$component" "${arch}" "${BASE_PATH}" ${remote_filelist} || true
done
apt-delete-old-debs ${BASE_PATH} $remote_filelist
}
sync_one_repo "https://dl.bintray.com/termux/termux-packages-24" "${WORKING_DIR}/termux-packages-24" stable main
sync_one_repo "https://dl.bintray.com/xeffyr/unstable-packages" "${WORKING_DIR}/unstable-packages" unstable main
sync_one_repo "https://dl.bintray.com/xeffyr/x11-packages" "${WORKING_DIR}/x11-packages" x11 main
sync_one_repo "https://dl.bintray.com/grimler/science-packages-24" "${WORKING_DIR}/science-packages-24" science stable
sync_one_repo "https://dl.bintray.com/grimler/game-packages-24" "${WORKING_DIR}/game-packages-24" games stable
sync_one_repo "https://dl.bintray.com/grimler/termux-root-packages-24" "${WORKING_DIR}/termux-root-packages-24" root stable
echo "finished" echo "finished"