remove centos7 and use vault mirror for ant-junit rpm download

also remove noboolean in trunk

 patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-19787
This commit is contained in:
mck 2024-07-22 13:21:04 +02:00
parent 9533fd9e2e
commit 1e08f3bfa7
No known key found for this signature in database
GPG Key ID: E91335D77E3E87CB
4 changed files with 4 additions and 96 deletions

View File

@ -65,7 +65,7 @@ Build with a specific jdk:
.build/docker/build-redhat.sh rpm 11
Build with centos7 and a specific jdk:
Build with legacy noboolean and a specific jdk:
.build/docker/build-redhat.sh noboolean 11

View File

@ -49,7 +49,7 @@ RUN yum -y install \
procps \
rsync
RUN until curl -f -S -s --retry 9 --retry-connrefused --retry-delay 1 http://mirror.centos.org/centos/7/os/x86_64/Packages/ant-junit-1.9.4-2.el7.noarch.rpm -o ant-junit-1.9.4-2.el7.noarch.rpm ; do echo "curl failed… trying again in 10s… " ; sleep 10 ; done
RUN until curl -f -S -s --retry 9 --retry-connrefused --retry-delay 1 https://vault.centos.org/7.9.2009/os/x86_64/Packages/ant-junit-1.9.4-2.el7.noarch.rpm -o ant-junit-1.9.4-2.el7.noarch.rpm ; do echo "curl failed… trying again in 10s… " ; sleep 10 ; done
RUN rpm -i --nodeps ant-junit-1.9.4-2.el7.noarch.rpm

View File

@ -18,7 +18,7 @@
if [ "$1" == "-h" ]; then
echo "$0 [-h] [rpm|noboolean] [<java_version>]"
echo " build redhat packages, specify noboolean for centos7 compatibility"
echo " build redhat packages, specify noboolean for legacy (centos7) compatibility"
exit 1
fi
@ -26,12 +26,6 @@ fi
rpm_dist=$1
java_version=$2
if [ "${rpm_dist}" == "noboolean" ]; then
dist_name="centos7"
else # noboolean
dist_name="almalinux"
fi
echo
echo "==="
@ -42,5 +36,5 @@ echo
#
# Creates the redhat package
$(dirname "$0")/_docker_run.sh ${dist_name}-build.docker docker/_build-redhat.sh "${java_version}" ${rpm_dist}
$(dirname "$0")/_docker_run.sh almalinux-build.docker docker/_build-redhat.sh "${java_version}" ${rpm_dist}
exit $?

View File

@ -1,86 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
FROM centos:7
MAINTAINER Apache Cassandra <dev@cassandra.apache.org>
# CONTEXT is expected to be cassandra/.build
ENV BUILD_HOME=/home/build
ENV RPM_BUILD_DIR=$BUILD_HOME/rpmbuild
ENV DIST_DIR=/dist
ENV CASSANDRA_DIR=$BUILD_HOME/cassandra
ENV ANT_VERSION=1.10.14
ARG UID_ARG=1000
ARG GID_ARG=1000
LABEL org.cassandra.buildenv=centos
RUN echo "Building with arguments:" \
&& echo " - DIST_DIR=${DIST_DIR}" \
&& echo " - BUILD_HOME=${BUILD_HOME}" \
&& echo " - RPM_BUILD_DIR=${RPM_BUILD_DIR}" \
&& echo " - CASSANDRA_DIR=${CASSANDRA_DIR}" \
&& echo " - UID_ARG=${UID_ARG}" \
&& echo " - GID_ARG=${GID_ARG}"
# install deps
RUN yum -y install \
ant \
git \
java-11-openjdk-devel \
make \
rpm-build \
sudo \
python3-pip \
rsync
RUN until curl -f -S -s --retry 9 --retry-delay 1 http://mirror.centos.org/centos/7/os/x86_64/Packages/ant-junit-1.9.4-2.el7.noarch.rpm -o ant-junit-1.9.4-2.el7.noarch.rpm ; do echo "curl failed… trying again in 10s… " ; sleep 10 ; done
RUN rpm -i --nodeps ant-junit-1.9.4-2.el7.noarch.rpm
# try first downloads.a.o and then archive.a.o (as the latter has a 5GB per IP daily limit)
RUN until curl -f -S -s --retry 9 --retry-delay 1 https://downloads.apache.org/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz -o apache-ant-${ANT_VERSION}-bin.tar.gz || curl -f -S -s --retry 9 --retry-delay 1 http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz -o apache-ant-${ANT_VERSION}-bin.tar.gz ; do echo "curl failed… trying again in 10s… " ; sleep 10 ; done
RUN rm -rf /etc/ant.conf
RUN tar xvf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt
RUN ln -sfn /opt/apache-ant-${ANT_VERSION} /opt/ant
RUN sh -c 'echo ANT_HOME=/opt/ant >> /etc/environment'
RUN ln -sfn /opt/ant/bin/ant /usr/bin/ant
# jdk17 latest on x64
RUN if [ "$(arch)" == "x86_64" ] ; then \
until curl -f -S -s --retry 9 --retry-delay 1 https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz -o openjdk-17_bin.tar.gz ; do \
echo "curl failed… trying again in 10s… " ; sleep 10 ; \
done \
fi
# jdk17 latest on arm
RUN if [ "$(arch)" == "aarch64" ] ; then \
until curl -f -S -s --retry 9 --retry-delay 1 https://download.oracle.com/java/17/latest/jdk-17_linux-aarch64_bin.tar.gz -o openjdk-17_bin.tar.gz ; do \
echo "curl failed… trying again in 10s… " ; sleep 10 ; \
done \
fi
RUN tar xvf openjdk-17_bin.tar.gz
RUN mv jdk-17* /opt/jdk-17
RUN alternatives --install /usr/bin/java java /opt/jdk-17/bin/java 3 --family java-17-openjdk.$(arch)
RUN alternatives --install /usr/bin/javac javac /opt/jdk-17/bin/javac 3 --family java-17-openjdk.$(arch)
# python3 is needed for the gen-doc target
RUN pip3 install --upgrade pip