ci: Setup production job for Focal.

Run production suites on Ubuntu Focal.
Added separate success-http-headers files for Focal and Bionic.
Also excluded them from whitespace rules in lint.

memcached 1.5.22 in Ubuntu 20.04 has a bug where it looks for its SASL
configuration at /etc/sasl2/memcached.conf/memcached.conf instead of
/etc/sasl2/memcached.conf.
We already use a workaround for this while applying puppet configurations in
99e71f3786 but for docker builds we used
do memcached hack since we can not use systemd in docker containers.
This commit is contained in:
arpit551
2020-05-26 00:24:15 +05:30
committed by Tim Abbott
parent 9e8f1aacb3
commit 662f4902f8
6 changed files with 52 additions and 9 deletions

View File

@@ -284,7 +284,8 @@ jobs:
# Must be relative path from root
paths:
- zulip-server-test.tar.gz
- success-http-headers.txt
- success-http-headers-bionic.txt
- success-http-headers-focal.txt
- production-install
- production
- production-extract-tarball
@@ -327,7 +328,14 @@ jobs:
at: /tmp
- *create_cache_directories
- *do_bionic_hack
- run:
name: do memcached hack
command: |
# Temporary hack till memcached upstream is updated in Focal.
# https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/1878721
echo "export SASL_CONF_PATH=/etc/sasl2" | sudo tee - a /etc/default/memcached
- *production_extract_tarball
- *restore_cache_package_json
- *install_production
@@ -351,6 +359,6 @@ workflows:
- "bionic-production-install":
requires:
- "bionic-production-build"
# - "focal-production-install":
# requires:
# - "bionic-production-build"
- "focal-production-install":
requires:
- "bionic-production-build"

View File

@@ -29,6 +29,7 @@ if ! ./tools/build-release-tarball test; then
fi
mv /tmp/tmp.*/zulip-server-test.tar.gz /tmp/
cp -a tools/ci/success-http-headers.txt /tmp/success-http-headers.txt
cp -a tools/ci/success-http-headers-bionic.txt /tmp/success-http-headers-bionic.txt
cp -a tools/ci/success-http-headers-focal.txt /tmp/success-http-headers-focal.txt
cp -a tools/ci/production-install /tmp/production-install
cp -a tools/ci/production-extract-tarball /tmp/production-extract-tarball

View File

@@ -11,6 +11,11 @@ ZULIP_PATH=/home/circleci/zulip
APT_OPTIONS=(-o 'Dpkg::Options::=--force-confdef' -o 'Dpkg::Options::=--force-confold')
apt-get update
if [ -f /etc/os-release ]; then
os_info="$(. /etc/os-release; printf '%s\n' "$VERSION_CODENAME")"
{ read -r os_version_codename || true; } <<< "$os_info"
fi
if ! apt-get dist-upgrade -y "${APT_OPTIONS[@]}"; then
echo "\`apt-get dist-upgrade\`: Failure occurred while trying to perform distribution upgrade, Retrying..."
apt-get dist-upgrade -y "${APT_OPTIONS[@]}"
@@ -54,8 +59,8 @@ grep -vi '\(Vary\|Content-Language\|expires\|issued by\|modified\|saved\|[.][.][
# Simplify the diff by getting replacing 4-5 digit length numbers with <Length>.
sed -i 's|Length: [0-9]\+\( [(][0-9]\+[.][0-9]K[)]\)\?|Length: <Length>|' /tmp/http-headers-processed
sed -i 's|Length: [0-9]\+\( [(][0-9]\+[.][0-9]K[)]\)\?|Length: <Length>|' /tmp/success-http-headers.txt
if ! diff -ur /tmp/http-headers-processed /tmp/success-http-headers.txt; then
sed -i 's|Length: [0-9]\+\( [(][0-9]\+[.][0-9]K[)]\)\?|Length: <Length>|' /tmp/success-http-headers-"$os_version_codename".txt
if ! diff -ur /tmp/http-headers-processed /tmp/success-http-headers-"$os_version_codename".txt; then
set +x
echo
echo "FAILURE: The HTTP Headers returned from loading the homepage on the server do not match the contents of tools/ci/success-http-headers.txt. Typically, this means that the server threw a 500 when trying to load the homepage."

View File

@@ -0,0 +1,29 @@
Self-signed certificate encountered.
WARNING: no certificate subject alternative name matches
requested host name localhost.
HTTP/1.1 302 Found
Server: nginx/1.17.10 (Ubuntu)
Content-Type: text/html; charset=utf-8
Content-Length: 0
Connection: keep-alive
Location: /login/
Strict-Transport-Security: max-age=15768000
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Location: /login/ [following]
Reusing existing connection to localhost:443.
HTTP/1.1 200 OK
Server: nginx/1.17.10 (Ubuntu)
Content-Type: text/html; charset=utf-8
Content-Length: 6361
Connection: keep-alive
Strict-Transport-Security: max-age=15768000
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Length: 6361 (6.2K) [text/html]
Saving to: /tmp/index.html

View File

@@ -76,7 +76,7 @@ whitespace_rules: List["Rule"] = [
},
{'pattern': '\t',
'strip': '\n',
'exclude': {'tools/ci/success-http-headers.txt'},
'exclude': {'tools/ci/success-http-headers-bionic.txt', 'tools/ci/success-http-headers-focal.txt'},
'description': 'Fix tab-based whitespace'},
]
comma_whitespace_rule: List["Rule"] = [