From 6266c927f9aa0722ecfe7e8a203501bc7f69c309 Mon Sep 17 00:00:00 2001 From: Kaitlyn Parkhurst Date: Sun, 20 Nov 2022 22:11:35 -0800 Subject: [PATCH] Docs --- README.md | 63 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index d2b335f..fe43515 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,10 @@ MyJekyllBlog comes with a complete set of ansible roles to automate the installa 2. [Restore Gitea Data](#restore-gitea-data) 4. [Development Guide](#development-guide) 1. [Enable development mode](#enable-development-mode) - 2. [Working on the web panel](#working-on-the-web-panel) - 3. [Working on the database model](#working-on-the-database-model) - 4. [Working on the ssl certificates](#working-on-the-ssl-certificates) - 5. [Working on the build and deploy process](#working-on-the-build-and-deploy-process) - 6. [Working on the nginx web servers](#working-on-the-nginx-web-servers) + 2. [Reload Default Minion Worker](#reload-default-minion-worker) + 3. [Reload Certbot Minion Worker](#reload-certbot-minion-worker) + 4. [Extend the DB Schema](#extend-the-db-schema) + 5. [Run Jekyll](#run-jekyll) @@ -277,7 +276,6 @@ Now that the `panel_config.jekyll_init_repo` repository exists, we should be rea 3. Create a post 4. Delete a post - ## Operations Guide ### How to perform a system backup @@ -345,56 +343,57 @@ To make development easier, you can enable development tools on any given enviro ansible-playbook -i env/stage/inventory.yml --vault-password-file .vault_password -e @env/stage/vault.yml tools-development.yml ``` -Some changes to the environment after running the tools-development playbook include the following: +Some changes to the environment after running the tools-development playbook are: + +**Panel Server** * Changes to files in `Web/lib` and `Web/template` will cause Mojolicious to reload the app * Docker is installed to use `create-classes` in `DB/` -### Working on the web panel +### Reload Default Minion Worker -### Working on the database models +The default minion worker handles building Jekyll blogs, syncing files and media, and other tasks that use the `default` queue. -### Working on the ssl certificates +To pull the latest changes and reload it, perform the following, replacing `build-server` with the hostname of the build server. -### Working on the build and deploy process +```bash +ssh manager@build-server 'cd mjb; git pull --ff-only origin master' +ssh root@build-server 'systemctl restart mjb.worker' +``` -### Working on the nginx web servers +### Reload Certbot Minion Worker +The certbot minion worker handles let's encrypt certificate requests, syncing SSL certificates with web server nodes, and other tasks that use the `certbot` queue. +To pull the latest changes and reload it, perform the following, replacing `certbot-server` with the hostname of the certbot server. +```bash +ssh manager@certbot-server 'cd mjb; git pull --ff-only origin master' +ssh root@certbot-server 'systemctl restart mjb.certbot' +``` -## Development Guide +### Extend the DB Schema -### MJB::Web Panel Development +To extend the DB schema you should be on a **panel** server after [Enabling development mode](#enable-development-mode). -As root you will need to stop the MJB::Web app from running in production. +The database can be extended by editing `DB/etc/schema.sql` -```bash -systemctl stop mjb.panel -``` - -As the manager user you can run the application in development mode. +The DBIx::Class models can be regenerated with the updated `DB/etc/schema.sql` by running the following. ```bash -cd mjb/Web -morbo ./script/mjb --listen http://127.0.0.1:8080 +cd mjb/DB +./bin/create-classes ``` -Now it will automatically reload when you make changes to the libraries and templates. Additionally, it will show stack traces during crashes and debug information in your terminal. +Inspect the newly generated DB/lib files. To update an existing database, you may need to form alter table statements to match the changes you made to the schema.sql file. -### Jekyll +### Run Jekyll -You can run Jekyll by getting into a build server and running the following: +If you need to use Jekyll directly, shell into a build server and set the following alias. ```bash alias jekyll="podman run -ti --rm -v .:/srv/jekyll -e JEKYLL_ROOTLESS=1 docker.io/jekyll/jekyll jekyll" ``` -Once you've done that, `jekyll command` will work. - -## Operations Guide - - - - +Once you have done so, you should be able to use `jekyll` directly.