-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (76 loc) · 1.99 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
include .env
init_docker:
make build_ng_image
make build_scripts_image
make volume_create
# build the angular builder
build_ng_image:
docker build \
-t ${ANGULAR_BUILD_IMAGE} \
-f ./build/Dockerfiles/Dockerfile-angular \
--rm=true \
.
# build the script runner image
build_scripts_image:
docker build \
-t ${SCRIPT_IMAGE} \
-f ./build/Dockerfiles/Dockerfile-scripts \
--rm=true \
.
# run all initialization scripts
run_scripts_data_init:
make run_scripts_load_data
make run_scripts_add_bedes_admin_user
make run_scripts_add_bedes_test_users
# load an initial set of bedes-terms
run_scripts_load_data:
docker run \
--network=${DOCKER_NET_NAME} \
--env-file=.env \
--rm \
--name=${SCRIPT_CONTAINER} \
${SCRIPT_IMAGE} \
load-all-compose
# create the bedes-admin account
run_scripts_add_bedes_admin_user:
docker run \
--network=${DOCKER_NET_NAME} \
--env-file=.env \
--rm \
--name=${SCRIPT_CONTAINER} \
${SCRIPT_IMAGE} \
add-bedes-admin-user
# create the bedes test-user accounts
run_scripts_add_bedes_test_users:
docker run \
--network=${DOCKER_NET_NAME} \
--env-file=.env \
--rm \
--name=${SCRIPT_CONTAINER} \
${SCRIPT_IMAGE} \
add-bedes-test-users
stop_and_remove_db:
docker stop ${DB_CONTAINER_NAME} || true
docker rm ${DB_CONTAINER_NAME} || true
# create the database volume
volume_create:
docker volume create ${POSTGRES_VOLUME_NAME}
# remove the database volume
volume_rm:
docker volume rm ${POSTGRES_VOLUME_NAME}
# Load the initial set of bedes terms
load-dev-data:
cd scripts/ts && npm run load-all && npm run add-bedes-admin-user && npm run add-bedes-test-users
# Clears the DB without loading terms, for debugging purposes
dev-clear-db:
make stop_and_remove_db
make volume_rm
make volume_create
(cd bedes-db && make run && sleep 10)
# Removes the docker database volume, then reloads the BEDES Terms and users.
dev-clean-data:
make stop_and_remove_db
make volume_rm
make volume_create
(cd bedes-db && make run && sleep 10)
make load-dev-data