-
Notifications
You must be signed in to change notification settings - Fork 131
/
start.sh
60 lines (50 loc) · 1.95 KB
/
start.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
#!/bin/bash
set -e
# allow easier debugging with `docker run -e VERBOSE=yes`
if [[ "$VERBOSE" = "yes" ]]; then
set -x
fi
# allow easier reset home with `docker run -e RESET_HOME=true`
if [[ "$RESET_HOME" = "true" ]]; then
echo "Clearing VIVO HOME $VIVO_HOME"
rm -rf "$VIVO_HOME/*"
fi
# copy home bin if not exists
if [ ! -d "$VIVO_HOME/bin" ]; then
echo "Copying home bin directory to $VIVO_HOME/bin"
cp -r /vivo-home/bin "$VIVO_HOME/bin"
fi
# copy home config if not exists
if [ ! -d $VIVO_HOME/config ]; then
echo "Copying home config directory to $VIVO_HOME/config"
cp -r /vivo-home/config "$VIVO_HOME/config"
fi
# copy home rdf if not exists
if [ ! -d $VIVO_HOME/rdf ]; then
echo "Copying home rdf directory to $VIVO_HOME/rdf"
cp -r /vivo-home/rdf "$VIVO_HOME/rdf"
fi
# copy runtime.properties if it does not already exist in target home directory
if [ -f "$VIVO_HOME/config/example.runtime.properties" ]; then
if [ ! -f "$VIVO_HOME/config/runtime.properties" ]
then
echo "Copying example.runtime.properties to $VIVO_HOME/config/runtime.properties"
cp "$VIVO_HOME/config/example.runtime.properties" "$VIVO_HOME/config/runtime.properties"
# template runtime.properties vitro.local.solr.url value to $SOLR_URL value
echo "Templating runtime.properties vitro.local.solr.url = $SOLR_URL"
sed -i "s,http://localhost:8983/solr/vivocore,$SOLR_URL,g" "$VIVO_HOME/config/runtime.properties"
else
echo "Using existing $VIVO_HOME/config/runtime.properties"
fi
fi
# copy applicationSetup.n3 if it does not already exist in target home directory
if [ -f "$VIVO_HOME/config/example.applicationSetup.n3" ]; then
if [ ! -f "$VIVO_HOME/config/applicationSetup.n3" ]
then
echo "Copying example.applicationSetup.n3 to $VIVO_HOME/config/applicationSetup.n3"
cp "$VIVO_HOME/config/example.applicationSetup.n3" "$VIVO_HOME/config/applicationSetup.n3"
else
echo "Using existing $VIVO_HOME/config/applicationSetup.n3"
fi
fi
catalina.sh run