uky-web / uky_platform_dev_tools

0 stars 0 forks source link

Refactor Lando install scripts #15

Open renmfox opened 2 months ago

renmfox commented 2 months ago

The current iteration of the Lando install script has some issues that prevent it from executing properly. Firstly it is set to search for a reference DB dump named sanitized.sql, while the current dumps are gzipped, so the script never finds the dump. Secondly, the script defaults to assuming that it is being run from the host machine when running actions. This would execute as expected when run from the host's project directory (e.g. ./.lando/scripts/lando-install.sh), but when run via the Lando tooling (e.g. lando site-install) it is unable to run a db-import, both due to the missing alias name and the fact that the appserver service cannot directly talk to the database service.

This PR makes a couple of changes to split up the site install process and make sure that it can be run from the host machine or container/tooling properly:

It's overall still a tad messy, and may have some confusing language in certain cases (e.g. with no reference DB, calling the site-install tooling will show a message asking the user to manually run site-install.sh, but the tooling will run it afterwards anyway), but it should function cleanly.