mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
CI: scripts: add support for git in openssl builds
Add support for git releases downloaded from github in openssl builds: - GIT_TYPE variable allow you to chose between "branch" or "commit" - OPENSSL_VERSION variable supports a "git-" prefix - "git-${commit_id}" is stored in .openssl_version instead of the branch name for version comparison.
This commit is contained in:
parent
359a829ccb
commit
31319ff7f0
@ -4,18 +4,20 @@ set -eux
|
|||||||
BUILDSSL_DESTDIR=${BUILDSSL_DESTDIR:-${HOME}/opt}
|
BUILDSSL_DESTDIR=${BUILDSSL_DESTDIR:-${HOME}/opt}
|
||||||
BUILDSSL_TMPDIR=${BUILDSSL_TMPDIR:-/tmp/download-cache}
|
BUILDSSL_TMPDIR=${BUILDSSL_TMPDIR:-/tmp/download-cache}
|
||||||
QUICTLS_URL=${QUICTLS_URL:-https://github.com/quictls/openssl}
|
QUICTLS_URL=${QUICTLS_URL:-https://github.com/quictls/openssl}
|
||||||
|
|
||||||
WOLFSSL_DEBUG=${WOLFSSL_DEBUG:-0}
|
WOLFSSL_DEBUG=${WOLFSSL_DEBUG:-0}
|
||||||
|
GIT_TYPE=${GIT_TYPE:-commit}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
download_openssl () {
|
download_openssl () {
|
||||||
if [ ! -f "${BUILDSSL_TMPDIR}/openssl-${OPENSSL_VERSION}.tar.gz" ]; then
|
|
||||||
|
|
||||||
#
|
# chose between a release or a git version from github
|
||||||
|
if [ "${OPENSSL_VERSION%%-*}" != "git" ]; then
|
||||||
|
|
||||||
|
if [ ! -f "${BUILDSSL_TMPDIR}/openssl-${OPENSSL_VERSION}.tar.gz" ]; then
|
||||||
# OpenSSL has different links for latest and previous releases
|
# OpenSSL has different links for latest and previous releases
|
||||||
# since we want to download several versions, let us try to treat
|
# since we want to download several versions, let us try to treat
|
||||||
# current version as latest, if it fails, follow with previous
|
# current version as latest, if it fails, follow with previous
|
||||||
#
|
|
||||||
|
|
||||||
wget -P ${BUILDSSL_TMPDIR}/ \
|
wget -P ${BUILDSSL_TMPDIR}/ \
|
||||||
"https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" || \
|
"https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" || \
|
||||||
wget -P ${BUILDSSL_TMPDIR}/ \
|
wget -P ${BUILDSSL_TMPDIR}/ \
|
||||||
@ -23,6 +25,15 @@ download_openssl () {
|
|||||||
wget -P ${BUILDSSL_TMPDIR}/ \
|
wget -P ${BUILDSSL_TMPDIR}/ \
|
||||||
"https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz"
|
"https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if [ "${GIT_TYPE}" = "branch" ]; then
|
||||||
|
# update the openssl version using the commit ID of the branch HEAD
|
||||||
|
branch_name="${OPENSSL_VERSION##git-}"
|
||||||
|
OPENSSL_VERSION=git-$(wget -q -O- "https://api.github.com/repos/openssl/openssl/branches/$branch_name" | grep '"sha":' | head -n 1 | sed -E 's/ *"sha": "(.*)",/\1/')
|
||||||
|
fi
|
||||||
|
wget -q -O "${BUILDSSL_TMPDIR}/openssl-${OPENSSL_VERSION}.tar.gz" \
|
||||||
|
"https://github.com/openssl/openssl/archive/${OPENSSL_VERSION##git-}.tar.gz"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# recent openssl versions support parallel builds and skipping the docs,
|
# recent openssl versions support parallel builds and skipping the docs,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user