diff --git a/buildrpms.pl b/buildrpms.pl index 5ff7d2769..60932ce3c 100755 --- a/buildrpms.pl +++ b/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(); diff --git a/test/Containerfile b/test/Containerfile index 21e88fe3d..7731dbdd1 100644 --- a/test/Containerfile +++ b/test/Containerfile @@ -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