File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ RUN mvn -DskipTests=true -Dmaven.javadoc.skip=true -B -V package
36
36
# hadolint ignore=SC2012,DL4006
37
37
RUN cp `ls -t distribution/target/*.tar.gz | head -1` /opengrok.tar.gz
38
38
39
+ # Store the version in a file so that the tools can report it.
40
+ RUN mvn help:evaluate -Dexpression=project.version -q -DforceStdout > /mvn/VERSION
41
+
39
42
FROM tomcat:10-jdk11
40
43
LABEL maintainer="https://github.com/oracle/opengrok"
41
44
@@ -66,6 +69,8 @@ RUN mkdir -p /opengrok /opengrok/etc /opengrok/data /opengrok/src && \
66
69
python3 -m pip install --no-cache-dir /opengrok/tools/opengrok-tools* && \
67
70
python3 -m pip install --no-cache-dir Flask Flask-HTTPAuth waitress # for /reindex REST endpoint handled by start.py
68
71
72
+ COPY --from=build /mvn/VERSION /opengrok/VERSION
73
+
69
74
# environment variables
70
75
ENV SRC_ROOT /opengrok/src
71
76
ENV DATA_ROOT /opengrok/data
Original file line number Diff line number Diff line change @@ -467,6 +467,13 @@ def main():
467
467
468
468
logger = get_console_logger (get_class_basename (), log_level )
469
469
470
+ try :
471
+ with open (os .path .join (OPENGROK_BASE_DIR , "VERSION" ), "r" ) as f :
472
+ version = f .read ()
473
+ logger .info ("Running version {}" .format (version ))
474
+ except Exception :
475
+ pass
476
+
470
477
uri , url_root = set_url_root (logger , os .environ .get ('URL_ROOT' ))
471
478
logger .debug ("URL_ROOT = {}" .format (url_root ))
472
479
logger .debug ("URI = {}" .format (uri ))
You can’t perform that action at this time.
0 commit comments