File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,6 @@ ENV CATALINA_TMPDIR /usr/local/tomcat/temp
66
66
ENV PATH $CATALINA_HOME/bin:$PATH
67
67
ENV CLASSPATH /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
68
68
69
- # custom deployment to / with redirect from /source
70
- RUN rm -rf /usr/local/tomcat/webapps/* && \
71
- opengrok-deploy -c /opengrok/etc/configuration.xml \
72
- /opengrok/lib/source.war /usr/local/tomcat/webapps/ROOT.war && \
73
- mkdir "/usr/local/tomcat/webapps/source" && \
74
- echo '<% response.sendRedirect("/"); %>' > "/usr/local/tomcat/webapps/source/index.jsp"
75
-
76
69
# disable all file logging
77
70
ADD docker/logging.properties /usr/local/tomcat/conf/logging.properties
78
71
RUN sed -i -e 's/Valve/Disabled/' /usr/local/tomcat/conf/server.xml
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
LOCKFILE=/var/run/opengrok-indexer
4
- URI=" http://localhost:8080"
4
+ URI=" http://localhost:8080/ ${OPENGROK_WEBAPP_CONTEXT #/ } "
5
5
# $OPS can be overwritten by environment variable
6
6
OPS=${INDEXER_FLAGS:= ' -H -P -S -G' }
7
7
Original file line number Diff line number Diff line change @@ -5,10 +5,29 @@ if [ -z "$REINDEX" ]; then
5
5
REINDEX=10
6
6
fi
7
7
8
+ if [ " ${OPENGROK_WEBAPP_CONTEXT} " = " /" ]; then
9
+ WAR_NAME=" ROOT.war"
10
+ else
11
+ WAR_NAME=" ${OPENGROK_WEBAPP_CONTEXT#/ } .war"
12
+ fi
13
+
14
+ if [ ! -f " /usr/local/tomcat/webapps/${WAR_NAME} " ]; then
15
+ date +" %F %T Deployment path changed. Redeploying..."
16
+
17
+ # Delete old deployment and (re)deploy
18
+ rm -rf /usr/local/tomcat/webapps/*
19
+ opengrok-deploy -c /opengrok/etc/configuration.xml \
20
+ /opengrok/lib/source.war /usr/local/tomcat/webapps/${WAR_NAME}
21
+
22
+ # Set up redirect from /source
23
+ mkdir " /usr/local/tomcat/webapps/source"
24
+ echo " <% response.sendRedirect(\" ${OPENGROK_WEBAPP_CONTEXT} \" ); %>" > " /usr/local/tomcat/webapps/source/index.jsp"
25
+ fi
26
+
8
27
indexer (){
9
28
# Wait for Tomcat startup.
10
29
date +" %F %T Waiting for Tomcat startup..."
11
- while [ " ` curl --silent --write-out ' %{response_code}' -o /dev/null ' http://localhost:8080/' ` " == " 000" ]; do
30
+ while [ " ` curl --silent --write-out ' %{response_code}' -o /dev/null ' http://localhost:8080/${OPENGROK_WEBAPP_CONTEXT#/} ' ` " == " 000" ]; do
12
31
sleep 1;
13
32
done
14
33
date +" %F %T Startup finished"
You can’t perform that action at this time.
0 commit comments