[AB-103] adding triggers to update created and updating attributes on tables

fixing error handling in installer
merging change sets to larger operations
adding check constraints
fixing suggestion id handling
applying naming conventions to various columns
adding indices to tables
adding user in server and user locking
This commit is contained in:
Sheldan
2021-02-07 03:06:48 +01:00
parent dac3b0887f
commit 038d5c3832
126 changed files with 1416 additions and 986 deletions

View File

@@ -1,7 +1,16 @@
import os
import subprocess
import sys
def deploy_liquibase(folder, change_log_file, liquibase_path):
stream = os.popen('cd liquibase-zips/%s && %s/liquibase --defaultsFile=%s --liquibaseSchemaName=abstracto --liquibaseCatalogName=abstracto --logLevel=info update' % (folder, liquibase_path, change_log_file))
output = stream.read()
print(output)
print("Deploying liquibase of %s in folder %s" % (change_log_file, folder))
process = subprocess.Popen(['%s/liquibase' % (liquibase_path), '--defaultsFile=%s' % (change_log_file), '--liquibaseSchemaName=abstracto', '--liquibaseCatalogName=abstracto', '--logLevel=info', 'update'],
cwd='liquibase-zips/%s' % (folder),
stderr=sys.stderr,
stdout=sys.stdout)
process.communicate()
code = process.returncode
if code != 0:
print("Liquibased deployment failed.")
sys.exit(code)

View File

@@ -28,21 +28,21 @@ class DbConfig:
db_config = DbConfig()
if not use_folder:
print("Not deploying with folder.")
postgres_driver_path = os.getenv('POSTGRES_DRIVER')
liquibase_path = os.getenv('LIQUIBASE_PATH')
print("Loading versions.")
with open('artifact_versions.json') as artifact_config_file:
artifact_config = json.load(artifact_config_file)
print("Loading templates")
templateLoader = jinja2.FileSystemLoader(searchpath="/python/templates")
templateEnv = jinja2.Environment(loader=templateLoader)
template = templateEnv.get_template("liquibase.properties.j2")
if deploy_liquibase:
print("Starting liquibase deployment")
for liquibase_artifact in artifact_config['liquibase_artifacts']:
zip_file = liquibase_artifact['zip']
target_folder = '/liquibase-zips/' + zip_file
@@ -57,15 +57,18 @@ if not use_folder:
liquibase_deploy.deploy_liquibase(zip_file, property_path, liquibase_path)
if deploy_templates:
print("Deploying templates.")
for template_artifact in artifact_config['template_artifacts']:
with ZipFile('templates/' + template_artifact + '.zip', 'r') as template_zip:
template_zip.extractall(template_artifact)
templates_deploy.deploy_template_folder(db_config, template_artifact)
print("Deploying translation templates")
for template_artifact in artifact_config['translation_artifacts']:
with ZipFile('translations/' + template_artifact + '.zip', 'r') as template_zip:
template_zip.extractall(template_artifact)
templates_deploy.deploy_template_folder(db_config, template_artifact)
if use_folder:
print("Only deploying folder.")
templates_deploy.deploy_template_folder(db_config, local_folder)

View File

@@ -3,6 +3,8 @@
DEPLOY_LIQUIBASE=no
DEPLOY_TEMPLATES=no
echo "Starting deployment."
if [ "x$EXECUTE_LIQUIBASE" = 'xtrue' ]; then
DEPLOY_LIQUIBASE=yes
fi
@@ -10,9 +12,11 @@ fi
if [ "x$EXECUTE_TEMPLATES" = 'xtrue' ]; then
DEPLOY_TEMPLATES=yes
fi
exit_code = 0
if [ "x$EXECUTE_DEPLOYMENT" = 'xtrue' ]; then
python3 python/main.py $DEPLOY_TEMPLATES $DEPLOY_LIQUIBASE
python3 -u python/main.py $DEPLOY_TEMPLATES $DEPLOY_LIQUIBASE
exit_code=$?
fi
echo "Finished deployment"
echo "Finished deployment."
exit $exit_code