Find a file
2020-11-10 20:25:07 +00:00
.ddev Remove command to get a database from the server 2020-11-02 01:20:27 +00:00
.github Ensure that theme assets can be built 2020-11-02 14:25:26 +00:00
.idea Remove .git directories within contrib modules 2020-10-24 19:46:17 +01:00
config Use dark mode for Gin admin theme 2020-11-02 01:04:30 +00:00
config_splits/live Move config splits 2020-10-30 00:56:36 +00:00
tools/ansible Remove command to get a database from the server 2020-11-02 01:20:27 +00:00
web Extract helper methods 2020-11-10 20:25:07 +00:00
.gitignore Add DDEV configuration 2020-09-16 19:41:48 +01:00
composer.json Update to Drush 10 2020-11-01 22:03:58 +00:00
composer.lock Update contrib modules 2020-11-02 00:33:52 +00:00
phpcs.xml.dist Add phpcs.xml.dist 2020-06-30 17:34:31 +01:00
phpstan.neon Fix PHPStan issues 2020-09-04 22:20:30 +01:00
phpunit.xml.dist Update SIMPLETEST_BASE_URL 2020-10-24 19:38:57 +01:00
README.md Document custom DDEV commands in README 2020-10-31 09:25:51 +00:00

oliverdavies.uk

Hosting

This site is hosted on a DigitalOcean droplet, which was created using Ansible (see tools/ansible/digitalocean.yml).

Provisioning

To re-provision the server:

# Download the required roles
ansible-galaxy install -r tools/ansible/requirements.yml --force

# Run the provision playbook
ansible-playbook tools/ansible/provision.yml

Deploying

Deployments for this site for managed with Ansible and Ansistrano. Ansible Vault is used to manage sensitive information like database passwords.

Deployments are triggered automatically when changes are pushed to GitHub, and are performed automatically via GitHub Actions on each push to the production branch.

To run a deployment manually, run ansible-playbook tools/ansible/deploy.yml --ask-vault-pass. The Vault password is stored in LastPass.

Generating settings files

Production settings files are generated automatically during a deployment. This is done using the opdavies.drupal_settings_files Ansible role, using variables from tools/ansible/vars/deploy_vars.yml, and performed during Ansistranos After update code build step.

Local development

Local development is done using DDEV-Local.

Custom DDEV commands

Drupal

Command Description
ddev app install Install the site based on the existing config
ddev app refresh Re-import the existing config and rebuild cache

Front-end

Command Description
ddev theme build Compile a production (minified and purged) version of the theme's CSS and JS
ddev theme dev Compile a development version of the theme's CSS and JS
ddev theme install Install the node dependencies for the theme
ddev theme ssh SSH into the theme directory within the web container
ddev theme watch Compile a development version of the theme's CSS and JS, and watch for changes

Migrating data into the website

To view the status of all the migrations:

bin/drush.sh migrate:status

To run all the migrations:

bin/drush.sh migrate:import --all

To run all the migrations and update the existing migrated content:

bin/drush.sh migrate:import --all --update

Talks ordering

In order to keep the talks page in the correct order, based on when the next time a talk is being given, the created date for the talk node is automatically updated on each save to match the date of the most future event for that talk.

The view is then sorting the talk nodes based on their created date.