-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_anonymized_db.sh
executable file
·34 lines (25 loc) · 1.08 KB
/
load_anonymized_db.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# Executes docker-compose to initialize a new, clean database. It uses the latest file in the aprexis-data folder to load
# the tables after they have been created.
# Environment:
# APREXIS_VARIETY the version of Aprexis to run (api or platform).
# APREXIS_DOCKER_COMPOSE_FILE the docker compose file to use to build the system. Default depends on APREXIS_VARIETY.
# Author: Ian Brown
# Since: 2024/08/23
# Version: 1.0.0
SHELL_DIR=`dirname "$0"`
APREXIS_VARIETY=${APREXIS_VARIETY:-api}
APREXIS_DOCKER_COMPOSE_FILE=docker-compose-${APREXIS_VARIETY}.yml
data_file=$(ls -t `find ./aprexis-data -type f ! -iname ".*"` | head -n 1 | cut -d' ' -f2)
if [ "${data_file}" = "" ]; then
echo "No data file to load. Aborting..."
exit -1
end
${SHELL_DIR}/start_db.sh
${SHELL_DIR}/drop_db.sh --have-databases
${SHELL_DIR}/create_db.sh --have-databases
${SHELL_DIR}/migrate_db.sh --have-databases
${SHELL_DIR}/load_anonymized_data.sh --have-databases
${SHELL_DIR}/enable_users.sh --have-databases
${SHELL_DIR}/prepare_test_db.sh --have-databases
${SHELL_DIR}/down.sh