Add basic LOC SMS support for theo-server machine

This commit is contained in:
Lance Edgar 2020-09-23 15:07:21 -05:00
parent 1b227a8d32
commit 6b88090587
12 changed files with 168 additions and 3 deletions

View file

@ -76,9 +76,27 @@ def bootstrap_base(c):
# which cause it to use too much memory, so we use a more stable branch
from rattail_fabric2 import freetds
freetds.install_from_source(c, user='rattail', branch='Branch-1_2')
deploy(c, 'rattail/freetds.conf.mako', '/usr/local/etc/freetds.conf',
deploy(c, 'rattail/catapult/freetds.conf.mako', '/usr/local/etc/freetds.conf',
use_sudo=True, context={'env': env})
deploy(c, 'rattail/odbc.ini', '/etc/odbc.ini', use_sudo=True)
deploy(c, 'rattail/catapult/odbc.ini', '/etc/odbc.ini', use_sudo=True)
# locsms extras
elif env.theo_integrates_with == 'locsms':
apt.install(c, 'unixodbc', 'unixodbc-dev')
# mssql odbc
if env.locsms_odbc_driver == 'mssql':
from rattail_fabric2 import mssql
mssql.install_mssql_odbc(c, accept_eula=env.mssql_driver_accept_eula)
deploy(c, 'rattail/locsms/mssql/odbc.ini.mako', '/etc/odbc.ini',
use_sudo=True, context={'env': env})
else: # freetds odbc
apt.install(c, 'tdsodbc')
deploy(c, 'rattail/locsms/freetds/freetds.conf.mako', '/etc/freetds/freetds.conf',
use_sudo=True, context={'env': env})
deploy(c, 'rattail/locsms/freetds/odbc.ini.mako', '/etc/odbc.ini',
use_sudo=True, context={'env': env})
@task
@ -134,6 +152,8 @@ def install_theo_app(c, envname, production, port, from_source=False,
pkgname = 'tailbone-theo[app,corepos]'
elif env.theo_integrates_with == 'catapult':
pkgname = 'tailbone-theo[app,catapult]'
elif env.theo_integrates_with == 'locsms':
pkgname = 'tailbone-theo[app,locsms]'
else:
pkgname = 'tailbone-theo[app]'
c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf cd {0} && bin/pip install {1}'".format(envroot, pkgname),
@ -180,6 +200,10 @@ def install_theo_app(c, envname, production, port, from_source=False,
deploy(c, 'theo-common/import-catapult-first.sh.mako', '{}/app/import-catapult-first.sh'.format(envroot),
use_sudo=True, owner='rattail:', mode='0755',
context={'envroot': envroot})
elif env.theo_integrates_with == 'locsms':
deploy(c, 'theo-common/import-locsms-first.sh.mako', '{}/app/import-locsms-first.sh'.format(envroot),
use_sudo=True, owner='rattail:', mode='0755',
context={'envroot': envroot})
# theo db
if not postgresql.db_exists(c, dbname):
@ -213,6 +237,9 @@ def install_theo_app(c, envname, production, port, from_source=False,
elif env.theo_integrates_with == 'catapult':
c.sudo("bash -c 'cd {} && bin/rattail -c app/quiet.conf --runas theo make-user --no-password catapult'".format(envroot),
user='rattail')
elif env.theo_integrates_with == 'locsms':
c.sudo("bash -c 'cd {} && bin/rattail -c app/quiet.conf --runas theo make-user --no-password locsms'".format(envroot),
user='rattail')
# supervisor
deploy(c, 'theo-common/supervisor.conf.mako', '/etc/supervisor/conf.d/{}.conf'.format(safename),
@ -247,11 +274,17 @@ def install_theo_source(c, envroot):
install_source_package(c, envroot, 'tailbone-corepos')
# catapult
if env.theo_integrates_with == 'catapult':
elif env.theo_integrates_with == 'catapult':
install_source_package(c, envroot, 'onager', restricted=True)
install_source_package(c, envroot, 'rattail-onager', restricted=True)
install_source_package(c, envroot, 'tailbone-onager', restricted=True)
# locsms
elif env.theo_integrates_with == 'locsms':
install_source_package(c, envroot, 'luckysmores', restricted=True)
install_source_package(c, envroot, 'rattail-luckysmores', restricted=True)
install_source_package(c, envroot, 'tailbone-locsms', restricted=True)
# theo
install_source_package(c, envroot, 'theo')