forked from redhat-cop/containers-quickstarts
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun.sh
executable file
·28 lines (22 loc) · 786 Bytes
/
run.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
#!/bin/bash
set -x
set -e
## If the mounted data volume is empty, populate it from the default data
cp -a /opt/sonarqube/data-init/* /opt/sonarqube/data/
## Link the plugins directory from the mounted volume
rm -rf /opt/sonarqube/extensions/plugins
ln -s /opt/sonarqube/data/plugins /opt/sonarqube/extensions/plugins
mkdir -p /opt/sonarqube/data/plugins
for I in $(ls /opt/sonarqube/extensions-init/plugins/*.jar);
do
TARGET_PATH=$(echo ${I} | sed 's@extensions-init/plugins@data/plugins@g')
if ! [[ -e ${TARGET_PATH} ]]; then
cp ${I} ${TARGET_PATH}
fi
done
if [ "${1:0:1}" != '-' ]; then
exec "$@"
fi
java -jar lib/sonar-application-$SONAR_VERSION.jar \
-Dsonar.web.javaAdditionalOpts="${SONARQUBE_WEB_JVM_OPTS} -Djava.security.egd=file:/dev/./urandom" \
"$@"