-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage
executable file
·70 lines (58 loc) · 1.79 KB
/
manage
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
#!/bin/bash
export MSYS_NO_PATHCONV=1
# Name of container to use for start the indy cli or bash
export BASH_CONTAINER=${BASH_CONTAINER:= nodejs_alice_1}
# Services to start for "up" - normally blank to start all services
export START_SERVICES=${START_SERVICES:=""}
# =================================================================================================================
# Usage:
# -----------------------------------------------------------------------------------------------------------------
usage () {
cat <<-EOF
Usage: $0 [command] [options]
Commands:
build - Build the docker images for the project.
You need to do this first.
up - Starts all containers and docker-compose logs.
Use ctrl-c to exit logging. Use "down" or "stop" to stop the run.
start - same as up
logs - Display the logs from the docker compose run (ctrl-c to exit).
bash - Start client container in a bash shell in /home/indy.
cli - Start indy-cli in the agent container.
down - Brings down the services and removes the volumes (storage). The containers
are not deleted so they will be reused the next time you run start.
rm - same as down
stop - Stops the containers, leaving the volumes (storage).
rebuild - Force a full rebuild of the docker images (no cache)
EOF
exit 1
}
case "$1" in
start|up)
docker-compose up -d ${START_SERVICES}
docker-compose logs -f
;;
cli)
docker exec -it -e MODE=cli ${BASH_CONTAINER} indy-cli
;;
bash)
docker exec -it -e MODE=cli ${BASH_CONTAINER} bash
;;
build)
docker-compose build
;;
rebuild)
docker-compose build --no-cache
;;
logs)
docker-compose logs -f
;;
stop)
docker-compose stop
;;
down|rm)
docker-compose down -v
;;
*)
usage;;
esac