Changeset - b7148f4c554e
[Not reviewed]
4 4 4
Lance Edgar - 9 years ago 2015-11-15 23:00:54
ledgar@sacfoodcoop.com
Add `bootstrap_rattail()` fablib function, move init scripts.
9 files changed with 57 insertions and 142 deletions:
0 comments (0 inline, 0 general)
MANIFEST.in
Show inline comments
 
@@ -13,3 +13,5 @@ recursive-include rattail/db/alembic *.mako
 
recursive-include rattail/db/alembic *.py
 

	
 
recursive-include rattail/templates/mail *.mako
 

	
 
recursive-include rattail/fablib/deploy *
data/var/lib/rattail/init.d/dbsync
Show inline comments
 
deleted file
rattail/fablib/deploy/bouncer
Show inline comments
 
file renamed from rattail/contrib/init.d/bouncer to rattail/fablib/deploy/bouncer
rattail/fablib/deploy/datasync
Show inline comments
 
file renamed from rattail/contrib/init.d/datasync to rattail/fablib/deploy/datasync
rattail/fablib/deploy/filemon
Show inline comments
 
file renamed from data/var/lib/rattail/init.d/filemon to rattail/fablib/deploy/filemon
rattail/fablib/pod.py
Show inline comments
 
@@ -25,6 +25,7 @@ Fabric Library for Product Open Data (POD)
 
"""
 

	
 
from __future__ import unicode_literals
 
from __future__ import absolute_import
 

	
 
from fabric.api import sudo, cd, env
 
from fabric.contrib.files import exists
rattail/fablib/python.py
Show inline comments
 
@@ -25,6 +25,7 @@ Fabric Library for Python
 
"""
 

	
 
from __future__ import unicode_literals
 
from __future__ import absolute_import
 

	
 
from contextlib import contextmanager
 

	
rattail/fablib/rattail.py
Show inline comments
 
new file 100644
 
# -*- coding: utf-8 -*-
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2015 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
#  Rattail is free software: you can redistribute it and/or modify it under the
 
#  terms of the GNU Affero General Public License as published by the Free
 
#  Software Foundation, either version 3 of the License, or (at your option)
 
#  any later version.
 
#
 
#  Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
 
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
#  FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for
 
#  more details.
 
#
 
#  You should have received a copy of the GNU Affero General Public License
 
#  along with Rattail.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
################################################################################
 
"""
 
Fabric library for Rattail itself
 
"""
 

	
 
from __future__ import unicode_literals
 
from __future__ import absolute_import
 

	
 
from fabric.api import sudo, env
 

	
 
from rattail.fablib import make_deploy, make_system_user, mkdir
 

	
 

	
 
deploy = make_deploy(__file__)
 

	
 

	
 
def bootstrap_rattail(home='/var/lib/rattail', shell='/bin/bash', alias=True):
 
    """
 
    Bootstrap a basic Rattail software environment.
 
    """
 
    make_system_user('rattail', home=home, shell=shell, alias=alias)
 
    sudo('adduser {0} rattail'.format(env.user))
 

	
 
    mkdir('/etc/rattail')
 
    mkdir('/srv/rattail')
 
    mkdir('/var/log/rattail', owner='rattail:rattail', mode='0775')
 

	
 
    mkdir('/srv/rattail/init')
 
    deploy('filemon', '/srv/rattail/init/filemon')
 
    deploy('datasync', '/srv/rattail/init/datasync')
 
    deploy('bouncer', '/srv/rattail/init/bouncer')
rattail/fablib/ssh.py
Show inline comments
 
@@ -25,6 +25,7 @@ Fabric Library for SSH
 
"""
 

	
 
from __future__ import unicode_literals
 
from __future__ import absolute_import
 

	
 
from fabric.api import *
 
from fabric.contrib.files import exists, sed
0 comments (0 inline, 0 general)