mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-04-10 10:51:28 +00:00
fix: Fix container setup for EL8
Also add --regennginxconfig to reset nginx config, and ensure nginx configuration is generated for all targets not only the ones provided in the command line. This avoid the anoying effect of overriding the repositories of previous builds. Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
This commit is contained in:
10
buildrpms.pl
10
buildrpms.pl
@@ -49,6 +49,7 @@ my %opts = (
|
||||
force => 0,
|
||||
verbose => 0,
|
||||
deps => "$PWD/../xcat-dep/",
|
||||
regennginxconf => 0,
|
||||
);
|
||||
|
||||
GetOptions(
|
||||
@@ -58,6 +59,7 @@ GetOptions(
|
||||
"verbose" => \$opts{verbose},
|
||||
"force" => \$opts{force},
|
||||
"deps=s" => \$opts{deps},
|
||||
"regennginxconf" => \$opts{regennginxconf},
|
||||
) or usage();
|
||||
|
||||
sub sh {
|
||||
@@ -209,7 +211,10 @@ server {
|
||||
listen 8080;
|
||||
listen [::]:8080;
|
||||
EOF
|
||||
for my $target ($opts{targets}->@*) {
|
||||
|
||||
# We always generate the nginx config for all
|
||||
# the targets, not $opts{targets}
|
||||
for my $target (@TARGETS) {
|
||||
my $fullpath = "$PWD/dist/$target/rpms";
|
||||
$conf .= <<"EOF";
|
||||
location /$target/ {
|
||||
@@ -231,6 +236,7 @@ EOF
|
||||
}
|
||||
EOF
|
||||
write_text("/etc/nginx/conf.d/xcat-repos.conf", $conf);
|
||||
`systemctl restart nginx`;
|
||||
}
|
||||
|
||||
sub update_repo {
|
||||
@@ -250,6 +256,7 @@ sub usage {
|
||||
}
|
||||
|
||||
sub main {
|
||||
return configure_nginx() if $opts{regennginxconf};
|
||||
my @rpms = product($opts{packages}, $opts{targets});
|
||||
my $pm = Parallel::ForkManager->new($opts{nproc});
|
||||
|
||||
@@ -275,7 +282,6 @@ sub main {
|
||||
|
||||
configure_nginx();
|
||||
|
||||
`systemctl restart nginx`;
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
ARG RELEASEVER=9
|
||||
FROM quay.io/rockylinux/rockylinux:${RELEASEVER}-ubi-init
|
||||
ARG RELEASEVER
|
||||
|
||||
RUN dnf install -y epel-release
|
||||
RUN dnf config-manager --set-enabled epel crb
|
||||
|
||||
RUN echo "RELEASEVER=${RELEASEVER}"
|
||||
RUN if [[ "${RELEASEVER}" == "8" ]]; then \
|
||||
dnf config-manager --set-enabled powertools epel; \
|
||||
elif [[ "${RELEASEVER}" =~ /(9|10)/ ]]; then \
|
||||
dnf config-manager --set-enabled crb epel; \
|
||||
else \
|
||||
echo "Invalid RELEASEVER=${RELEASEVER}"; \
|
||||
exit -1; \
|
||||
fi
|
||||
RUN dnf makecache
|
||||
RUN dnf install -y hostname perl perl-core perl-generators iproute net-tools bind-utils openssh-clients python3 perl-Net-IP perl-Sys-Syslog wget perl-IO perl-File-Copy perl-File-Basename perl-File-Slurper perl-Parallel-ForkManager perl-JSON perl-Data-Dumper
|
||||
RUN dnf install -y hostname perl perl-core
|
||||
RUN dnf clean all
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
Reference in New Issue
Block a user