From 4d4c89bcd72b6da3478a01dcc37df28da635b251 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 8 Oct 2012 00:20:23 -0400 Subject: [PATCH] Backport of development commit: "Update fabfile to place installation marker" 64c7804611aa23bcf33ed6b6d957cf9c860b2c07 --- fabfile/literals.py | 2 ++ fabfile/platforms/__init__.py | 3 +++ fabfile/platforms/linux.py | 16 ++++++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fabfile/literals.py b/fabfile/literals.py index b1fb4f9c91..55e8e8899b 100644 --- a/fabfile/literals.py +++ b/fabfile/literals.py @@ -68,3 +68,5 @@ DEFAULT_WEBSERVER = WEB_APACHE DEFAULT_DATABASE_USERNAME = 'mayan' DEFAULT_DATABASE_HOST = '127.0.0.1' DEFAULT_PASSWORD_LENGTH = 10 + +FABFILE_MARKER = 'fabfile_install' diff --git a/fabfile/platforms/__init__.py b/fabfile/platforms/__init__.py index 5a8ec61da4..971d2c480c 100644 --- a/fabfile/platforms/__init__.py +++ b/fabfile/platforms/__init__.py @@ -94,7 +94,10 @@ def post_install(): setup_environment() if env.os == OS_UBUNTU: ubuntu.post_install() + linux.post_install() elif env.os == OS_FEDORA: fedora.post_install() + linux.post_install() elif env.os == OS_DEBIAN: debian.post_install() + linux.post_install() diff --git a/fabfile/platforms/linux.py b/fabfile/platforms/linux.py index c95b5114bb..f2988a6f83 100644 --- a/fabfile/platforms/linux.py +++ b/fabfile/platforms/linux.py @@ -1,16 +1,20 @@ +import os + from fabric.api import run, sudo, cd, env, task, settings +from ..literals import FABFILE_MARKER + def delete_mayan(): """ - Delete Mayan EDMS files from an Ubuntu system + Delete Mayan EDMS files from an Linux system """ sudo('rm %(virtualenv_path)s -Rf' % env) def install_mayan(): """ - Install Mayan EDMS on an Ubuntu system + Install Mayan EDMS on an Linux system """ with cd(env.install_path): sudo('virtualenv --no-site-packages %(virtualenv_name)s' % env) @@ -18,3 +22,11 @@ def install_mayan(): with cd(env.virtualenv_path): sudo('git clone git://github.com/rosarior/mayan.git %(repository_name)s' % env) sudo('source bin/activate; pip install -r %(repository_name)s/requirements/production.txt' % env) + + +def post_install(): + """ + Post install process on a Linux systems + """ + fabfile_marker = os.path.join(env.repository_path, FABFILE_MARKER) + sudo('touch %s' % fabfile_marker)