From 82e8bbb771e28aeddc59242afc232102c4f1237b Mon Sep 17 00:00:00 2001 From: Altonhe Date: Tue, 16 Jul 2024 01:15:59 -0400 Subject: [PATCH] feat: update oba version to `2.5.12-cs` --- bundler/Dockerfile | 2 +- oba/Dockerfile | 4 +- oba/bootstrap.sh | 17 ++- oba/config/context.xml | 40 ++++++ .../onebusaway-api-webapp-data-sources.xml | 135 ++++++++++-------- ...ay-enterprise-acta-webapp-data-sources.xml | 97 ++++++++----- ...it-data-federation-webapp-data-sources.xml | 40 ++++-- 7 files changed, 220 insertions(+), 115 deletions(-) create mode 100644 oba/config/context.xml diff --git a/bundler/Dockerfile b/bundler/Dockerfile index 83e1261..bcd5740 100644 --- a/bundler/Dockerfile +++ b/bundler/Dockerfile @@ -1,6 +1,6 @@ FROM tomcat:8.5.98-jdk11-temurin -ARG OBA_VERSION=2.4.18-cs +ARG OBA_VERSION=2.5.12-cs ENV OBA_VERSION_ENV=$OBA_VERSION # Start configuring OBA diff --git a/oba/Dockerfile b/oba/Dockerfile index 09781c1..034e875 100644 --- a/oba/Dockerfile +++ b/oba/Dockerfile @@ -2,7 +2,7 @@ FROM tomcat:8.5.98-jdk11-temurin ENV CATALINA_HOME /usr/local/tomcat ENV TZ=America/New_York -ARG OBA_VERSION=2.4.18-cs +ARG OBA_VERSION=2.5.12-cs ENV OBA_VERSION=$OBA_VERSION ARG GID=1000 @@ -54,6 +54,8 @@ WORKDIR /oba/tools RUN wget "https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-transit-data-federation-builder/${OBA_VERSION}/onebusaway-transit-data-federation-builder-${OBA_VERSION}-withAllDependencies.jar" # Tomcat Configuration +COPY ./config/context.xml $CATALINA_HOME/conf/context.xml + WORKDIR /oba/webapps/onebusaway-transit-data-federation-webapp RUN cp /oba/libs/onebusaway-transit-data-federation-webapp-${OBA_VERSION}.war . RUN jar xvf onebusaway-transit-data-federation-webapp-${OBA_VERSION}.war diff --git a/oba/bootstrap.sh b/oba/bootstrap.sh index 88c7a5f..60232b5 100644 --- a/oba/bootstrap.sh +++ b/oba/bootstrap.sh @@ -15,7 +15,7 @@ if [ -n "$GTFS_URL" ]; then . fi -# For users who want to configure the data-sources.xml file themselves +# For users who want to configure the data-sources.xml file and database themselves if [ -n "$USER_CONFIGURED" ]; then echo "USER_CONFIGURED is set, you should create your own configuration file, Aborting..." exit 0 @@ -152,3 +152,18 @@ else mv "$TMP_JSON_FILE" "$LOCAL_JSON_FILE" fi fi + +CONTEXT_XML_FILE="$CATALINA_HOME/conf/context.xml" +# only update the parameters, therefore is impotent +if [ -n "$JDBC_URL" ]; then + echo "JDBC_URL set to $JDBC_URL, setting in context.xml" + xmlstarlet ed -L -u "//Resource[@name='jdbc/appDB']/@url" -v "$JDBC_URL" ${CONTEXT_XML_FILE} +fi +if [ -n "$JDBC_USER" ]; then + echo "JDBC_URL set to $JDBC_USER, setting in context.xml" + xmlstarlet ed -L -u "//Resource[@name='jdbc/appDB']/@username" -v "$JDBC_USER" ${CONTEXT_XML_FILE} +fi +if [ -n "$JDBC_PASSWORD" ]; then + echo "JDBC_URL set to $JDBC_PASSWORD, setting in context.xml" + xmlstarlet ed -L -u "//Resource[@name='jdbc/appDB']/@password" -v "$JDBC_PASSWORD" ${CONTEXT_XML_FILE} +fi diff --git a/oba/config/context.xml b/oba/config/context.xml new file mode 100644 index 0000000..bef3cf7 --- /dev/null +++ b/oba/config/context.xml @@ -0,0 +1,40 @@ + + + + + + + + WEB-INF/web.xml + ${catalina.base}/conf/web.xml + + + + + diff --git a/oba/config/onebusaway-api-webapp-data-sources.xml b/oba/config/onebusaway-api-webapp-data-sources.xml index 9add335..9bc770e 100644 --- a/oba/config/onebusaway-api-webapp-data-sources.xml +++ b/oba/config/onebusaway-api-webapp-data-sources.xml @@ -1,62 +1,84 @@ - + - - - - - - - - - - - - - - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + org.onebusaway.agency_metadata.model.AgencyMetadata + org.onebusaway.agency_metadata.service.AgencyMetadataDaoImpl + + + + + org.hibernate.dialect.MySQLDialect + 1 + + org.hibernate.cache.internal.NoCachingRegionFactory + true + update + 1000 + + + - - - - - org.onebusaway.agency_metadata.model.AgencyMetadata - org.onebusaway.agency_metadata.service.AgencyMetadataDaoImpl - - - - - 1 - org.hibernate.cache.NoCacheProvider - - - + + + + org.onebusaway.api_webapp.cacheManager + + + + + + + + + + - - - - - - - - + @@ -70,11 +92,4 @@ - - - - org.onebusaway.api_webapp.cacheManager - - - diff --git a/oba/config/onebusaway-enterprise-acta-webapp-data-sources.xml b/oba/config/onebusaway-enterprise-acta-webapp-data-sources.xml index 521db2c..ff981f0 100644 --- a/oba/config/onebusaway-enterprise-acta-webapp-data-sources.xml +++ b/oba/config/onebusaway-enterprise-acta-webapp-data-sources.xml @@ -1,59 +1,82 @@ - + + + + + - - + + + + + + + - - - - - + + + + + + + - - + + + + + - org.onebusaway.nyc_webapp.cacheManager + org.onebusaway.onebusaway-enterprise-acta-webapp.cacheManager - - - - - + - - - + + \ No newline at end of file diff --git a/oba/config/onebusaway-transit-data-federation-webapp-data-sources.xml b/oba/config/onebusaway-transit-data-federation-webapp-data-sources.xml index 7ff7967..e677a12 100644 --- a/oba/config/onebusaway-transit-data-federation-webapp-data-sources.xml +++ b/oba/config/onebusaway-transit-data-federation-webapp-data-sources.xml @@ -9,13 +9,33 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - - - - - + + + + + + + + + + + + + + + + + + + @@ -25,18 +45,8 @@ - - - - - - - - - -