Add support for Debian, merge Debian/Ubuntu platforms
This commit is contained in:
@@ -3,7 +3,7 @@ import os
|
||||
from fabric.api import run, sudo, cd, env, task, settings
|
||||
from fabric.contrib.files import upload_template
|
||||
|
||||
from ..literals import OS_UBUNTU, OS_FEDORA
|
||||
from ..literals import OS_UBUNTU, OS_FEDORA, OS_DEBIAN
|
||||
|
||||
|
||||
def install_site():
|
||||
@@ -11,7 +11,7 @@ def install_site():
|
||||
Install Mayan EDMS's site file in Apache configuration
|
||||
"""
|
||||
# TODO: configurable site name
|
||||
if env.os == OS_UBUNTU:
|
||||
if env.os in [OS_UBUNTU, OS_DEBIAN]:
|
||||
upload_template(filename=os.path.join('fabfile', 'templates', 'apache_site'), destination='/etc/apache2/sites-available/mayan', context=env, use_sudo=True)
|
||||
sudo('a2ensite mayan')
|
||||
elif env.os == OS_FEDORA:
|
||||
@@ -22,8 +22,9 @@ def remove_site():
|
||||
"""
|
||||
Install Mayan EDMS's site file from Apache's configuration
|
||||
"""
|
||||
if env.os == OS_UBUNTU:
|
||||
sudo('a2dissite mayan')
|
||||
if env.os in [OS_UBUNTU, OS_DEBIAN]:
|
||||
with settings(warn_only=True):
|
||||
sudo('a2dissite mayan')
|
||||
elif env.os == OS_FEDORA:
|
||||
with settings(warn_only=True):
|
||||
sudo('rm /etc/httpd/conf.d/mayan.conf')
|
||||
@@ -33,7 +34,7 @@ def restart():
|
||||
"""
|
||||
Restart Apache
|
||||
"""
|
||||
if env.os == OS_UBUNTU:
|
||||
if env.os in [OS_UBUNTU, OS_DEBIAN]:
|
||||
sudo('/etc/init.d/apache2 restart')
|
||||
elif env.os == OS_FEDORA:
|
||||
sudo('systemctl restart httpd.service')
|
||||
@@ -43,7 +44,7 @@ def reload():
|
||||
"""
|
||||
Reload Apache configuration files
|
||||
"""
|
||||
if env.os == OS_UBUNTU:
|
||||
if env.os in [OS_UBUNTU, OS_DEBIAN]:
|
||||
sudo('/etc/init.d/apache2 reload')
|
||||
elif env.os == OS_FEDORA:
|
||||
sudo('systemctl reload httpd.service')
|
||||
|
||||
Reference in New Issue
Block a user