[AB-xxx] refactoring rest-api to not be a maven project and restructuring python tool file structure

This commit is contained in:
Sheldan
2023-12-20 21:04:35 +01:00
parent 474e632fed
commit e9d14ac417
31 changed files with 46 additions and 68 deletions

View File

@@ -0,0 +1,17 @@
import subprocess
import sys
def deploy_liquibase(folder, change_log_file, liquibase_path, base_path, db_config):
print(f'Deploying liquibase of {change_log_file} in folder {folder}')
process_command = [f'{liquibase_path}/liquibase', f'--defaultsFile={change_log_file}', f'--defaultSchemaName={db_config.scheme}', f'--liquibaseSchemaName={db_config.scheme}', f'--liquibaseCatalogName={db_config.scheme}', '--logLevel=info', 'update']
process = subprocess.Popen(process_command,
cwd=f'{base_path}/liquibase-zips/{folder}',
stderr=sys.stderr,
stdout=sys.stdout)
process.communicate()
code = process.returncode
if code != 0:
print("Liquibased deployment failed.")
sys.exit(code)