forked from devgateway/dg-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
36 lines (28 loc) · 1.08 KB
/
entrypoint.sh
File metadata and controls
36 lines (28 loc) · 1.08 KB
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
#!/bin/bash
PROP_FILE="/etc/$1.properties"
truncate -s 0 $PROP_FILE
echo "..................... Writing to $PROP_FILE: ............... "
while IFS='=' read -r -d '' n v; do
if [[ $n == SPRING* ]]; then
VAR_NAME="$(echo "$n" | tr '[:upper:]_' '[:lower:].')"
echo "$VAR_NAME=$v" >> $PROP_FILE
fi
done < <(env -0)
while IFS='=' read -r -d '' n v; do
if [[ $n == TCDI_* ]]; then
VAR_NAME="$(echo "$n" | tr '[:upper:]_' '[:lower:].' | cut -c 6-)"
echo "$VAR_NAME=$v" >> $PROP_FILE
fi
done < <(env -0)
# Add git.branch if it exists
if [[ -n "${git.branch}" ]]; then
echo "git.branch=${git.branch}" >> $PROP_FILE
fi
echo "................. Properties ................."
cat $PROP_FILE
echo "................. End Properties ................."
# Set up correct classpath to include all dependencies
JAVA_OPTS="-Dspring.config.location=file://$PROP_FILE"
# Run the application with the correct classpath
cd /opt/devgateway/tcdi/admin/deps
exec java -cp .:BOOT-INF/classes:BOOT-INF/lib/* org.devgateway.toolkit.forms.wicket.FormsWebApplication $JAVA_OPTS $@