Skip to content

Commit 8d07809

Browse files
committed
Apply required fix from packaging/sre-3205
daos-stack/packaging#87 is required for proper build. Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
1 parent dc80b4b commit 8d07809

2 files changed

Lines changed: 28 additions & 7 deletions

File tree

packaging/Dockerfile.mockbuild

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ LABEL maintainer="daos@daos.groups.io"
1616
ARG REPO_FILE_URL
1717
ARG DAOS_LAB_CA_FILE_URL
1818
ARG REPOSITORY_NAME
19+
1920
# script to install OS updates basic tools and daos dependencies
2021
# COPY ./utils/scripts/install-fedora.sh /tmp/install.sh
2122
# script to setup local repo if available
@@ -26,9 +27,9 @@ RUN chmod +x /tmp/repo-helper.sh && \
2627
rm -f /tmp/repo-helper.sh
2728

2829
# Install basic tools
29-
RUN dnf -y install mock make \
30-
rpm-build createrepo rpmlint redhat-lsb-core git \
31-
python-srpm-macros rpmdevtools && \
30+
RUN dnf -y install mock make \
31+
rpm-build createrepo rpmlint git \
32+
python-srpm-macros rpmdevtools && \
3233
dnf -y clean all
3334

3435
# use same UID as host and default value of 1000 if not specified

packaging/scripts/repo-helper-fedora.sh

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

1633
# shellcheck disable=SC2120
1734
disable_repos () {
@@ -58,11 +75,14 @@ install_optional_ca() {
5875
if [ -n "$REPO_FILE_URL" ]; then
5976
install_curl
6077
install_optional_ca
78+
if is_fedora_eol; then
79+
archive="-archive"
80+
fi
6181
mkdir -p /etc/yum.repos.d
6282
pushd /etc/yum.repos.d/
6383
curl -k --noproxy '*' -sSf \
6484
-o "daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo" \
65-
"{$REPO_FILE_URL}daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo"
85+
"${REPO_FILE_URL}daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo"
6686
disable_repos /etc/yum.repos.d/
6787
popd
6888
fi

0 commit comments

Comments
 (0)