oliverdavies.uk/content/node.8f2bed8f-56cb-4269-8e1d-082af6201775.yml

69 lines
4 KiB
YAML

uuid:
- value: 8f2bed8f-56cb-4269-8e1d-082af6201775
langcode:
- value: en
type:
- target_id: daily_email
target_type: node_type
target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7
revision_timestamp:
- value: '2025-05-11T09:00:46+00:00'
revision_uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
revision_log: { }
status:
- value: true
uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
title:
- value: |
Why I built a tool to generate configuration files
created:
- value: '2023-03-04T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:46+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2023/03/04/why-i-built-a-tool-to-generate-configuration-files
langcode: en
body:
- value: |
<p>I'm always working on various personal and client projects, and they contain a lot of the same configuration files. I exclusively use Docker and Docker Compose on all projects, I use a <code>justfile</code> for running tasks, and for PHP projects, I need configuration files for tools like PHPStan, PHPCS and PHPUnit.</p>
<p>The majority of those files are the same with some slight configuration for each project - such as whether it uses <code>web</code> or <code>docroot</code>, or which paths are checked with static analysis or for coding standards issues.</p>
<p>I've given a talk called <a href="/presentations/working-with-workspace">Working with Workspace</a> - a tool that we used at an agency I worked at. It had two functions - to execute project tasks and to generate configuration files from templates.</p>
<p>I use a <code>justfile</code> to execute tasks and commands but needed to write my own tool to generate the configuration files.</p>
<p>The result is that I can add one YAML file to a project, enter the values that it needs and when I run the CLI tool, it will generate all of the files the project needs.</p>
<p>As well as being faster to set up a project, like a <a href="https://github.com/opdavies/docker-examples/tree/main/drupal-localgov">LocalGov Drupal Docker example</a>, having a canonical set of templated configuration files I can enhance and maintain by adding new features and fixes and they'll be added to every project when I next generate its files.</p>
format: full_html
processed: |
<p>I'm always working on various personal and client projects, and they contain a lot of the same configuration files. I exclusively use Docker and Docker Compose on all projects, I use a <code>justfile</code> for running tasks, and for PHP projects, I need configuration files for tools like PHPStan, PHPCS and PHPUnit.</p>
<p>The majority of those files are the same with some slight configuration for each project - such as whether it uses <code>web</code> or <code>docroot</code>, or which paths are checked with static analysis or for coding standards issues.</p>
<p>I've given a talk called <a href="http://default/presentations/working-with-workspace">Working with Workspace</a> - a tool that we used at an agency I worked at. It had two functions - to execute project tasks and to generate configuration files from templates.</p>
<p>I use a <code>justfile</code> to execute tasks and commands but needed to write my own tool to generate the configuration files.</p>
<p>The result is that I can add one YAML file to a project, enter the values that it needs and when I run the CLI tool, it will generate all of the files the project needs.</p>
<p>As well as being faster to set up a project, like a <a href="https://github.com/opdavies/docker-examples/tree/main/drupal-localgov">LocalGov Drupal Docker example</a>, having a canonical set of templated configuration files I can enhance and maintain by adding new features and fixes and they'll be added to every project when I next generate its files.</p>
summary: null
field_daily_email_cta: { }