Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to git ls-remote for openssl releases #716

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3.12/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.12/ubuntu/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.13/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 3.13/ubuntu/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 4.0-rc/alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 4.0-rc/ubuntu/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ RUN set -eux; \
# /usr/local/src doesn't exist in Alpine by default
mkdir -p /usr/local/src; \
\
OPENSSL_SOURCE_URL="https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz"; \
OPENSSL_SOURCE_URL="https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz"; \
OPENSSL_PATH="/usr/local/src/openssl-$OPENSSL_VERSION"; \
OPENSSL_CONFIG_DIR="$OPENSSL_INSTALL_PATH_PREFIX/etc/ssl"; \
\
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-ubuntu.template
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ENV OPENSSL_INSTALL_PATH_PREFIX /opt/openssl
# gnupg: Required to verify OpenSSL artefacts
# libncurses5-dev: Required for Erlang/OTP new shell & observer_cli - https://github.com/zhongwencool/observer_cli
RUN set -eux; \
OPENSSL_SOURCE_URL="https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz"; \
OPENSSL_SOURCE_URL="https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz"; \
OPENSSL_PATH="/usr/local/src/openssl-$OPENSSL_VERSION"; \
OPENSSL_CONFIG_DIR="$OPENSSL_INSTALL_PATH_PREFIX/etc/ssl"; \
\
Expand Down
25 changes: 17 additions & 8 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,27 @@ for version in "${versions[@]}"; do
export otpVersion otpSourceSha256

opensslMajor="${opensslMajors[$rcVersion]}"
opensslVersion="$(
wget -qO- 'https://www.openssl.org/source/' \
| grep -oE 'href="openssl-'"$opensslMajor"'[^"]+[.]tar[.]gz"' \
| sed -e 's/^href="openssl-//' -e 's/[.]tar[.]gz"//' \
| sort -uV \
| tail -1
)"
# grab versions from upstream and ignore any alpha/beta releases
opensslVersions=( $(
git ls-remote --tags https://github.com/openssl/openssl.git \
"refs/tags/openssl-$opensslMajor.*"\
| cut -d'/' -f3- \
| cut -d'^' -f1 \
| cut -d- -f2- \
| grep -vE -- '-[A-Za-z]+' \
| sort -urV
) )
opensslVersion=
for possibleVersion in "${opensslVersions[@]}"; do
if opensslSourceSha256="$(wget -qO- "https://github.com/openssl/openssl/releases/download/openssl-$possibleVersion/openssl-$possibleVersion.tar.gz.sha256")"; then
opensslVersion="$possibleVersion"
break
fi
done
if [ -z "$opensslVersion" ]; then
echo >&2 "warning: failed to get OpenSSL version for '$version' ($fullVersion); skipping"
continue
fi
opensslSourceSha256="$(wget -qO- "https://www.openssl.org/source/openssl-$opensslVersion.tar.gz.sha256")"
export opensslVersion opensslSourceSha256

# OpenSSL 3.0.5's sha256 file starts with a single space 😬
Expand Down
Loading