From 74067f071f74de0f84106ad98d26d17372b34ae8 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 30 Jan 2023 20:28:34 +0000 Subject: [PATCH] upgrade-zulip: Print the old and new versions during upgrades. Fixes: #23620 --- scripts/lib/upgrade-zulip-from-git | 1 - scripts/lib/upgrade-zulip-stage-2 | 13 +++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/lib/upgrade-zulip-from-git b/scripts/lib/upgrade-zulip-from-git index 281a1c4c60..335e278843 100755 --- a/scripts/lib/upgrade-zulip-from-git +++ b/scripts/lib/upgrade-zulip-from-git @@ -168,7 +168,6 @@ try: stderr=subprocess.DEVNULL, ).strip() refname = fullref - logging.info("Upgrading to %s, in %s", commit_hash, deploy_path) subprocess.check_call( ["git", "worktree", "add", "--detach", deploy_path, refname], stdout=subprocess.DEVNULL, diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index c0031a0b1d..ddbf74ce50 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -25,11 +25,13 @@ os.environ["LANGUAGE"] = "C.UTF-8" sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from scripts.lib.zulip_tools import ( + DEPLOYMENTS_DIR, assert_running_as_root, get_config, get_config_file, listening_publicly, parse_os_release, + parse_version_from, run_psql_as_postgres, start_arg_parser, su_to_zulip, @@ -143,6 +145,15 @@ config_file = get_config_file() IS_SERVER_UP = True +if args.from_git: + logging.info("Caching Zulip Git version...") + subprocess.check_call(["./tools/cache-zulip-git-version"], preexec_fn=su_to_zulip) + +from version import ZULIP_VERSION as NEW_ZULIP_VERSION + +old_version = parse_version_from(DEPLOYMENTS_DIR + "/current") +logging.info("Upgrading from %s to %s, in %s", old_version, NEW_ZULIP_VERSION, deploy_path) + # Check if rabbitmq port 25672 is listening on anything except 127.0.0.1 rabbitmq_dist_listen = listening_publicly(25672) @@ -349,8 +360,6 @@ elif args.from_git: logging.error("Try stopping the Zulip server (scripts/stop-server) and trying again.") sys.exit(1) - logging.info("Caching Zulip Git version...") - subprocess.check_call(["./tools/cache-zulip-git-version"], preexec_fn=su_to_zulip) else: # Since this doesn't do any actual work, it's likely safe to have # this run before we apply Puppet changes (saving a bit of downtime).