Skip to content

Commit 2a23dca

Browse files
committed
Reuse daos-stack/packaging solution
Reuse already known solution from: daos-stack/packaging#88 daos-stack/packaging#87 Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com> Priority: 2 Limited tests scope as only build env has been modified: - no unit test - no HW tests - no FI tests Skip-unit-tests:true Skip-unit-test: true Skip-NLT: true Skip-unit-test-memcheck: true Skip-func-test-el8: false Skip-func-test-el9: false Skip-func-test-leap15: false Skip-fault-injection-test: true Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
1 parent ac7d13d commit 2a23dca

2 files changed

Lines changed: 42 additions & 7 deletions

File tree

utils/rpms/packaging/Dockerfile.mockbuild

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright 2018-2024 Intel Corporation
3-
# Copyright 2025 Hewlett Packard Enterprise Development LP
3+
# Copyright 2025-2026 Hewlett Packard Enterprise Development LP
44
#
55
# 'recipe' for Docker to build an RPM
66
#
@@ -11,8 +11,24 @@ FROM fedora:$FVERSION
1111
# Needed for later use of FVERSION
1212
ARG FVERSION
1313
LABEL maintainer="daos@daos.groups.io"
14+
15+
# Accept DAOS_NO_PROXY at build time
1416
ARG DAOS_NO_PROXY
17+
# Propagate into the build environment
18+
ENV no_proxy=${DAOS_NO_PROXY}
1519
ENV NO_PROXY=${DAOS_NO_PROXY}
20+
# Persist into /etc/environment for use by shells and services
21+
RUN echo "no_proxy=${DAOS_NO_PROXY}" >> /etc/environment && \
22+
echo "NO_PROXY=${DAOS_NO_PROXY}" >> /etc/environment
23+
24+
# Accept DAOS_HTTPS_PROXY at build time
25+
ARG DAOS_HTTPS_PROXY
26+
# Propagate into the build environment
27+
ENV https_proxy=${DAOS_HTTPS_PROXY}
28+
ENV HTTPS_PROXY=${DAOS_HTTPS_PROXY}
29+
# Persist into /etc/environment for use by shells and services
30+
RUN echo "https_proxy=${DAOS_HTTPS_PROXY}" >> /etc/environment && \
31+
echo "HTTPS_PROXY=${DAOS_HTTPS_PROXY}" >> /etc/environment
1632

1733
# Use local repo server if present
1834
ARG REPO_FILE_URL

utils/scripts/helpers/repo-helper-fedora.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,26 @@ set -uex
1111
: "${FVERSION:=latest}"
1212
: "${REPOSITORY_NAME:=artifactory}"
1313
: "${archive:=}"
14-
if [ "$FVERSION" != "latest" ]; then
15-
archive="-archive"
16-
fi
14+
15+
is_fedora_eol() {
16+
local eol_url fedora_version eol_date today
17+
if [ -n "$REPO_FILE_URL" ]; then
18+
eol_url="${REPO_FILE_URL%repo-files/}eol-proxy/fedora.json"
19+
fedora_version=$(grep VERSION_ID /etc/os-release | cut -d= -f2 | \
20+
tr -d '"')
21+
eol_date=$(curl -s "$eol_url" | sed 's/},{/}\n{/g' | \
22+
grep "cycle\":\"$fedora_version\"" | \
23+
sed -n 's/.*"eol":"\([^"]*\)".*/\1/p')
24+
if [[ -z "$eol_date" ]]; then
25+
return 1 # Assume NOT EOL if data missing
26+
fi
27+
today=$(date +%Y-%m-%d)
28+
[[ "$today" > "$eol_date" ]]
29+
return $? # Return 0 if EOL, 1 if not
30+
else
31+
return 1 # Assume NOT EOL if url is missing
32+
fi
33+
}
1734

1835
# shellcheck disable=SC2120
1936
disable_repos () {
@@ -46,7 +63,7 @@ install_curl() {
4663
install_optional_ca() {
4764
ca_storage="/etc/pki/ca-trust/source/anchors/"
4865
if [ -n "$DAOS_LAB_CA_FILE_URL" ]; then
49-
curl -k --noproxy '*' -sSf -o "${ca_storage}lab_ca_file.crt" \
66+
curl -k -sSf -o "${ca_storage}lab_ca_file.crt" \
5067
"$DAOS_LAB_CA_FILE_URL"
5168
update-ca-trust
5269
fi
@@ -60,10 +77,12 @@ install_optional_ca() {
6077
if [ -n "$REPO_FILE_URL" ]; then
6178
install_curl
6279
install_optional_ca
80+
if is_fedora_eol; then
81+
archive="-archive"
82+
fi
6383
mkdir -p /etc/yum.repos.d
6484
pushd /etc/yum.repos.d/
65-
curl -k --noproxy '*' -sSf \
66-
-o "daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo" \
85+
curl -k -sSf -o "daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo" \
6786
"${REPO_FILE_URL}daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo"
6887
disable_repos /etc/yum.repos.d/
6988
popd

0 commit comments

Comments
 (0)