refactor: remove old code and templates

This commit is contained in:
Oliver Davies 2023-09-25 00:57:06 +01:00
parent ad86e066cb
commit 9176f34444
16 changed files with 2 additions and 520 deletions

View file

@ -1,104 +0,0 @@
# {{ managedText | raw }}
FROM php:{{ php.version }} AS base
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN which composer && composer -V
ARG DOCKER_UID=1000
ENV DOCKER_UID="${DOCKER_UID}"
WORKDIR {{ project_root }}
RUN adduser --disabled-password --uid "${DOCKER_UID}" app \
&& chown app:app -R {{ project_root }}
USER app
ENV PATH="${PATH}:{{ project_root }}/bin:{{ project_root }}/vendor/bin"
COPY --chown=app:app composer.* ./
################################################################################
FROM base AS build
USER root
{% if 'apache' in php.version %}
RUN a2enmod rewrite
{% endif %}
{% if dockerfile.stages.build.packages %}
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
{{ dockerfile.stages.build.packages | join(' ') }}
{% endif %}
RUN docker-php-ext-configure gd --with-jpeg
{% if dockerfile.stages.build.extensions.install %}
RUN docker-php-ext-install {{ dockerfile.stages.build.extensions.install | join(' ') }}
{% endif %}
COPY --chown=app:app phpunit.xml* ./
{% if dockerfile.stages.build.extra_files %}
COPY --chown=app:app {{ dockerfile.stages.build.extra_files | join(" ") }} ./
{% endif %}
{% for directory in dockerfile.stages.build.extra_directories %}
COPY --chown=app:app {{ directory }} {{ directory }}
{% endfor %}
{% for command in dockerfile.stages.build.root_commands | default([]) %}
RUN {{ command | raw }}
{% endfor %}
USER app
{% for command in dockerfile.stages.build.commands %}
RUN {{ command }}
{% endfor %}
COPY --chown=app:app tools/docker/images/php/root /
ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"]
CMD ["php-fpm"]
{% if dockerfile.stages.test %}
################################################################################
FROM {{ dockerfile.stages.test.extends }} AS test
COPY --chown=app:app . .
RUN {% for command in dockerfile.stages.test.commands -%}
{% if not loop.first %} && {% endif %}
{{ command }}
{%- if not loop.last %} \{% endif %}
{% endfor %}
{% endif %}
{% if web.type == "caddy" %}
################################################################################
FROM caddy:2 as web
WORKDIR {{ project_root }}
COPY tools/docker/images/web/root /
{% endif %}
{% if web.type == "nginx" %}
################################################################################
FROM nginx:1 as web
EXPOSE 8080
WORKDIR {{ project_root }}
COPY tools/docker/images/web/root /
{% endif %}

View file

@ -1,7 +0,0 @@
#!/usr/bin/env bash
# {{ managedText | raw }}
[[ -f composer.json && ! -d vendor ]] && composer install
eval "$@"

View file

@ -1,4 +0,0 @@
# {{ managedText }}
max_vars_input = 1000
memory_limit = {{ php.ini.memory_limit | default('128M') }}

View file

@ -1,40 +0,0 @@
<?xml version="1.0"?>
<!-- {{ managedText | raw }} -->
<ruleset name="{{ name }} coding standards">
<description>PHPCS configuration file for {{ name }}.</description>
{% for path in php.phpcs.paths|default('[]') %}
<file>{{ path }}</file>
{% endfor %}
<arg value="np"/>
{% for standard in php.phpcs.standards|default(['Drupal', 'DrupalPractice']) %}
{% if not standard is same as "Drupal" %}
<rule ref="{{ standard }}"/>
{% endif %}
{% endfor %}
{% if type is same as "drupal" and "Drupal" in php.phpcs.standards or php.phpcs.standards is empty %}
<rule ref="Drupal">
<exclude name="Drupal.Commenting.ClassComment.Missing"/>
<exclude name="Drupal.Commenting.DataTypeNamespace.DataTypeNamespace"/>
<exclude name="Drupal.Commenting.Deprecated"/>
<exclude name="Drupal.Commenting.DocComment.ContentAfterOpen"/>
<exclude name="Drupal.Commenting.DocComment.MissingShort"/>
<exclude name="Drupal.Commenting.FunctionComment.IncorrectParamVarName"/>
<exclude name="Drupal.Commenting.FunctionComment.IncorrectTypeHint"/>
<exclude name="Drupal.Commenting.FunctionComment.InvalidReturn"/>
<exclude name="Drupal.Commenting.FunctionComment.Missing"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/>
<exclude name="Drupal.Commenting.FunctionComment.ParamTypeSpaces"/>
<exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
<exclude name="Drupal.Commenting.InlineComment.DocBlock"/>
<exclude name="Drupal.Commenting.VariableComment.Missing"/>
<exclude name="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps"/>
<exclude name="DrupalPractice.Objects.StrictSchemaDisabled.StrictConfigSchema"/>
</rule>
{% endif %}
</ruleset>

View file

@ -1,16 +0,0 @@
# {{ managedText | raw }}
parameters:
level: {{ php.phpstan.level }}
excludePaths:
- *Test.php
- *TestBase.php
paths:
{% for path in php.phpstan.paths | default(["src"]) -%}
- {{ path }}
{%- endfor %}
{% if php.phpstan.baseline %}
includes:
- phpstan-baseline.neon
{% endif %}

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- {{ managedText | raw }} -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="false"
beStrictAboutTodoAnnotatedTests="true"
convertDeprecationsToExceptions="true"
failOnRisky="true"
failOnWarning="true"
verbose="true">
<testsuites>
<testsuite name="{{ name }}">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>