forked from jvm-bloggers/jvm-bloggers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjvm-bloggers-local.sh
executable file
·65 lines (57 loc) · 1.34 KB
/
jvm-bloggers-local.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
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
#!/bin/sh
setupProperties() {
# Database settings
export JVM_BLOGGERS_DB_USER=jvm_bloggers
export JVM_BLOGGERS_DB_PASSWORD=jvm_bloggers
export JVM_BLOGGERS_DB_NAME=jvm_bloggers
export JVM_BLOGGERS_DB_PATH="${HOME}/jvm-bloggers-postgresql-data"
export JVM_BLOGGERS_DB_PUBLISHED_PORT=5432
}
start() {
docker-compose -f docker-compose-local.yml up -d --force-recreate
echo ""
echo "============================================"
echo " Started JVM Bloggers Database on localhost"
echo " port: $JVM_BLOGGERS_DB_PUBLISHED_PORT"
echo " user: $JVM_BLOGGERS_DB_USER"
echo " pass: $JVM_BLOGGERS_DB_PASSWORD"
echo " schema: $JVM_BLOGGERS_DB_PASSWORD"
echo " volume: $JVM_BLOGGERS_DB_PATH"
echo "============================================"
}
stop() {
docker-compose down
}
status() {
echo "** ** ** ** ** ** ** ** ** ** ** ** "
echo "-- From docker-compose:"
docker-compose ps
echo "** ** ** ** ** ** ** ** ** ** ** ** "
echo "-- From docker itself:"
docker ps
echo "** ** ** ** ** ** ** ** ** ** ** ** "
}
logs() {
docker-compose logs
}
setupProperties
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
logs)
logs
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
esac