forked from opendevstack/ods-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·33 lines (28 loc) · 1.13 KB
/
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
29
30
31
32
33
#!/bin/sh
set -e
if [ "${1:0:1}" != '-' ]; then
exec "$@"
fi
if [ $SONAR_AUTH_CROWD == true ]; then
# Update sonar.properties for crowd plugin
echo "sonar.security.realm=Crowd" >> conf/sonar.properties
echo "crowd.url=$SONARQUBE_CROWD_URL" >> conf/sonar.properties
echo "crowd.application=$SONARQUBE_CROWD_APP" >> conf/sonar.properties
echo "crowd.password=$SONARQUBE_CROWD_PWD" >> conf/sonar.properties
echo "sonar.security.localUsers=admin" >> conf/sonar.properties
fi
# Copy plugins into volume
rm $SONARQUBE_HOME/extensions/plugins/*.jar || true
ls -lah /opt/configuration/sonarqube/plugins
mkdir -p $SONARQUBE_HOME/extensions/plugins
for FILENAME in /opt/configuration/sonarqube/plugins/*; do
plugin=$(basename $FILENAME)
cp $FILENAME $SONARQUBE_HOME/extensions/plugins/$plugin
done
exec java -jar lib/sonar-application-$SONAR_VERSION.jar \
-Dsonar.log.console=true \
-Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \
-Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \
-Dsonar.jdbc.url="$SONARQUBE_JDBC_URL" \
-Dsonar.web.javaAdditionalOpts="$SONARQUBE_WEB_JVM_OPTS -Djava.security.egd=file:/dev/./urandom" \
"$@"