Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

centos:7 mirror fix #1909

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/force-auto.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ class Test(abc.ABC):
def build2_post_hook(self):
return ""

@property
def build_from_hook(self):
return ""

@property
def skip(self):
if (self.skip_reason is None):
Expand Down Expand Up @@ -147,6 +151,7 @@ class Test(abc.ABC):
build1 = f"""\
run ch-image -v build -t tmpimg -f - . << 'EOF'
FROM {self.base}
{self.build_from_hook}
RUN {self.prep_run}
EOF
echo "$output"
Expand Down Expand Up @@ -186,6 +191,7 @@ scope {scope}
# build 2: image we're testing
run ch-image -v build {force} -t tmpimg2 -f - . << 'EOF'
FROM {build2_base}
{self.build_from_hook}
RUN {run}
EOF
echo "$output"
Expand Down Expand Up @@ -228,6 +234,13 @@ class T_CentOS_7(RHEL7, EPEL_Mixin):
base = "centos:7"
prep_run = "yum install -y epel-release"

@property
def build_from_hook(self):
return f"""\
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \
&& sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo \
&& sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo"""


class RHEL8(Test):
config = "rhel8"
Expand Down
Loading