diff --git a/src/Action/CreateListOfFilesToGenerate.php b/src/Action/CreateListOfFilesToGenerate.php index ec2bcdf..fb6355a 100644 --- a/src/Action/CreateListOfFilesToGenerate.php +++ b/src/Action/CreateListOfFilesToGenerate.php @@ -91,6 +91,30 @@ final class CreateListOfFilesToGenerate name: 'php.ini', path: 'tools/docker/images/php/root/usr/local/etc/php', )); + + if (static::isCaddy(Arr::get($configurationData, 'web.type'))) { + $filesToGenerate[] = new TemplateFile( + data: 'drupal/caddy/Caddyfile', + name: 'Caddyfile', + path: 'tools/docker/images/web/root/etc/caddy', + ); + } + + if (static::isNginx(Arr::get($configurationData, 'web.type'))) { + $filesToGenerate[] = new TemplateFile( + data: 'drupal/nginx/default.conf', + name: 'default.conf', + path: 'tools/docker/images/web/root/etc/nginx/conf.d', + ); + } + + if (Arr::get($configurationData, 'experimental.createGitHubActionsConfiguration', false) === true) { + $filesToGenerate[] = new TemplateFile( + data: 'drupal/.github/workflows/ci.yml', + name: 'ci.yml', + path: '.github/workflows', + ); + } break; } @@ -117,52 +141,6 @@ final class CreateListOfFilesToGenerate $filesToGenerate[] = new TemplateFile(data: 'docker-compose.yaml', name: 'docker-compose.yaml'); } - if (static::isPhp(Arr::get($configurationData, 'language'))) { - if ($isDocker) { - $filesToGenerate[] = new TemplateFile(data: 'php/Dockerfile', name: 'Dockerfile'); - } - - $filesToGenerate[] = new TemplateFile(data: 'php/phpcs.xml', name: 'phpcs.xml.dist'); - $filesToGenerate[] = new TemplateFile(data: 'php/phpunit.xml', name: 'phpunit.xml.dist'); - $filesToGenerate[] = new TemplateFile( - data: 'php/docker-entrypoint-php', - name: 'docker-entrypoint-php', - path: 'tools/docker/images/php/root/usr/local/bin', - ); - $filesToGenerate[] = new TemplateFile( - data: 'php/php.ini', - name: 'php.ini', - path: 'tools/docker/images/php/root/usr/local/etc/php', - ); - - if (Arr::has(array: $configurationData, keys: 'php.phpstan')) { - $filesToGenerate[] = new TemplateFile(data: 'php/phpstan.neon', name: 'phpstan.neon.dist'); - } - } - - if (static::isCaddy(Arr::get($configurationData, 'web.type'))) { - $filesToGenerate[] = new TemplateFile( - data: 'web/caddy/Caddyfile', - name: 'Caddyfile', - path: 'tools/docker/images/web/root/etc/caddy', - ); - } - - if (static::isNginx(Arr::get($configurationData, 'web.type'))) { - $filesToGenerate[] = new TemplateFile( - data: 'web/nginx/default.conf', - name: 'default.conf', - path: 'tools/docker/images/web/root/etc/nginx/conf.d', - ); - } - - if (Arr::get($configurationData, 'experimental.createGitHubActionsConfiguration', false) === true) { - $filesToGenerate[] = new TemplateFile( - data: 'ci/github-actions/ci.yml', - name: 'ci.yml', - path: '.github/workflows', - ); - } $filesToGenerate[] = new TemplateFile( data: 'git-hooks/prepare-commit-msg', @@ -212,13 +190,4 @@ final class CreateListOfFilesToGenerate return strtoupper($webServer) === WebServer::NGINX->name; } - - private static function isPhp(?string $language): bool - { - if (is_null($language)) { - return false; - } - - return strtoupper($language) === Language::PHP->name; - } } diff --git a/templates/ci/github-actions/ci.yml.twig b/templates/drupal/.github/workflows/ci.yml.twig similarity index 88% rename from templates/ci/github-actions/ci.yml.twig rename to templates/drupal/.github/workflows/ci.yml.twig index b23d7d2..c1eff6f 100644 --- a/templates/ci/github-actions/ci.yml.twig +++ b/templates/drupal/.github/workflows/ci.yml.twig @@ -42,10 +42,5 @@ jobs: just test --testdox --colors=always - {% if "phpcs" in php|keys -%} just _run php phpcs - {%- endif %} - - {% if "phpstan" in php|keys -%} just _run php phpstan analyze --no-progress --memory-limit=512M - {%- endif %} diff --git a/templates/web/caddy/Caddyfile.twig b/templates/drupal/caddy/Caddyfile.twig similarity index 100% rename from templates/web/caddy/Caddyfile.twig rename to templates/drupal/caddy/Caddyfile.twig diff --git a/templates/web/nginx/default.conf.twig b/templates/drupal/nginx/default.conf.twig similarity index 100% rename from templates/web/nginx/default.conf.twig rename to templates/drupal/nginx/default.conf.twig