Skip to content

Commit 25c19b0

Browse files
Backport of Use vault.centos.org instead of mirror.centos.org into release/1.19.x (#21531)
backport of commit 25ee555 Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com>
1 parent fc8a2da commit 25c19b0

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/scripts/verify_artifact.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ function verify_rpm {
102102
${docker_image} \
103103
/scripts/verify_rpm.sh \
104104
"/workdir/${artifact_path}" \
105-
"${expect_version}"
105+
"${expect_version}" \
106+
"${docker_image}"
106107
}
107108

108109
# Arguments:

.github/scripts/verify_rpm.sh

+17
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ set -euo pipefail
1010
# report why it failed. This is meant to be run as part of the build workflow to verify the built
1111
# .rpm meets some basic criteria for validity.
1212

13+
# Notably, CentOS 7 is EOL, so we need to point to the vault for updates. It's not clear what alternative
14+
# we may use in the future that supports linux/386 as the platform was dropped in CentOS 8+9. The docker_image
15+
# is passed in as the third argument so that the script can determine if it needs to point to the vault for updates.
16+
1317
# set this so we can locate and execute the verify_bin.sh script for verifying version output
1418
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
1519

@@ -20,6 +24,7 @@ function usage {
2024
function main {
2125
local rpm_path="${1:-}"
2226
local expect_version="${2:-}"
27+
local docker_image="${3:-}"
2328
local got_version
2429

2530
if [[ -z "${rpm_path}" ]]; then
@@ -34,6 +39,12 @@ function main {
3439
exit 1
3540
fi
3641

42+
if [[ -z "${docker_image}" ]]; then
43+
echo "ERROR: docker image argument is required"
44+
usage
45+
exit 1
46+
fi
47+
3748
# expand globs for path names, if this fails, the script will exit
3849
rpm_path=$(echo ${rpm_path})
3950

@@ -43,6 +54,12 @@ function main {
4354
exit 1
4455
fi
4556

57+
# CentOS 7 is EOL, so we need to point to the vault for updates
58+
if [[ "$docker_image" == *centos:7 ]]; then
59+
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
60+
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
61+
fi
62+
4663
yum -y clean all
4764
yum -y update
4865
yum -y install which openssl

0 commit comments

Comments
 (0)