forked from open-osp/open-osp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathopenosp
executable file
·102 lines (80 loc) · 2.32 KB
/
openosp
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
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
set -a
if [ -f "local.env" ]; then
source local.env
fi
# This script is intended to be a common entrypoint for managing this environment.
export MSYS_NO_PATHCONV=1
set -e
# =================================================================================================================
# Usage:
# -----------------------------------------------------------------------------------------------------------------
usage() {
cat <<-EOF
Usage: $0 [command] [options]
Commands:
setup - Copy properties files to volumes
Create Oscar instance
Boostrap the db with initial oscar db
Examples:
- Setup OpenOSP environment.
$0 setup
bootstrap - Make a new, empty db
purge - Delete OSCAR related files
Drop current databse.
backup - Trigger Backups, by default, will run the auto backup container
Examples:
- Run automated backups.
$0 backup
- Run manual backups.
$0 backup -m
build - to build the oscar source WAR and docker image
publish - to push to dockerhub
update - to update the openosp docker image
start - to bring up containers if needed.
EOF
exit 1
}
toLower() {
echo $(echo "${@}" | tr '[:upper:]' '[:lower:]')
}
#=============================================================================
COMMAND=$(toLower ${1})
case "${COMMAND}" in
setup)
./bin/openosp-setup.sh $2 $3
;;
purge)
./bin/openosp-purge.sh $2 $3
;;
start)
./bin/openosp-start.sh $2 $3
;;
backup)
if [[ $2 = "-m" ]]; then
echo "Manually Backing up files"
./bin/openosp-backup.sh $2 $3
else
echo "Running Auto backups"
./bin/run-auto-backups.sh
fi
;;
build)
./bin/openosp-build.sh $2 $3 $4
;;
publish)
./bin/openosp-publish.sh $2 $3
;;
bootstrap)
./bin/openosp-bootstrap.sh $2 $3
;;
update)
./bin/openosp-update.sh $2 $3
;;
health)
docker compose -f docker-compose.admin.yml run health
;;
*)
usage
;;
esac