Add basic feature to mirror POS DB in mysql or postgresql
but only supported for Catapult so far
This commit is contained in:
parent
3e66aa79da
commit
48960d961b
7 changed files with 107 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
## -*- mode: conf; -*-
|
||||
|
||||
[catapult-default]
|
||||
[catapult-production]
|
||||
host = ${env.catapult_host}
|
||||
port = 2638
|
||||
# https://www.freetds.org/userguide/ChoosingTdsProtocol.html
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
[catapult-default]
|
||||
[catapult-production]
|
||||
Description = ECRS Catapult
|
||||
Driver = /usr/local/lib/libtdsodbc.so
|
||||
ServerName = catapult-default
|
||||
ServerName = catapult-production
|
||||
ServerDSN = prototype
|
||||
|
||||
# [catapult-tj-default]
|
||||
|
|
23
machines/theo-server/deploy/theo-common/catapult-mirror.conf
Normal file
23
machines/theo-server/deploy/theo-common/catapult-mirror.conf
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
############################################################
|
||||
#
|
||||
# config for Catapult "mirror" DB
|
||||
#
|
||||
############################################################
|
||||
|
||||
|
||||
##############################
|
||||
# rattail
|
||||
##############################
|
||||
|
||||
[rattail.config]
|
||||
include = %(here)s/rattail.conf
|
||||
|
||||
|
||||
##############################
|
||||
# alembic
|
||||
##############################
|
||||
|
||||
[alembic]
|
||||
script_location = rattail_onager.catapult.db:alembic
|
||||
version_locations = rattail_onager.catapult.db:alembic/versions
|
16
machines/theo-server/deploy/theo-common/mirror-catapult-first.sh.mako
Executable file
16
machines/theo-server/deploy/theo-common/mirror-catapult-first.sh.mako
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
# sanity check
|
||||
if [ "$USER" != 'rattail' ]; then
|
||||
echo ''
|
||||
echo "Please run this script as 'rattail' user:"
|
||||
echo ''
|
||||
echo " sudo -u rattail $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${envroot}
|
||||
|
||||
RATTAIL_ONAGER='bin/rattail-onager -c app/quiet.conf -P --no-versioning'
|
||||
|
||||
$RATTAIL_ONAGER import-catapult --dbkey production --warnings
|
|
@ -45,8 +45,23 @@ default.pool_recycle = 3600
|
|||
# Catapult
|
||||
<%text>##############################</%text>
|
||||
|
||||
[catapult]
|
||||
url = https://${env.catapult_host}/weboffice/
|
||||
|
||||
[catapult.db]
|
||||
default.url = catapult://${env.catapult_odbc_username}:${env.catapult_odbc_password}@catapult-default
|
||||
% if env.theo_mirror_posdb == 'mysql':
|
||||
keys = default, mirror, production
|
||||
default.url = mysql+mysqlconnector://rattail:${env.password_mysql_rattail}@localhost/${mirrordb}
|
||||
mirror.url = mysql+mysqlconnector://rattail:${env.password_mysql_rattail}@localhost/${mirrordb}
|
||||
production.url = catapult://${env.catapult_odbc_username}:${env.catapult_odbc_password}@catapult-production
|
||||
% elif env.theo_mirror_posdb == 'postgresql':
|
||||
keys = default, mirror, production
|
||||
default.url = postgresql://rattail:${env.password_postgresql_rattail}@localhost/${mirrordb}
|
||||
mirror.url = postgresql://rattail:${env.password_postgresql_rattail}@localhost/${mirrordb}
|
||||
production.url = catapult://${env.catapult_odbc_username}:${env.catapult_odbc_password}@catapult-production
|
||||
% else:
|
||||
default.url = catapult://${env.catapult_odbc_username}:${env.catapult_odbc_password}@catapult-production
|
||||
% endif
|
||||
|
||||
## end catapult
|
||||
% endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue