mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	ci: Remove uses of VERSION_CODENAME.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							98ccaceafc
						
					
				
				
					commit
					bf361e9951
				
			@@ -412,8 +412,9 @@ def parse_os_release() -> Dict[str, str]:
 | 
				
			|||||||
     'PRETTY_NAME': 'Ubuntu 18.04.3 LTS',
 | 
					     'PRETTY_NAME': 'Ubuntu 18.04.3 LTS',
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    VERSION_CODENAME (e.g. 'bionic') is nice and human-readable, but
 | 
					    VERSION_CODENAME (e.g. 'bionic') is nice and readable to Ubuntu
 | 
				
			||||||
    we avoid using it, as it is not available on RHEL-based platforms.
 | 
					    developers, but we avoid using it, as it is not available on
 | 
				
			||||||
 | 
					    RHEL-based platforms.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    distro_info = {}  # type: Dict[str, str]
 | 
					    distro_info = {}  # type: Dict[str, str]
 | 
				
			||||||
    with open("/etc/os-release") as fp:
 | 
					    with open("/etc/os-release") as fp:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,14 +10,9 @@ FROM {base_image}
 | 
				
			|||||||
RUN sudo rm -rf /var/lib/rabbitmq/mnesia/*
 | 
					RUN sudo rm -rf /var/lib/rabbitmq/mnesia/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The bionic hack used in production suite
 | 
					# The bionic hack used in production suite
 | 
				
			||||||
RUN if [ -f /etc/os-release ]; then \
 | 
					RUN if (. /etc/os-release && [ "$ID $VERSION_ID" = 'ubuntu 18.04' ]); then \
 | 
				
			||||||
    . /etc/os-release \
 | 
					 | 
				
			||||||
    && os_codename=$VERSION_CODENAME \
 | 
					 | 
				
			||||||
    && if [ "$os_codename" = "bionic" ]; then \
 | 
					 | 
				
			||||||
      sudo sed -i '/^bind/s/bind.*/bind 0.0.0.0/' /etc/redis/redis.conf; \
 | 
					      sudo sed -i '/^bind/s/bind.*/bind 0.0.0.0/' /etc/redis/redis.conf; \
 | 
				
			||||||
    fi; \
 | 
					    fi
 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Download the release tarball, start rabbitmq server and install the server
 | 
					# Download the release tarball, start rabbitmq server and install the server
 | 
				
			||||||
RUN cd $(mktemp -d) \
 | 
					RUN cd $(mktemp -d) \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,9 +65,12 @@ if [ -f /etc/os-release ]; then
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    os_info="$(
 | 
					    os_info="$(
 | 
				
			||||||
        . /etc/os-release
 | 
					        . /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
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
 | 
					if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
 | 
				
			||||||
@@ -76,7 +79,7 @@ if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Pin to PostgreSQL 10 on Bionic, so we can test upgrading it
 | 
					# 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
 | 
					    export POSTGRESQL_VERSION=10
 | 
				
			||||||
fi
 | 
					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
 | 
					    "$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
 | 
					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
 | 
					    if [ "$(crudini --get /etc/zulip/zulip.conf postgresql version)" != "10" ]; then
 | 
				
			||||||
        echo "Installer did not install the PostgreSQL 10 that we asked for!"
 | 
					        echo "Installer did not install the PostgreSQL 10 that we asked for!"
 | 
				
			||||||
        exit 1
 | 
					        exit 1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,13 +12,13 @@ NOREPLY_EMAIL_ADDRESS = 'noreply@circleci.example.com'
 | 
				
			|||||||
ALLOWED_HOSTS = []
 | 
					ALLOWED_HOSTS = []
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -f /etc/os-release ]; then
 | 
					os_info="$(
 | 
				
			||||||
    os_info="$(
 | 
					    . /etc/os-release
 | 
				
			||||||
        . /etc/os-release
 | 
					    printf '%s\n' "$ID"
 | 
				
			||||||
        printf '%s\n' "$VERSION_CODENAME"
 | 
					)"
 | 
				
			||||||
    )"
 | 
					{
 | 
				
			||||||
    { read -r os_version_codename || true; } <<<"$os_info"
 | 
					    read -r os_id
 | 
				
			||||||
fi
 | 
					} <<<"$os_info"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_header() {
 | 
					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"
 | 
					    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>.
 | 
					# 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
 | 
					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"
 | 
					    success_header_file="/tmp/success-http-headers.template.debian.txt"
 | 
				
			||||||
    check_header
 | 
					    check_header
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -199,7 +199,7 @@ elif "debian" in os_families():
 | 
				
			|||||||
    # additional dependency for postgresql-13-pgdg-pgroonga.
 | 
					    # additional dependency for postgresql-13-pgdg-pgroonga.
 | 
				
			||||||
    #
 | 
					    #
 | 
				
			||||||
    # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037
 | 
					    # 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.remove("libappindicator1")
 | 
				
			||||||
        DEBIAN_DEPENDECIES.append("libgroonga0")
 | 
					        DEBIAN_DEPENDECIES.append("libgroonga0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user