upgrade-zulip: Print the old and new versions during upgrades.

Fixes: #23620
This commit is contained in:
Alex Vandiver 2023-01-30 20:28:34 +00:00 committed by Tim Abbott
parent 418e51cc5b
commit 74067f071f
2 changed files with 11 additions and 3 deletions

View File

@ -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,

View File

@ -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).