diff --git a/Dockerfile b/Dockerfile index 0074a6e..406af43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,13 @@ ENV GROUPER_SYSTEM_PASSWORD=3cf0ccc7d6b240390188367933c9cd90 ENV MYSQL_HOST=mariadb ADD ./container_files /root -COPY conf/grouper.installer.properties /opt/grouper/$version +COPY conf/grouper.hibernate.properties /opt/grouper/$version -RUN /root/container_start.sh +RUN rm /opt/grouper/2.3.0/grouper.apiBinary-2.3.0/conf/grouper.hibernate.properties && \ + ln -s /opt/grouper/$version/grouper.hibernate.properties /opt/grouper/2.3.0/grouper.apiBinary-2.3.0/conf/grouper.hibernate.properties && \ + rm /opt/grouper/2.3.0/grouper.ws-2.3.0/grouper-ws/build/dist/grouper-ws/WEB-INF/classes/grouper.hibernate.properties && \ + ln -s /opt/grouper/$version/grouper.hibernate.properties /opt/grouper/2.3.0/grouper.ws-2.3.0/grouper-ws/build/dist/grouper-ws/WEB-INF/classes/grouper.hibernate.properties && \ + rm /opt/grouper/2.3.0/grouper.ui-2.3.0/dist/grouper/WEB-INF/classes/grouper.hibernate.properties && \ + ln -s /opt/grouper/$version/grouper.hibernate.properties /opt/grouper/2.3.0/grouper.ui-2.3.0/dist/grouper/WEB-INF/classes/grouper.hibernate.properties VOLUME /opt/grouper/2.3.0/apache-tomcat-$TOMCAT_VERSION/logs \ No newline at end of file diff --git a/conf/grouper.hibernate.properties b/conf/grouper.hibernate.properties new file mode 100644 index 0000000..016cb1d --- /dev/null +++ b/conf/grouper.hibernate.properties @@ -0,0 +1,45 @@ +# +# Copyright 2014 Internet2 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# Grouper Hibernate Configuration +# $Id: grouper.hibernate.example.properties,v 1.9 2009-08-11 20:18:09 mchyzer Exp $ +# + +# The grouper hibernate config uses Grouper Configuration Overlays (documented on wiki) +# By default the configuration is read from grouper.hibernate.base.properties +# (which should not be edited), and the grouper.hibernate.properties overlays +# the base settings. See the grouper.hibernate.base.properties for the possible +# settings that can be applied to the grouper.hibernate.properties + +######################################## +## DB settings +######################################## + +# e.g. mysql: jdbc:mysql://localhost:3306/grouper +# e.g. p6spy (log sql): [use the URL that your DB requires] +# e.g. oracle: jdbc:oracle:thin:@server.school.edu:1521:sid +# e.g. hsqldb (a): jdbc:hsqldb:dist/run/grouper;create=true +# e.g. hsqldb (b): jdbc:hsqldb:hsql://localhost:9001/grouper +# e.g. postgres: jdbc:postgresql://localhost:5432/database +# e.g. mssql: jdbc:sqlserver://localhost:3280;databaseName=grouper +hibernate.connection.url = jdbc:mysql://#MYSQL_HOST#:3306/#MYSQL_DATABASE# + +hibernate.connection.username = #MYSQL_USER# +# If you are using an empty password, depending upon your version of +# Java and Ant you may need to specify a password of "". +# Note: you can keep passwords external and encrypted: https://bugs.internet2.edu/jira/browse/GRP-122 +hibernate.connection.password = #MYSQL_USER# \ No newline at end of file diff --git a/container_files/configure.sh b/container_files/configure.sh index 3c65bdb..fd9739a 100755 --- a/container_files/configure.sh +++ b/container_files/configure.sh @@ -2,10 +2,12 @@ sed -i "s|#GROUPER_SYSTEM_PASSWORD#|$GROUPER_SYSTEM_PASSWORD|g" /opt/grouper/2.3.0/grouper.installer.properties -sed -i "s|#MYSQL_HOST#|$MYSQL_HOST|g" /opt/grouper/2.3.0/grouper.installer.properties +sed -i "s|#MYSQL_HOST#|$MYSQL_HOST|g" /opt/grouper/2.3.0/grouper.hibernate.properties -sed -i "s|#MYSQL_USER#|$MYSQL_USER|g" /opt/grouper/2.3.0/grouper.installer.properties +sed -i "s|#MYSQL_USER#|$MYSQL_USER|g" /opt/grouper/2.3.0/grouper.hibernate.properties -sed -i "s|#MYSQL_PASSWORD#|$MYSQL_PASSWORD|g" /opt/grouper/2.3.0/grouper.installer.properties +sed -i "s|#MYSQL_PASSWORD#|$MYSQL_PASSWORD|g" /opt/grouper/2.3.0/grouper.hibernate.properties -cat /opt/grouper/2.3.0/grouper.installer.properties \ No newline at end of file +sed -i "s|#MYSQL_DATABASE#|$MYSQL_DATABASE|g" /opt/grouper/2.3.0/grouper.hibernate.properties + +cat /opt/grouper/2.3.0/grouper.hibernate.properties \ No newline at end of file