ci: Remove uses of VERSION_CODENAME.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-06-24 12:01:35 -07:00 committed by Tim Abbott
parent 98ccaceafc
commit bf361e9951
5 changed files with 21 additions and 22 deletions

View File

@ -412,8 +412,9 @@ def parse_os_release() -> Dict[str, str]:
'PRETTY_NAME': 'Ubuntu 18.04.3 LTS',
}
VERSION_CODENAME (e.g. 'bionic') is nice and human-readable, but
we avoid using it, as it is not available on RHEL-based platforms.
VERSION_CODENAME (e.g. 'bionic') is nice and readable to Ubuntu
developers, but we avoid using it, as it is not available on
RHEL-based platforms.
"""
distro_info = {} # type: Dict[str, str]
with open("/etc/os-release") as fp:

View File

@ -10,15 +10,10 @@ FROM {base_image}
RUN sudo rm -rf /var/lib/rabbitmq/mnesia/*
# The bionic hack used in production suite
RUN if [ -f /etc/os-release ]; then \
. /etc/os-release \
&& os_codename=$VERSION_CODENAME \
&& if [ "$os_codename" = "bionic" ]; then \
RUN if (. /etc/os-release && [ "$ID $VERSION_ID" = 'ubuntu 18.04' ]); then \
sudo sed -i '/^bind/s/bind.*/bind 0.0.0.0/' /etc/redis/redis.conf; \
fi; \
fi
# Download the release tarball, start rabbitmq server and install the server
RUN cd $(mktemp -d) \
&& wget https://www.zulip.org/dist/releases/zulip-server-{version}.tar.gz \

View File

@ -65,9 +65,12 @@ if [ -f /etc/os-release ]; then
os_info="$(
. /etc/os-release
printf '%s\n' "$VERSION_CODENAME"
printf '%s\n' "$ID" "$VERSION_ID"
)"
{ read -r os_version_codename || true; } <<<"$os_info"
{
read -r os_id
read -r os_version_id
} <<<"$os_info"
fi
if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
@ -76,7 +79,7 @@ if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
fi
# Pin to PostgreSQL 10 on Bionic, so we can test upgrading it
if [ "$os_version_codename" = "bionic" ]; then
if [ "$os_id $os_version_id" = 'ubuntu 18.04' ]; then
export POSTGRESQL_VERSION=10
fi
@ -89,7 +92,7 @@ else
"$ZULIP_PATH"/scripts/setup/install --self-signed-cert --hostname 127.0.0.1 --email circleci@example.com --postgresql-database-user zulipcustomuser --postgresql-database-name zulipcustomdb
fi
if [ "$os_version_codename" = "bionic" ]; then
if [ "$os_id $os_version_id" = 'ubuntu 18.04' ]; then
if [ "$(crudini --get /etc/zulip/zulip.conf postgresql version)" != "10" ]; then
echo "Installer did not install the PostgreSQL 10 that we asked for!"
exit 1

View File

@ -12,13 +12,13 @@ NOREPLY_EMAIL_ADDRESS = 'noreply@circleci.example.com'
ALLOWED_HOSTS = []
EOF
if [ -f /etc/os-release ]; then
os_info="$(
os_info="$(
. /etc/os-release
printf '%s\n' "$VERSION_CODENAME"
)"
{ read -r os_version_codename || true; } <<<"$os_info"
fi
printf '%s\n' "$ID"
)"
{
read -r os_id
} <<<"$os_info"
check_header() {
sed -i -e 's|Length: [0-9]\+\( ([0-9.]\+K)\)\?|Length: <Length>|' -e "s|{nginx_version_string}|$nginx_version|g" "$success_header_file"
@ -74,7 +74,7 @@ nginx_version="$(nginx -v 2>&1 | awk '{print $3, $4}' | xargs)"
# Simplify the diff by getting replacing 4-5 digit length numbers with <Length>.
sed -i 's|Length: [0-9]\+\( ([0-9.]\+K)\)\?|Length: <Length>|' /tmp/http-headers-processed
if [ "$os_version_codename" = "buster" ] || [ "$os_version_codename" = "bullseye" ]; then
if [ "$os_id" = debian ]; then
success_header_file="/tmp/success-http-headers.template.debian.txt"
check_header
else

View File

@ -199,7 +199,7 @@ elif "debian" in os_families():
# additional dependency for postgresql-13-pgdg-pgroonga.
#
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037
if distro_info["VERSION_CODENAME"] == "bullseye":
if vendor == "debian" and os_version == "11":
DEBIAN_DEPENDECIES.remove("libappindicator1")
DEBIAN_DEPENDECIES.append("libgroonga0")