mirror of https://github.com/zulip/zulip.git
create-production-venv: Generalize to CentOS, Fedora, RHEL.
This commit is contained in:
parent
15763f8545
commit
68c20c610e
|
@ -8,15 +8,31 @@ ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__f
|
|||
if ZULIP_PATH not in sys.path:
|
||||
sys.path.append(ZULIP_PATH)
|
||||
|
||||
from scripts.lib.zulip_tools import overwrite_symlink, run, subprocess_text_output
|
||||
from scripts.lib.setup_venv import setup_virtualenv, VENV_DEPENDENCIES
|
||||
from scripts.lib.zulip_tools import overwrite_symlink, run, parse_lsb_release
|
||||
from scripts.lib.setup_venv import (
|
||||
setup_virtualenv, VENV_DEPENDENCIES, REDHAT_VENV_DEPENDENCIES,
|
||||
FEDORA_VENV_DEPENDENCIES
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser(description="Create a production virtualenv with caching")
|
||||
parser.add_argument("deploy_path")
|
||||
args = parser.parse_args()
|
||||
|
||||
# install dependencies for setting up the virtualenv
|
||||
run(["apt-get", "-y", "install"] + VENV_DEPENDENCIES)
|
||||
distro_info = parse_lsb_release()
|
||||
vendor = distro_info['DISTRIB_ID']
|
||||
family = distro_info['DISTRIB_FAMILY']
|
||||
if family == 'debian':
|
||||
run(["apt-get", "-y", "install"] + VENV_DEPENDENCIES)
|
||||
elif family == 'redhat':
|
||||
if vendor in ["CentOS", "RedHat"]:
|
||||
_VENV_DEPS = REDHAT_VENV_DEPENDENCIES
|
||||
elif vendor == "Fedora":
|
||||
_VENV_DEPS = FEDORA_VENV_DEPENDENCIES
|
||||
run(["yum", "-y", "install"] + _VENV_DEPS)
|
||||
else:
|
||||
print("Unsupported platform: {}".format(vendor))
|
||||
sys.exit(1)
|
||||
|
||||
python_version = sys.version_info[0]
|
||||
|
||||
|
|
Loading…
Reference in New Issue