Commit graph

24 commits

Author SHA1 Message Date
Oliver Davies 8db64458b1 refactor(*): change to a Symfony Console app 2023-04-24 01:05:07 +01:00
Oliver Davies 82889f1fa9 chore: update managed text 2023-04-21 22:36:31 +01:00
Oliver Davies a6e7e7bf57 refactor: split commands into separate classes
This reverts commit d701f0e2a3.
2023-04-21 22:34:01 +01:00
Oliver Davies d701f0e2a3 refactor: split commands into separate classes
Use mnapoli/silly-php-di which allows for using a dependency injection
container and for separating commands into separate classes and files.o

Refs: OD-20
2023-04-21 22:24:19 +01:00
Oliver Davies 5ee6810c95 feat: only create PHPStan file if it's set
Only create a `phpstan.neon.dist` file if the `php.phpstan` object is
set within the project's `build.yaml` file.
2023-04-21 12:39:05 +01:00
Oliver Davies 27ce1dc100 chore: rename commands
- Renamed `generate-build-file` to `init` as it's initialising a new
  project.
- Renamed `run` to `generate` as it's generating the configuration
  files.
2023-04-21 11:51:28 +01:00
Oliver Davies 02c8b41194 feat: generate GitHub Actions configuration
Generate a GitHub Actions workflow file if a project is opted-in for
this feature.

Refs: OD-29
2023-04-21 01:39:43 +01:00
Oliver Davies 4bf72b59e3 refactor: extract functions 2023-04-20 22:42:39 +01:00
Oliver Davies ac1e0dc2c8 refactor: add a TemplateFile DTO
Add a data transfer object that stores the source file name, the file
name to generate and an optional path to create for each file to
generate.

As I'm using a `readonly` class for the DTO, this required updating PHP
to 8.2.

nix develop --command php bin/build-configs run
2023-04-20 22:31:15 +01:00
Oliver Davies e30929e69c refactor: serialise and validate a configuration
...data object
2023-04-07 20:03:52 +01:00
Oliver Davies a6ff416012 feat: display a list of generated files
Refs: OD-1
2023-04-07 10:29:41 +01:00
Oliver Davies 4d034d9ba2 feat: allow for adding extra databases
Allow for declaring extra databases that should be created when the
project is first started. This is done by adding an `extra_databases`
key to `database`, containing a list of database names.

```yaml
database:
  type: mariadb
  version: 10
  extra_databases:
    - tinhat
    - freshcover
```
2023-04-07 08:40:42 +01:00
Oliver Davies 9cc2f181ee feat: add hadolint configuration 2023-04-01 20:27:15 +01:00
Oliver Davies 31bf4af68d fix: allow for no docroot for Drupal projects
Some projects don't use a docroot/web/public directory so this needs be
able to be set to `null`. As I can't do this with Twig's `is not
defined` test, I'll need to remove the default `web` value and add it to
the build.yaml file for the appropriate projects.

If I can get this to work in the future, I'll re-add `web` as the
default value as that's the default and most common option.
2023-04-01 20:27:15 +01:00
Oliver Davies af7357b639 refactor: group imports 2023-04-01 20:27:15 +01:00
Oliver Davies 91e9da1454 feat: add command to generate a build file
Creates an initial `build.yaml` file based on the provided project name
and type.

Fixes #32
2023-04-01 20:26:24 +01:00
Oliver Davies 39956ee2f5 feat: add .dockerignore 2023-03-14 15:06:13 +00:00
Oliver Davies cf25359c7b refactor: use mnapoli/silly 2023-03-13 02:00:33 +00:00
Oliver Davies a70557d2d5 refactor: extract a configuration validator 2023-02-25 00:21:43 +00:00
Oliver Davies b1da05e9cf Rename binary file and make it executable 2023-01-21 20:48:03 +00:00
Oliver Davies 83cb16a818 Rename files and update namespace 2023-01-21 20:42:52 +00:00
Oliver Davies f2e95f2b07 Rename the bin file 2023-01-21 19:52:04 +00:00
Oliver Davies fdcd11500a Set a default command 2023-01-19 20:23:01 +00:00
Oliver Davies a78d53a301 Refactor 2023-01-19 20:10:04 +00:00