Oliver Davies
6d9ecd8df0
Rather than the custom event sorting plugin being based on the `created` value, this change adds a new `field_event_date` field to the talk node type and uses this for the sorting instead. This commit also adds a new `TalkDateUpdater` service that extracts either the next event date if there is a future date, or the last past event date if there is no future date, from `field_events` for each talk and saves it into the event date field. For consistency, and to ensure that the results are ordered correctly, the talk date updater converts the date from a date string (e.g. `2020-08-24`) into a UNIX timestamp, and the timestamp is saved in the event date field. This can be changed at a later date if needed. The talks view has been updated to use the updated sort plugin, and the existing tests have been updated to use the new field. References #204 |
||
---|---|---|
.github | ||
.idea | ||
bin | ||
config | ||
tools/ansible | ||
web | ||
.gitignore | ||
.gitmodules | ||
.php-version | ||
ansible.cfg | ||
composer.json | ||
composer.lock | ||
docker-compose.yaml | ||
Makefile | ||
php.ini | ||
phpcs.xml.dist | ||
phpstan.neon | ||
phpunit.xml.dist | ||
README.md |
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 Ansistrano’s After update code
build step.
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.