From 89484fbbe69c556f0d90b06c6f0deca91ef339d7 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 4 Apr 2024 20:37:19 +0000 Subject: [PATCH] install: Remove the hidden VIRTUALENV_NEEDED parameter. We can do this behaviour better by using `has_roles`. --- scripts/lib/install | 9 +++------ tools/setup/bootstrap-aws-installer | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/lib/install b/scripts/lib/install index 5cbc6ed936..e6884ff6a1 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -151,7 +151,6 @@ read -r -a ADDITIONAL_PACKAGES <<<"${ADDITIONAL_PACKAGES:-}" # zulip::profile::docker for Docker. Use # e.g. zulip::profile::app_frontend for a Zulip frontend server. PUPPET_CLASSES="${PUPPET_CLASSES:-zulip::profile::standalone}" -VIRTUALENV_NEEDED="${VIRTUALENV_NEEDED:-yes}" POSTGRESQL_VERSION="${POSTGRESQL_VERSION:-16}" if [ -n "$SELF_SIGNED_CERT" ] && [ -n "$USE_CERTBOT" ]; then @@ -398,11 +397,6 @@ if [ -n "$SELF_SIGNED_CERT" ] || [ -n "$USE_CERTBOT" ]; then --exists-ok "${EXTERNAL_HOST:-$(hostname)}" fi -# Create and activate a virtualenv -if [ "$VIRTUALENV_NEEDED" = "yes" ]; then - "$ZULIP_PATH"/scripts/lib/create-production-venv "$ZULIP_PATH" -fi - # Generate /etc/zulip/zulip.conf . mkdir -p /etc/zulip has_class() { @@ -454,6 +448,9 @@ EOF fi if has_class "zulip::app_frontend_base"; then + # Create and activate a virtualenv + "$ZULIP_PATH"/scripts/lib/create-production-venv "$ZULIP_PATH" + "$ZULIP_PATH"/scripts/lib/install-node if [ -z "$NO_OVERWRITE_SETTINGS" ] || ! [ -e "/etc/zulip/settings.py" ]; then diff --git a/tools/setup/bootstrap-aws-installer b/tools/setup/bootstrap-aws-installer index 3154817b81..11d4185e23 100644 --- a/tools/setup/bootstrap-aws-installer +++ b/tools/setup/bootstrap-aws-installer @@ -71,8 +71,6 @@ git clone "$REPO_URL" zulip -b "$BRANCH" git -C zulip checkout "$BRANCH" ( - VIRTUALENV_NEEDED=$(if echo "$FULL_ROLES" | grep -q app_frontend; then echo -n yes; else echo -n no; fi) - export VIRTUALENV_NEEDED export PUPPET_CLASSES="$FULL_ROLES" export APT_OPTIONS="-o Dpkg::Options::=--force-confnew" /root/zulip/scripts/setup/install \