Compare commits

..

10 commits
xdebug ... main

Author SHA1 Message Date
Oliver Davies f545502947 Fix pipeline errors
- Use MySQL for running tests as the SQLite version is not new enough.
- Fix phpcs error.
2024-08-04 16:12:57 +01:00
Oliver Davies d076a6fb78 Support Drupal 11 2024-08-04 16:12:42 +01:00
Oliver Davies f4aa3d8a68 Upgrade to Drupal 11
- Update to PHP 8.3.
- Remove the examples module.
- Upgrade Drush to version 13.
- Upgrade Drupal to 11.
2024-08-04 13:06:06 +01:00
Oliver Davies 1176ffb791 Update Drupal to 10.3.1 2024-07-31 19:44:35 +01:00
Oliver Davies 34e0ea149c Update build configuration files 2024-07-31 01:21:57 +01:00
Oliver Davies d18bf2242f Update build configuration files 2024-07-20 13:57:25 +01:00
Oliver Davies 1e1b3af879 Update build configuration files 2024-07-17 20:17:36 +01:00
Oliver Davies 2cee0a66c8 Update build configuration files 2024-06-27 12:16:51 +01:00
Oliver Davies fc59388947 Update build configuration files 2024-05-11 00:00:47 +02:00
Oliver Davies d57e91e567 Update build configuration files 2024-05-10 23:55:28 +02:00
13 changed files with 1830 additions and 1822 deletions

View file

@ -7,6 +7,12 @@ export COMPOSE_PROFILES=web,php,database
export DOCKER_WEB_VOLUME=.:/app
export DRUSH_OPTIONS_URI="https://${COMPOSE_PROJECT_NAME}.docker.localhost"
export MYSQL_DATABASE=app
export MYSQL_PASSWORD=app
export MYSQL_USER=app
export DB_NAME="$MYSQL_DATABASE"
export DB_PASSWORD="$MYSQL_PASSWORD"
export DB_USER="$MYSQL_USER"

2
.gitignore vendored
View file

@ -3,6 +3,7 @@
.editorconfig
.env
.gitattributes
.phpunit.result.cache
vendor/
web/.csslintrc
web/.eslintignore
@ -39,4 +40,3 @@ web/web.config
.env
docker-compose.override.yaml

View file

@ -1,6 +1,6 @@
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
FROM php:8.2-fpm-bullseye AS base
FROM php:8.3-fpm-bullseye AS base
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN which composer && composer -V
@ -32,13 +32,9 @@ RUN apt-get update -yqq \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \
&& apt-get clean
RUN pecl install xdebug
RUN docker-php-ext-configure gd --with-jpeg
RUN docker-php-ext-install gd pdo_mysql zip
RUN docker-php-ext-enable xdebug
RUN docker-php-ext-install gd opcache pdo_mysql zip
COPY --chown=app:app phpunit.xml* ./

View file

@ -10,7 +10,7 @@ database:
version: 10
php:
version: 8.2-fpm-bullseye
version: 8.3-fpm-bullseye
phpcs:
paths:
- web/modules/custom

View file

@ -16,11 +16,10 @@
],
"require": {
"composer/installers": "^1.9",
"drupal/core-composer-scaffold": "^10",
"drupal/core-project-message": "^10",
"drupal/core-recommended": "^10",
"drupal/examples": "^4.0",
"drush/drush": "^12.4"
"drupal/core-composer-scaffold": "^11",
"drupal/core-project-message": "^11",
"drupal/core-recommended": "^11",
"drush/drush": "^13"
},
"conflict": {
"drupal/drupal": "*"
@ -111,7 +110,7 @@
}
},
"require-dev": {
"drupal/core-dev": "^10",
"drupal/core-dev": "^11",
"phpspec/prophecy-phpunit": "^2"
}
}

3568
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,8 @@
services:
php:
environment:
XDEBUG_MODE: ${XDEBUG_MODE:-off}
php-fpm:
extra_hosts:
host.docker.internal: host-gateway
- "host.docker.internal:host-gateway"
web:
ports:
- "80:80"

View file

@ -3,12 +3,14 @@
x-proxy: &default-proxy
networks:
- default
- web
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -24,7 +26,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services:
@ -63,7 +65,7 @@ services:
env_file:
- .env
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: true
profiles: [database]
@ -72,6 +74,6 @@ volumes:
db-data: {}
networks:
web:
proxy:
external: true
name: traefik_proxy

View file

@ -17,7 +17,7 @@
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value=''/>
<env name="MINK_DRIVER_CLASS" value=''/>
<env name="SIMPLETEST_BASE_URL" value="http://web"/>
<env name="SIMPLETEST_DB" value="sqlite://localhost//dev/shm/test.sqlite"/>
<env name="SIMPLETEST_DB" value="mysql://app:app@database/app#test"/>
<ini name="error_reporting" value="32767"/>
<ini name="memory_limit" value="-1"/>

24
run
View file

@ -18,9 +18,9 @@ function ci:test {
docker compose version
docker network create traefik_proxy
docker network create traefik_proxy || true
cp --no-clobber .env.example .env
cp --no-clobber .env.example .env || true
docker compose build --progress plain
@ -39,22 +39,34 @@ function cmd {
docker compose exec php "${@}"
}
# Run coding standards checks.
function coding-standards {
cmd phpcs "${@}"
}
# Execute any Composer command.
function composer {
_exec php composer "${@}"
}
# Connect to the database.
function db {
[[ -f ".env" ]] && source .env
docker compose exec database mysql -u"$DB_USER" -p"$DB_PASSWORD" "$DB_NAME"
}
# Execute any Drush command.
function drush {
_exec php drush "${@}"
}
# Disable Git hooks.
function git-hooks:off {
git config --unset core.hooksPath
}
# Enable Git hooks.
function git-hooks:on {
git config core.hooksPath .githooks
}
@ -73,16 +85,19 @@ function install {
drush site:install -y "${@}"
}
# Lint the Dockerfile.
function lint:dockerfile {
docker container run --rm -i \
hadolint/hadolint hadolint --ignore DL3008 --ignore DL3059 -t style "${@}" - < Dockerfile
hadolint/hadolint hadolint --ignore DL3008 --ignore DL3022 --ignore DL3059 -t style "${@}" - < Dockerfile
}
# Run code quality checks.
function quality {
coding-standards
static-analysis
}
# Start the project.
function start {
cp -v --no-clobber .env.example .env || true
@ -126,7 +141,8 @@ function _run {
}
# Include any local tasks.
[[ -e run.local ]] && source run.local
# https://stackoverflow.com/a/6659698
[[ -e "${BASH_SOURCE%/*}/run.local" ]] && source "${BASH_SOURCE%/*}/run.local"
TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"

View file

@ -1,3 +1,6 @@
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.discover_client_host=0
xdebug.output_dir=/tmp/xdebug
xdebug.log=/tmp/xdebug/xdebug-docker-drupal-example.log
xdebug.start_with_request=yes

View file

@ -1,5 +1,5 @@
name: Example module
description: TODO
type: module
core_version_requirement: ^9||^10
core_version_requirement: ^9 || ^10 || ^11
package: Example

View file

@ -12,7 +12,7 @@ final class ExamplePageController {
use StringTranslationTrait;
public function __construct(
private LoggerChannelFactoryInterface $logger
private LoggerChannelFactoryInterface $logger,
) {}
/**