[Rt-commit] 06/07: Default to entire Docker network for db-rt-host

Brett Smith brett at bestpractical.com
Thu Aug 5 20:00:48 UTC 2021


This is an automated email from the git hooks/post-receive script.

brett pushed a commit to branch 5.0/github-actions-tests
in repository rtir.

commit 22b0b9a43516e4ce4310d4a881365654e4267cb3
Author: Brett Smith <brett at bestpractical.com>
AuthorDate: Thu Aug 5 15:56:17 2021 -0400

    Default to entire Docker network for db-rt-host
    
    The --with-db-rt-host option is only used for the MySQL/MariaDB user
    GRANT and must be an IP address with optional netmask. When the build
    does not specify a value, build a value based on the netmask for the
    same Docker network as the build.
---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 1681bb1a..2c7b5130 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,7 +9,7 @@ ARG RT_DB_TYPE=mysql
 ARG RT_DBA_USER=root
 ARG RT_DBA_PASSWORD=password
 ARG RT_TEST_DB_HOST=172.17.0.2
-ARG RT_TEST_RT_HOST=172.17.0.3
+ARG RT_TEST_RT_HOST
 
 RUN cd /usr/local/src \
   && git clone https://github.com/bestpractical/rt.git \
@@ -22,7 +22,7 @@ RUN cd /usr/local/src \
      --with-db-type="$RT_DB_TYPE" \
      --with-db-database="$RT_DB_NAME" \
      --with-db-host="$RT_TEST_DB_HOST" \
-     --with-db-rt-host="$RT_TEST_RT_HOST" \
+     --with-db-rt-host="${RT_TEST_RT_HOST:-$(ip --oneline address show to 172.16/12 | gawk '{split($4, a, "/"); print a[1] "/255.255.255.0"; exit 0;}')}" \
   && make install \
   && /usr/bin/perl -I/opt/rt5/local/lib -I/opt/rt5/lib sbin/rt-setup-database --action init --dba="$RT_DBA_USER" --dba-password="$RT_DBA_PASSWORD" \
   && rm -rf /usr/local/src/*

-- 
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.


More information about the rt-commit mailing list