Add colorization and logo
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from fabric.api import task
|
||||
from fabric.colors import white
|
||||
|
||||
import databases as database
|
||||
import webservers as webserver
|
||||
@@ -9,6 +10,22 @@ from conf import setup_environment
|
||||
setup_environment()
|
||||
|
||||
|
||||
print(white('\n\n ######## ', bold=True))
|
||||
print(white(' ######## ', bold=True))
|
||||
print(white(' ### ### ', bold=True))
|
||||
print(white(' ##### ##### ', bold=True))
|
||||
print(white(' ############## ', bold=True))
|
||||
print(white(' ####### ####### ', bold=True))
|
||||
print(white(' ################## ', bold=True))
|
||||
print(white(' ######### ######### ', bold=True))
|
||||
print(white(' ###################### ', bold=True))
|
||||
print(white(' ########### ########### ', bold=True))
|
||||
print(white(' ########################## ', bold=True))
|
||||
print(white('############# #############', bold=True))
|
||||
|
||||
print(white('\nMayan EDMS Fabric installation file\n\n', bold=True))
|
||||
|
||||
|
||||
@task(default=True)
|
||||
def install():
|
||||
platform.install_dependencies()
|
||||
@@ -17,6 +34,7 @@ def install():
|
||||
database.create_database()
|
||||
django.database_config()
|
||||
django.syncdb()
|
||||
django.collectstatic()
|
||||
platform.fix_permissions()
|
||||
platform.install_webserver()
|
||||
webserver.install_site()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from fabric.api import env, task
|
||||
from fabric.colors import green
|
||||
|
||||
|
||||
from ..literals import DB_MYSQL
|
||||
import mysql
|
||||
@@ -9,6 +11,7 @@ def create_database():
|
||||
"""
|
||||
Create the Mayan EDMS database
|
||||
"""
|
||||
print(green('Creating Mayan EDMS database', bold=True))
|
||||
|
||||
if env.database_manager == DB_MYSQL:
|
||||
mysql.create_database()
|
||||
@@ -19,6 +22,7 @@ def drop_database():
|
||||
"""
|
||||
Drop Mayan EDMS's database
|
||||
"""
|
||||
print(green('Droping Mayan EDMS database', bold=True))
|
||||
|
||||
if env.database_manager == DB_MYSQL:
|
||||
mysql.drop_database()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from fabric.api import run, sudo, cd, env, task
|
||||
from fabric.colors import green
|
||||
|
||||
from ..literals import OS_UBUNTU
|
||||
import ubuntu
|
||||
@@ -9,8 +10,7 @@ def install_dependencies():
|
||||
"""
|
||||
Install OS dependencies
|
||||
"""
|
||||
|
||||
print('Installing dependencies for %s' % env.os_name)
|
||||
print(green('Installing dependencies for %s' % env.os_name, bold=True))
|
||||
|
||||
if env.os == OS_UBUNTU:
|
||||
ubuntu.install_dependencies()
|
||||
@@ -22,7 +22,7 @@ def install_mayan():
|
||||
Install Mayan EDMS
|
||||
"""
|
||||
|
||||
print('Installing Mayan EDMS from git repository')
|
||||
print(green('Installing Mayan EDMS from git repository', bold=True))
|
||||
|
||||
if env.os == OS_UBUNTU:
|
||||
ubuntu.install_mayan()
|
||||
@@ -34,7 +34,7 @@ def install_database_manager():
|
||||
Install the selected database manager
|
||||
"""
|
||||
|
||||
print('Installing database manager: %s' % env.database_manager_name)
|
||||
print(green('Installing database manager: %s' % env.database_manager_name, bold=True))
|
||||
|
||||
if env.os == OS_UBUNTU:
|
||||
ubuntu.install_database_manager()
|
||||
@@ -46,7 +46,7 @@ def fix_permissions():
|
||||
Fix installation files' permissions
|
||||
"""
|
||||
|
||||
print('Fixing installation files\' permissions')
|
||||
print(green('Fixing installation files\' permissions', bold=True))
|
||||
|
||||
if env.os == OS_UBUNTU:
|
||||
ubuntu.fix_permissions()
|
||||
@@ -58,7 +58,7 @@ def install_webserver():
|
||||
Installing the OS packages for the webserver
|
||||
"""
|
||||
|
||||
print('Installing webserver: %s' % env.webserver_name)
|
||||
print(green('Installing webserver: %s' % env.webserver_name, bold=True))
|
||||
|
||||
if env.os == OS_UBUNTU:
|
||||
ubuntu.install_webserver()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from fabric.api import run, sudo, cd, env, task
|
||||
from fabric.colors import green
|
||||
|
||||
from ..literals import WEB_APACHE
|
||||
import apache
|
||||
@@ -10,7 +11,7 @@ def install_site():
|
||||
Install Mayan EDMS site in the webserver configuration files
|
||||
"""
|
||||
|
||||
print('Adding Mayan EDMS\'s site files to: %s' % env.webserver_name)
|
||||
print(green('Adding Mayan EDMS\'s site files to: %s' % env.webserver_name, bold=True))
|
||||
|
||||
if env.webserver == WEB_APACHE:
|
||||
apache.install_site()
|
||||
@@ -21,7 +22,7 @@ def remove_site():
|
||||
"""
|
||||
Install Mayan EDMS's site file from the webserver's configuration
|
||||
"""
|
||||
print('Removing Mayan EDMS\s site file from %s configuration' % env.webserver_name)
|
||||
print(green('Removing Mayan EDMS\s site file from %s configuration' % env.webserver_name, bold=True))
|
||||
|
||||
if env.webserver == WEB_APACHE:
|
||||
apache.remove_site()
|
||||
@@ -32,7 +33,7 @@ def restart():
|
||||
"""
|
||||
Restart the webserver
|
||||
"""
|
||||
print('Restarting the web server: %s' % env.webserver_name)
|
||||
print(green('Restarting the web server: %s' % env.webserver_name, bold=True))
|
||||
|
||||
if env.webserver == WEB_APACHE:
|
||||
apache.restart()
|
||||
@@ -43,7 +44,7 @@ def reload():
|
||||
"""
|
||||
Reload webserver configuration files
|
||||
"""
|
||||
print('Reloading the web server configuration files')
|
||||
print(green('Reloading the web server configuration files', bold=True))
|
||||
|
||||
if env.webserver == WEB_APACHE:
|
||||
apache.reload()
|
||||
|
||||
Reference in New Issue
Block a user