system-config/playbooks/roles/mirror-update/files/openeuler-mirror-update
wangxiyuan 3297485f1f Update openEuler mirror repo
openEuler 20.03 LTS SP2 was out of data in May 2022, and the newest
LTS version is 22.03 LTS which will be maintained to 2024.03.

This Patch add the 22.03-LTS mirror

Change-Id: I2eb72de4eee22a7a8739320ead8376c999993928
2022-07-06 01:44:42 +00:00

68 lines
2.0 KiB
Bash

#!/bin/bash -xe
# Copyright 2021 Linaro Limited.
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This references CentOS 7 mirroring part of centos-mirror-update.
source /usr/share/mirror-update/functions.sh
MIRROR_VOLUME=$1
if [[ ${NO_TIMEOUT:-0} -eq 1 ]]; then
echo_ts "Running interactively"
TIMEOUT=""
else
TIMEOUT="timeout -k 2m 30m"
fi
BASE="/afs/.openstack.org/mirror/openeuler"
K5START="k5start -t -f /etc/openeuler.keytab service/openeuler-mirror -- $TIMEOUT"
# Using a foreign mirror to rsync quickly.
# For a whole mirror list see https://www.openeuler.org/en/mirror/list/.
# 119.8.63.103 is the openEuler official mirror in HongKong
MIRROR="rsync://119.8.63.103:873/openeuler"
REPOS="openEuler-20.03-LTS-SP2 openEuler-22.03-LTS"
for REPO in $REPOS; do
if ! [ -f $BASE/$REPO ]; then
$K5START mkdir -p $BASE/$REPO
fi
date --iso-8601=ns
echo_ts "Running $REPO rsync..."
$K5START rsync -rltvz \
--delete \
--delete-excluded \
--exclude="ISO/" \
--exclude="images/" \
--exclude="isolinux/" \
--exclude="debuginfo/" \
--exclude="docker_img/" \
--exclude="raspi_img" \
--exclude="source/" \
--exclude="stratovirt_img/" \
--exclude="virtual_machine_img/" \
$MIRROR/$REPO/ $BASE/$REPO/
echo_ts "$REPO rsync done."
done
date --iso-8601=ns | $K5START tee $BASE/timestamp.txt
echo_ts "rsync completed successfully, running vos release."
vos_release $MIRROR_VOLUME
date --iso-8601=ns
echo_ts "Done."