AlliumCepa / webgui

A free open source content management system and web application framework. The most widely deployed mod_perl application on the planet.
http://www.webgui.org/
41 stars 14 forks source link

DB test fails when using alternate configuration #39

Closed dannymk closed 5 years ago

dannymk commented 5 years ago

The Docker container does not run when we provide a custom configuration file. The code below in the "/entrypoint" file fails the DB test for any system that does not have the proper host and credentials:

while true; do
    mysql --user=webgui --password=123qwe www_example_com --host db -e 'select 1;' && break
    # mysql -e 'select * from webguiVersion;' `perl -Ilib sbin/wgd db --config-file=webgui.conf --webgui-root=/WebGUI --print` && break # fails and I can't see why
    echo "waiting for the database to come up..."
    sleep 10
done
scottwalters commented 5 years ago

That now uses wgd db --print to get connection info.

It now also only attempts upgrades if the code version is out of sync with the database version, which should only happen when they pull a new version of wG off of dockerhub or when a brand new 8 is first started. I believe that gives people control over upgrades.

It also loops over each config file found using wgd for-each. If users create a volume for etc/ and use a different config file or multiple ones, then everything will still work, and it'll upgrade each database that needs it.

scottwalters commented 5 years ago

3f0360d533cfc1fca04394e8e1afe983b081d184

And I will start tagging the issue num from the commits when there's an issue (my brain seems to think that that feature only exists for $work).