oliverdavies.uk-drupal-old/README.md

68 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

# oliverdavies.uk
## Hosting
2021-05-18 06:38:40 +00:00
This site is hosted on a DigitalOcean droplet, which was created using [Ansible][] (see `tools/deployment/digitalocean.yml`).
[Ansible]: https://www.ansible.com
2020-02-19 01:16:21 +00:00
## Provisioning
To re-provision the server:
```bash
# Download the required roles
2021-05-18 06:38:40 +00:00
ansible-galaxy install -r tools/deployment/requirements.yml --force
2020-02-19 01:16:21 +00:00
# Run the provision playbook
2021-05-18 06:38:40 +00:00
ansible-playbook tools/deployment/provision.yml
2020-02-19 01:16:21 +00:00
```
### 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.
2021-05-18 06:38:40 +00:00
To run a deployment manually, run `ansible-playbook tools/deployment/deploy.yml --ask-vault-pass`.
The Vault password is stored in LastPass.
[Ansistrano]: https://ansistrano.com
#### Generating settings files
2021-05-18 06:38:40 +00:00
Production settings files are generated automatically during a deployment. This is done using the [opdavies.drupal_settings_files][drupal_settings_files] Ansible role, using variables from `tools/deployment/vars/deploy_vars.yml`, and performed during Ansistranos `After update code` build step.
2020-07-02 22:18:37 +00:00
[drupal_settings_files]: https://galaxy.ansible.com/opdavies/drupal_settings_files
2020-05-09 01:41:15 +00:00
## Local development
### Migrating data into the website
2020-05-09 01:41:15 +00:00
To view the status of all the migrations:
./run drush migrate:status
2020-05-09 01:41:15 +00:00
To run all the migrations:
./run drush migrate:import --all
2020-05-09 01:41:15 +00:00
To run all the migrations and update the existing migrated content:
./run drush migrate:import --all --update
2020-05-13 11:46:12 +00:00
### Updating Drupal core
Updating Drupal core (and anything else) can be done using Composer. As this project is built using the Drupal core recommended project, all of the dependencies need to be updated:
./run composer update drupal/core-* --with-all-dependencies
Once this has completed, the updated `composer.lock` file can be committed and pushed.
2020-05-13 11:46:12 +00:00
## 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.