forked from folio-org/mod-inventory-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-okapi.sh
executable file
·37 lines (29 loc) · 975 Bytes
/
start-okapi.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
#!/usr/bin/env bash
#Run this from the root directory of the Okapi source
okapi_proxy_address=${1:-"http://localhost:9130"}
storage=${2:-"memory"}
if [ $# == 0 ] ; then
echo "Using default parameters"
echo "Okapi Address: ${okapi_proxy_address}"
echo "Usage: ./start-okapi.sh [okapi proxy address] from the Okapi source root directory"
fi
echo "Packaging Okapi Core"
mvn package --quiet -Dmaven.test.skip=true
if [ "${storage}" = "postgres" ]; then
echo "Running Okapi Core using Postgres storage"
java \
-Dokapiurl="${okapi_proxy_address}" \
-Dloglevel=DEBUG \
-Dstorage=postgres \
-Dpostgres_db_init=1 \
-jar ./okapi-core/target/okapi-core-fat.jar dev
elif [ "${storage}" = "memory" ]; then
echo "Running Okapi Core using in-memory storage"
java \
-Dokapiurl="${okapi_proxy_address}" \
-Dloglevel=DEBUG \
-jar ./okapi-core/target/okapi-core-fat.jar dev
else
echo "Unknown storage mechanism: ${storage}"
exit 1
fi