Overhaul some things to support a basic CORE Office install
This commit is contained in:
parent
a84d360509
commit
2c5e073168
5 changed files with 52 additions and 23 deletions
|
|
@ -32,34 +32,39 @@ from fabric.api import sudo, cd, env, run
|
|||
from fabric.contrib.files import exists
|
||||
|
||||
from rattail_fabric import apt, mysql, mkdir
|
||||
from rattail_fabric import make_deploy
|
||||
|
||||
|
||||
def install_fannie(rootdir, branch='version-2.3', first_time=None, url=None):
|
||||
deploy = make_deploy(__file__)
|
||||
|
||||
|
||||
def install_fannie(rootdir, user='www-data', branch='version-2.3', first_time=None, url=None):
|
||||
"""
|
||||
Install the Fannie app to the given location
|
||||
Install the Fannie app to the given location.
|
||||
|
||||
Please note, this assumes composer is already installed and available.
|
||||
"""
|
||||
if first_time is None:
|
||||
first_time = not exists(rootdir)
|
||||
mkdir(rootdir)
|
||||
mkdir(rootdir, owner=user)
|
||||
with cd(rootdir):
|
||||
|
||||
# fannie source
|
||||
if not exists('IS4C'):
|
||||
sudo('git clone https://github.com/CORE-POS/IS4C.git')
|
||||
sudo('git clone https://github.com/CORE-POS/IS4C.git', user=user)
|
||||
with cd('IS4C'):
|
||||
sudo('git checkout {}'.format(branch))
|
||||
sudo('git checkout {}'.format(branch), user=user)
|
||||
with cd('IS4C'):
|
||||
sudo('git pull')
|
||||
sudo('git pull', user=user)
|
||||
|
||||
# composer
|
||||
if not exists('composer.phar'):
|
||||
sudo('curl -sS https://getcomposer.org/installer | php')
|
||||
mkdir('/var/www/.composer', owner='www-data')
|
||||
if user == 'www-data':
|
||||
# TODO: why is this necessary? (but it is, nonetheless)
|
||||
mkdir('/var/www/.composer', owner=user)
|
||||
|
||||
# fannie dependencies
|
||||
with cd('IS4C'):
|
||||
mkdir(['vendor', 'fannie/src/javascript/composer-components'], owner='www-data')
|
||||
sudo('../composer.phar install', user='www-data')
|
||||
mkdir(['vendor', 'fannie/src/javascript/composer-components'], owner=user)
|
||||
sudo('composer.phar install', user=user)
|
||||
|
||||
# shadowread
|
||||
with cd('IS4C/fannie/auth/shadowread'):
|
||||
|
|
@ -69,15 +74,12 @@ def install_fannie(rootdir, branch='version-2.3', first_time=None, url=None):
|
|||
# fannie config
|
||||
with cd('IS4C/fannie'):
|
||||
if not exists('config.php'):
|
||||
sudo('cp config.php.dist config.php')
|
||||
sudo('chown root:www-data config.php')
|
||||
sudo('chmod 0660 config.php')
|
||||
deploy('corepos/fannie/config.php.mako', 'config.php', owner=user, mode='0600')
|
||||
|
||||
# fannie logging
|
||||
with cd('IS4C/fannie/logs'):
|
||||
for name in ['fannie', 'debug_fannie', 'queries', 'php-errors', 'dayend']:
|
||||
sudo('touch {}.log'.format(name))
|
||||
sudo('chown www-data:www-data {}.log'.format(name))
|
||||
sudo('touch {}.log'.format(name), user=user)
|
||||
|
||||
# fannie databases
|
||||
mysql.create_user('is4c', host='%', password='is4c')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue