diff --git a/.github/workflows/container-structure-test.yml b/.github/workflows/container-structure-test.yml
index 71460b6..6ef4072 100644
--- a/.github/workflows/container-structure-test.yml
+++ b/.github/workflows/container-structure-test.yml
@@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
- drupal_version: ['8.9', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '10.0', '10.1', '10.2', '10.3', '11.0', '11.1']
+ drupal_version: ['8.9', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '10.0', '10.1', '10.2', '10.3', '10.4', '11.0', '11.1']
include:
- drupal_version: '8.9'
drupal_major: '8'
@@ -33,6 +33,8 @@ jobs:
drupal_major: '10'
- drupal_version: '10.3'
drupal_major: '10'
+ - drupal_version: '10.4'
+ drupal_major: '10'
- drupal_version: '11.0'
drupal_major: '11'
- drupal_version: '11.1'
@@ -58,7 +60,7 @@ jobs:
', github.ref)
strategy:
matrix:
- drupal_version: ['8.9', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '10.0', '10.1', '10.2', '10.3', '11.0', '11.1']
+ drupal_version: ['8.9', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '10.0', '10.1', '10.2', '10.3', '10.4', '11.0', '11.1']
include:
- drupal_version: '8.9'
drupal_major: '8'
@@ -82,6 +84,8 @@ jobs:
drupal_major: '10'
- drupal_version: '10.3'
drupal_major: '10'
+ - drupal_version: '10.4'
+ drupal_major: '10'
- drupal_version: '11.0'
drupal_major: '11'
- drupal_version: '11.1'
diff --git a/10/10.4/Dockerfile b/10/10.4/Dockerfile
new file mode 100644
index 0000000..89b4fcb
--- /dev/null
+++ b/10/10.4/Dockerfile
@@ -0,0 +1,55 @@
+ARG BASE_IMAGE_TAG
+FROM drupal:${BASE_IMAGE_TAG}-apache
+
+ARG DRUPAL_VER
+
+ENV COMPOSER_ALLOW_SUPERUSER=1
+ENV DRUPAL_VER="${DRUPAL_VER}"
+
+WORKDIR /opt/drupal
+
+# Install git and zip library.
+# Necessary for some composer operations.
+RUN set -eux; \
+ \
+ apt-get update; \
+ apt-get install -y \
+ git \
+ zip \
+ unzip \
+ ;
+
+# Install wait-for-it script to be able to check if services are up.
+RUN curl -OL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
+ chmod +x wait-for-it.sh && \
+ mv wait-for-it.sh /usr/local/bin/wait-for-it
+
+# As of Composer 2.2.0, the allow-plugins option adds a layer of security.
+# Some plugin Installer must be authorized. Not allowing it may lead to an instance of Drupal
+# installed into the vendor directory.
+RUN composer config --no-interaction allow-plugins true
+
+# Install Drush.
+# Drush will be heavily use to setup a working Drupal environment.
+RUN COMPOSER_MEMORY_LIMIT=-1 composer require drush/drush:^12.0
+
+# Prepare for Drupal 10.4 upgrade.
+# @see https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-higher
+RUN composer require drupal/core-recommended:~${DRUPAL_VER} --update-with-all-dependencies --no-update
+RUN composer require drupal/core-dev:~${DRUPAL_VER} --dev --update-with-all-dependencies --no-update
+
+# Set the minimum stability to "dev" to allow installing unstable Drupal Core.
+RUN composer config minimum-stability dev
+
+# Perform Drupal 10.1 installation.
+RUN COMPOSER_MEMORY_LIMIT=-1 composer update --with-all-dependencies
+
+# Clean repository.
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+
+# Copy a default template for PHPUnit testing.
+COPY templates/phpunit.xml /opt/drupal/web/phpunit.xml
+
+# Create the output directory for PHPUnit.
+RUN mkdir -p /opt/drupal/web/sites/default/files/simpletest/browser_output
+RUN chown www-data:www-data /opt/drupal/web/sites/default/files/simpletest/browser_output
diff --git a/10/10.4/Makefile b/10/10.4/Makefile
new file mode 100644
index 0000000..4d2135c
--- /dev/null
+++ b/10/10.4/Makefile
@@ -0,0 +1,65 @@
+DRUPAL_VER ?= 10.4
+DRUPAL_VER_MAJOR ?= $(shell echo "${DRUPAL_VER}" | grep -oE '^[0-9]+\.[0-9]+')
+
+BASE_IMAGE_TAG = 10.3
+ARCH_TO_BUILD ?= "linux/amd64"
+
+REPO = wengerk/drupal-for-contrib
+NAME = drupal-$(DRUPAL_VER_MAJOR)
+
+TAG ?= $(DRUPAL_VER_MAJOR)
+
+ifneq ($(BASE_IMAGE_STABILITY_TAG),)
+ BASE_IMAGE_TAG := $(BASE_IMAGE_TAG)-$(BASE_IMAGE_STABILITY_TAG)
+endif
+
+ifneq ($(STABILITY_TAG),)
+ ifneq ($(TAG),latest)
+ override TAG := $(TAG)-$(STABILITY_TAG)
+ endif
+endif
+
+.PHONY: build test push shell run start stop logs clean release
+
+default: build
+
+build:
+ docker buildx build -t $(REPO):$(TAG) \
+ --platform=${ARCH_TO_BUILD} \
+ --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
+ --build-arg DRUPAL_VER=$(DRUPAL_VER) \
+ ./
+
+build-nc:
+ docker buildx build -t $(REPO):$(TAG) \
+ --platform=${ARCH_TO_BUILD} \
+ --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
+ --build-arg DRUPAL_VER=$(DRUPAL_VER) \
+ --no-cache --pull \
+ ./
+
+test:
+ cd ./tests && IMAGE=$(REPO):$(TAG) ./run.sh
+
+push:
+ docker push $(REPO):$(TAG)
+
+shell:
+ docker run --rm --name $(NAME) -i -t $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) /bin/bash
+
+run:
+ docker run --rm --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) $(CMD)
+
+start:
+ docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
+
+stop:
+ docker stop $(NAME)
+
+logs:
+ docker logs $(NAME)
+
+clean:
+ -docker rm -f $(NAME)
+
+release: build push
diff --git a/10/10.4/templates/phpunit.xml b/10/10.4/templates/phpunit.xml
new file mode 100644
index 0000000..6b39a89
--- /dev/null
+++ b/10/10.4/templates/phpunit.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ./core/tests/TestSuites/UnitTestSuite.php
+
+
+ ./core/tests/TestSuites/KernelTestSuite.php
+
+
+ ./core/tests/TestSuites/FunctionalTestSuite.php
+
+
+ ./core/tests/TestSuites/FunctionalJavascriptTestSuite.php
+
+
+ ./core/tests/TestSuites/BuildTestSuite.php
+
+
+
+
+
+
+
+
+
+ ./modules
+
+
+ ./modules/*/src/Tests
+ ./modules/*/tests
+ ./modules/*/*/src/Tests
+ ./modules/*/*/tests
+ ./modules/**
+
+
+
diff --git a/10/10.4/tests/config.yaml b/10/10.4/tests/config.yaml
new file mode 100644
index 0000000..17184d8
--- /dev/null
+++ b/10/10.4/tests/config.yaml
@@ -0,0 +1,76 @@
+schemaVersion: '2.0.0'
+metadataTest:
+ envVars:
+ - key: 'DRUPAL_VER'
+ value: '10.4'
+ workdir: '/opt/drupal'
+ exposedPorts: ['80']
+commandTests:
+ - name: 'Drupal Root location'
+ command: 'drush'
+ args: ['status']
+ expectedOutput: ['Drupal root\s+:\s+/opt/drupal/web']
+ - name: 'Drupal version'
+ command: 'drush'
+ args: ['status']
+ expectedOutput: ['Drupal version\s+:\s+10\.4\.(x|\d+)(-(alpha|beta|dev|rc))?']
+ - name: 'Drupal Core Dev version'
+ command: bash
+ args: ['-c', 'composer show drupal/core-dev']
+ expectedOutput: ['versions\s+:\s\* 10\.4\.(x|\d+)(-(alpha|beta|dev|rc))?']
+ - name: 'Drush location'
+ command: 'drush'
+ args: ['status']
+ expectedOutput: ['Drush script\s+:\s+/opt/drupal/vendor/bin/drush']
+ - name: 'Drush version'
+ command: 'drush'
+ args: ['status']
+ expectedOutput: ['Drush version\s+:\s+12\.\d\.\d']
+ - name: 'PHPUnit location'
+ command: 'which'
+ args: ['phpunit']
+ expectedOutput: ['/opt/drupal/vendor/bin/phpunit']
+ - name: 'PHPUnit version'
+ command: 'phpunit'
+ args: ['--version']
+ expectedOutput: ['^PHPUnit 9\.\d\.\d']
+ - name: 'PHPUnit configuration file should works'
+ command: 'phpunit'
+ args: ['-c', '/var/www/html/phpunit.xml', '--group', 'foo']
+ exitCode: 0
+ expectedOutput: [ 'No tests executed!' ]
+ excludedOutput: [ 'is not a writable directory.' ]
+fileExistenceTests:
+ - name: 'Root'
+ path: '/'
+ shouldExist: true
+ permissions: 'drwxr-xr-x'
+ uid: 0
+ gid: 0
+ - name: 'PHPUnit default file'
+ path: '/opt/drupal/web/phpunit.xml'
+ shouldExist: true
+ - name: 'Wait-for-it script'
+ path: '/usr/local/bin/wait-for-it'
+ shouldExist: true
+ permissions: '-rwxr-xr-x'
+ uid: 0
+ gid: 0
+ - name: 'Drupal Root'
+ path: '/opt/drupal/web'
+ shouldExist: true
+ permissions: 'drwxr-xr-x'
+ uid: 0
+ gid: 0
+ - name: 'Drupal Public'
+ path: '/opt/drupal/web/sites/default'
+ shouldExist: true
+ permissions: 'drwxr-xr-x'
+ uid: 33
+ gid: 33
+ - name: 'Drupal PHPUnit Output'
+ path: '/opt/drupal/web/sites/default/files/simpletest/browser_output'
+ shouldExist: true
+ permissions: 'drwxr-xr-x'
+ uid: 33
+ gid: 33
diff --git a/10/10.4/tests/run.sh b/10/10.4/tests/run.sh
new file mode 100755
index 0000000..c6cb649
--- /dev/null
+++ b/10/10.4/tests/run.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+set -e
+
+if [[ -n "${DEBUG}" ]]; then
+ set -x
+fi
+
+if ! [ -x "$(command -v container-structure-test)" ]; then
+ echo -n "Install Google Container Structure Tests Framework for ${IMAGE} ..."
+
+ # Check install for Linux or MacOS.
+ if [[ $(uname -s) == Linux ]]
+ then
+ curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
+ elif [[ $(uname -s) == Darwin ]]
+ then
+ curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-darwin-amd64 && chmod +x container-structure-test-darwin-amd64 && sudo mv container-structure-test-darwin-amd64 /usr/local/bin/container-structure-test
+ fi
+fi
+
+if ! [ -x "$(command -v container-structure-test)" ]; then
+ echo 'Error: container-structure-test is not installed.' >&2
+ exit 1
+fi
+
+echo -n "Running tests for ${IMAGE}..."
+
+cid="$(
+ docker run -d "${IMAGE}"
+)"
+trap "docker rm -vf ${cid} > /dev/null" EXIT
+
+container-structure-test test --image ${IMAGE} --config config.yaml
diff --git a/11/11.0/Dockerfile b/11/11.0/Dockerfile
index 2fa15cd..363dd19 100644
--- a/11/11.0/Dockerfile
+++ b/11/11.0/Dockerfile
@@ -41,3 +41,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy a default template for PHPUnit testing.
COPY templates/phpunit.xml /opt/drupal/web/phpunit.xml
+
+# Create the output directory for PHPUnit.
+RUN mkdir -p /opt/drupal/web/sites/default/files/simpletest/browser_output
+RUN chown www-data:www-data /opt/drupal/web/sites/default/files/simpletest/browser_output
diff --git a/11/11.0/templates/phpunit.xml b/11/11.0/templates/phpunit.xml
index abbd22f..5efb838 100644
--- a/11/11.0/templates/phpunit.xml
+++ b/11/11.0/templates/phpunit.xml
@@ -65,7 +65,7 @@
overridden by the value set for the "BROWSERTEST_OUTPUT_DIRECTORY"
environment variable.
-->
-
+
-
+