This repository was archived by the owner on Jan 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmanage
More file actions
executable file
·68 lines (54 loc) · 1.83 KB
/
manage
File metadata and controls
executable file
·68 lines (54 loc) · 1.83 KB
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
#!/bin/bash
# =================================================================================================================
# Usage:
# -----------------------------------------------------------------------------------------------------------------
usage () {
cat <<-EOF
Usage: $0 [command]
Commands:
build - Build the docker images for the project.
You need to do this first.
start - Setup test environment for development
This command would startup an elasticsearch container, and import transactions into
es from a json file.
logs - To tail the logs of running containers (ctrl-c to exit).
down | rm - Brings down the services and removes the volumes (storage) and containers.
stop - Stops the services. This is a non-destructive process. The volumes and containers
are not deleted so they will be reused the next time you run start.
rebuild - Rebuild the docker images.
EOF
exit 1
}
function toLower() {
echo $(echo ${@} | tr '[:upper:]' '[:lower:]')
}
COMMAND=$(toLower ${1})
case "${COMMAND}" in
start)
docker compose -f docker-compose.es.yml -f docker-compose.prod.yml up -d
echo "Waiting for elasticsearch..."
sleep 15
pushd start-test
npm install
popd
node "start-test/import_esindex.js"
echo 'Want to see the scrolling container logs? Run "./manage logs"'
;;
logs)
docker compose -f docker-compose.es.yml -f docker-compose.prod.yml logs -f
;;
stop)
docker compose -f docker-compose.es.yml -f docker-compose.prod.yml down
;;
down|rm)
docker compose -f docker-compose.es.yml -f docker-compose.prod.yml down --remove-orphans --volumes
;;
build)
docker compose -f docker-compose.es.yml -f docker-compose.prod.yml build
;;
rebuild)
echo "Not implemented"
;;
*)
usage;;
esac