BlackflySolutions / Simuliidae

An open source Drupal CiviCRM Container Stack
GNU Affero General Public License v3.0
12 stars 4 forks source link

Automation #14

Open adixon opened 7 months ago

adixon commented 7 months ago

I'd like to set up some automation to allow a visitor to sign up for a site and have it generated for them automatically.

My thinking about a strategy for this is:

  1. The form completion will generate a .env file for the site in a special "pending sites" directory, by host-mounting that directory into the container running the form.
  2. Set up systemd path unit to monitor that directory and run a script that will run site-deploy on the oldest file in that directory, and then move the file over to a "auto-generated sites" directory for human review and followups.

Here are a couple of useful posts about systemd path units. https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files https://www.putorius.net/systemd-path-units.html

adixon commented 4 months ago

Some work on this on glatthaarti, Nov 2023: setup vdeploy.path and vdeploy.service in /etc/systemd/system

If you add a .env file into /var/www/vsite/pending, it'll run /usr/local/bin/next-deploy.sh

For my mayfly service, we'll want to monitor /var/www/vsite/mayfly and do something a little different (maybe just run the /usr/local/bin/mayfly-generate with the right arguments and pipe it to the pending directory?).