From 8e5fadf16debbc6e44a4e4ca4aeb9e2f73d2312d Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Mon, 20 Nov 2023 18:02:50 +0800 Subject: [PATCH] gitlab*: add yum repo for el9 --- gitlab-ce.sh | 4 ++-- gitlab-ci-multi-runner.sh | 26 -------------------------- gitlab-runner.sh | 4 ++-- yum-sync.py | 18 ++++++++++-------- 4 files changed, 14 insertions(+), 38 deletions(-) delete mode 100755 gitlab-ci-multi-runner.sh diff --git a/gitlab-ce.sh b/gitlab-ce.sh index 11060d0..a8ff348 100755 --- a/gitlab-ce.sh +++ b/gitlab-ce.sh @@ -3,7 +3,7 @@ set -e set -o pipefail _here=`dirname $(realpath $0)` -apt_sync="${_here}/apt-sync.py" +apt_sync="${_here}/apt-sync.py" yum_sync="${_here}/yum-sync.py" UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/gitlab/gitlab-ce"} @@ -15,7 +15,7 @@ UBUNTU_PATH="${BASE_PATH}/ubuntu/" DEBIAN_PATH="${BASE_PATH}/debian/" export REPO_SIZE_FILE=/tmp/reposize.$RANDOM -"$yum_sync" "${UPSTREAM}/el/@{os_ver}/@{arch}/" 7 "gitlab" x86_64 "el@{os_ver}" "$YUM_PATH" +"$yum_sync" "${UPSTREAM}/el/@{os_ver}/@{arch}/" 7,9 "gitlab" x86_64 "el@{os_ver}" "$YUM_PATH" echo "YUM finished" "$apt_sync" --delete "${UPSTREAM}/ubuntu" @ubuntu-lts main amd64,i386 "$UBUNTU_PATH" diff --git a/gitlab-ci-multi-runner.sh b/gitlab-ci-multi-runner.sh deleted file mode 100755 index d56ba17..0000000 --- a/gitlab-ci-multi-runner.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# reqires: wget, yum-utils -set -e -set -o pipefail - -_here=`dirname $(realpath $0)` -apt_sync="${_here}/apt-sync.py" -yum_sync="${_here}/yum-sync.py" - -BASE_PATH="${TUNASYNC_WORKING_DIR}" -UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/runner/gitlab-ci-multi-runner"} - -YUM_PATH="${BASE_PATH}/yum" -UBUNTU_PATH="${BASE_PATH}/ubuntu/" -DEBIAN_PATH="${BASE_PATH}/debian/" - -"$yum_sync" "${UPSTREAM}/el/@{os_ver}/@{arch}" 7 gitlab-ci-multi-runner x86_64 "el@{os_ver}" "$YUM_PATH" -echo "YUM finished" - -"$apt_sync" --delete "${UPSTREAM}/ubuntu" @ubuntu-lts main amd64,i386 "$UBUNTU_PATH" -echo "Ubuntu finished" -"$apt_sync" --delete "${UPSTREAM}/debian" @debian-current main amd64,i386 "$DEBIAN_PATH" -echo "Debian finished" - - -# vim: ts=4 sts=4 sw=4 diff --git a/gitlab-runner.sh b/gitlab-runner.sh index f823d08..1547e40 100755 --- a/gitlab-runner.sh +++ b/gitlab-runner.sh @@ -4,7 +4,7 @@ set -e set -o pipefail _here=`dirname $(realpath $0)` -apt_sync="${_here}/apt-sync.py" +apt_sync="${_here}/apt-sync.py" yum_sync="${_here}/yum-sync.py" BASE_PATH="${TUNASYNC_WORKING_DIR}" @@ -15,7 +15,7 @@ UBUNTU_PATH="${BASE_PATH}/ubuntu/" DEBIAN_PATH="${BASE_PATH}/debian/" export REPO_SIZE_FILE=/tmp/reposize.$RANDOM -"$yum_sync" "${UPSTREAM}/el/@{os_ver}/@{arch}" 7 gitlab-runner x86_64,aarch64 "el@{os_ver}-@{arch}" "$YUM_PATH" +"$yum_sync" "${UPSTREAM}/el/@{os_ver}/@{arch}" 7,9 gitlab-runner x86_64,aarch64 "el@{os_ver}-@{arch}" "$YUM_PATH" echo "YUM finished" "$apt_sync" --delete "${UPSTREAM}/ubuntu" @ubuntu-lts main amd64,i386,arm64 "$UBUNTU_PATH" diff --git a/yum-sync.py b/yum-sync.py index 53c710b..0209fcc 100755 --- a/yum-sync.py +++ b/yum-sync.py @@ -144,7 +144,7 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument("base_url", type=str, help="base URL") - parser.add_argument("os_version", type=str, help="e.g. 7-8") + parser.add_argument("os_version", type=str, help="e.g. 7-8,9") parser.add_argument("component", type=str, help="e.g. mysql56-community,mysql57-community") parser.add_argument("arch", type=str, help="e.g. x86_64") parser.add_argument("repo_name", type=str, help="e.g. @{comp}-el@{os_ver}") @@ -153,13 +153,15 @@ def main(): help='download repodata files instead of generating them') args = parser.parse_args() - if '-' in args.os_version and '-stream' not in args.os_version: - dash = args.os_version.index('-') - os_list = [ str(i) for i in range( - int(args.os_version[:dash]), - 1+int(args.os_version[dash+1:])) ] - else: - os_list = [args.os_version] + os_list = [] + for os_version in args.os_version.split(','): + if '-' in os_version and '-stream' not in os_version: + dash = os_version.index('-') + os_list = os_list + [ str(i) for i in range( + int(os_version[:dash]), + 1+int(os_version[dash+1:])) ] + else: + os_list.append(os_version) check_args("os_version", os_list) component_list = args.component.split(',') check_args("component", component_list)