mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
create-thumbor-venv: Generalize to CentOS, Fedora, RHEL.
This commit is contained in:
@@ -8,15 +8,26 @@ ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__f
|
|||||||
if ZULIP_PATH not in sys.path:
|
if ZULIP_PATH not in sys.path:
|
||||||
sys.path.append(ZULIP_PATH)
|
sys.path.append(ZULIP_PATH)
|
||||||
|
|
||||||
from scripts.lib.zulip_tools import run
|
from scripts.lib.zulip_tools import run, parse_lsb_release
|
||||||
from scripts.lib.setup_venv import setup_virtualenv, THUMBOR_VENV_DEPENDENCIES
|
from scripts.lib.setup_venv import (
|
||||||
|
setup_virtualenv, THUMBOR_VENV_DEPENDENCIES, YUM_THUMBOR_VENV_DEPENDENCIES
|
||||||
|
)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Create a thumbor virtualenv with caching")
|
parser = argparse.ArgumentParser(description="Create a thumbor virtualenv with caching")
|
||||||
parser.add_argument("deploy_path")
|
parser.add_argument("deploy_path")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# install dependencies for setting up the virtualenv
|
# install dependencies for setting up the virtualenv
|
||||||
run(["apt-get", "-y", "install"] + THUMBOR_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"] + THUMBOR_VENV_DEPENDENCIES)
|
||||||
|
elif family == 'redhat':
|
||||||
|
run(["yum", "-y", "install"] + YUM_THUMBOR_VENV_DEPENDENCIES)
|
||||||
|
else:
|
||||||
|
print("Unsupported platform: {}".format(vendor))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
venv_name = "zulip-thumbor-venv"
|
venv_name = "zulip-thumbor-venv"
|
||||||
cached_venv_path = setup_virtualenv(
|
cached_venv_path = setup_virtualenv(
|
||||||
|
|||||||
Reference in New Issue
Block a user