From bfe0117e5e2feb45482635b85f6b0f01e62cb8fa Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 31 Jul 2024 13:00:00 +0100 Subject: [PATCH] Update snapshots --- .../drupal-commerce-kickstart/.env.example | 6 +++++ .../drupal-commerce-kickstart/.gitignore | 6 +---- .../drupal-commerce-kickstart/Dockerfile | 2 +- .../output/drupal-commerce-kickstart/run | 21 +++++++++++++---- .../web/root/etc/nginx/conf.d/default.conf | 22 ++++++++++++++++++ .../output/drupal-localgov/.env.example | 6 +++++ .../output/drupal-localgov/.gitignore | 3 +-- .../output/drupal-localgov/Dockerfile | 2 +- tests/snapshots/output/drupal-localgov/run | 21 +++++++++++++---- .../web/root/etc/nginx/conf.d/default.conf | 22 ++++++++++++++++++ tests/snapshots/output/drupal/.env.example | 6 +++++ tests/snapshots/output/drupal/.gitignore | 3 +-- tests/snapshots/output/drupal/Dockerfile | 2 +- tests/snapshots/output/drupal/run | 23 +++++++++++++++---- .../web/root/etc/nginx/conf.d/default.conf | 22 ++++++++++++++++++ 15 files changed, 143 insertions(+), 24 deletions(-) create mode 100644 tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/web/root/etc/nginx/conf.d/default.conf create mode 100644 tests/snapshots/output/drupal-localgov/tools/docker/images/web/root/etc/nginx/conf.d/default.conf create mode 100644 tests/snapshots/output/drupal/tools/docker/images/web/root/etc/nginx/conf.d/default.conf diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.env.example b/tests/snapshots/output/drupal-commerce-kickstart/.env.example index 7e18d4e..050ac83 100644 --- a/tests/snapshots/output/drupal-commerce-kickstart/.env.example +++ b/tests/snapshots/output/drupal-commerce-kickstart/.env.example @@ -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" diff --git a/tests/snapshots/output/drupal-commerce-kickstart/.gitignore b/tests/snapshots/output/drupal-commerce-kickstart/.gitignore index 19fe571..01d9ebb 100644 --- a/tests/snapshots/output/drupal-commerce-kickstart/.gitignore +++ b/tests/snapshots/output/drupal-commerce-kickstart/.gitignore @@ -3,6 +3,7 @@ .editorconfig .env .gitattributes +.phpunit.result.cache vendor/ web/.csslintrc web/.eslintignore @@ -39,8 +40,3 @@ web/web.config .env docker-compose.override.yaml - -/bin/ -/libraries/ -/web/profiles/contrib/ - diff --git a/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile b/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile index c83003d..d1a0562 100644 --- a/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile +++ b/tests/snapshots/output/drupal-commerce-kickstart/Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update -yqq \ RUN docker-php-ext-configure gd --with-jpeg -RUN docker-php-ext-install bcmath gd pdo_mysql zip +RUN docker-php-ext-install bcmath gd opcache pdo_mysql zip COPY --chown=app:app phpunit.xml* ./ diff --git a/tests/snapshots/output/drupal-commerce-kickstart/run b/tests/snapshots/output/drupal-commerce-kickstart/run index 59143c9..8ae65d7 100755 --- a/tests/snapshots/output/drupal-commerce-kickstart/run +++ b/tests/snapshots/output/drupal-commerce-kickstart/run @@ -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 @@ -38,18 +38,29 @@ function cmd { } +# 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 } @@ -68,12 +79,14 @@ 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 } +# Start the project. function start { cp -v --no-clobber .env.example .env || true @@ -103,7 +116,7 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - "${TTY}" \ + ${TTY} \ "${service}" "${@}" } diff --git a/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/web/root/etc/nginx/conf.d/default.conf b/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/web/root/etc/nginx/conf.d/default.conf new file mode 100644 index 0000000..13e395a --- /dev/null +++ b/tests/snapshots/output/drupal-commerce-kickstart/tools/docker/images/web/root/etc/nginx/conf.d/default.conf @@ -0,0 +1,22 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +server { + server_name _; + + root /app/web; + + location / { + try_files $uri /index.php?$query_string; + } + + location ~ \.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; + try_files $fastcgi_script_name =404; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param QUERY_STRING $query_string; + fastcgi_intercept_errors on; + fastcgi_pass php:9000; + } +} diff --git a/tests/snapshots/output/drupal-localgov/.env.example b/tests/snapshots/output/drupal-localgov/.env.example index c4699ce..4216c83 100644 --- a/tests/snapshots/output/drupal-localgov/.env.example +++ b/tests/snapshots/output/drupal-localgov/.env.example @@ -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" diff --git a/tests/snapshots/output/drupal-localgov/.gitignore b/tests/snapshots/output/drupal-localgov/.gitignore index 8506c64..01d9ebb 100644 --- a/tests/snapshots/output/drupal-localgov/.gitignore +++ b/tests/snapshots/output/drupal-localgov/.gitignore @@ -3,6 +3,7 @@ .editorconfig .env .gitattributes +.phpunit.result.cache vendor/ web/.csslintrc web/.eslintignore @@ -39,5 +40,3 @@ web/web.config .env docker-compose.override.yaml - - diff --git a/tests/snapshots/output/drupal-localgov/Dockerfile b/tests/snapshots/output/drupal-localgov/Dockerfile index e0b3f71..b218199 100644 --- a/tests/snapshots/output/drupal-localgov/Dockerfile +++ b/tests/snapshots/output/drupal-localgov/Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update -yqq \ RUN docker-php-ext-configure gd --with-jpeg -RUN docker-php-ext-install gd pdo_mysql zip +RUN docker-php-ext-install gd opcache pdo_mysql zip COPY --chown=app:app phpunit.xml* ./ diff --git a/tests/snapshots/output/drupal-localgov/run b/tests/snapshots/output/drupal-localgov/run index 59143c9..8ae65d7 100755 --- a/tests/snapshots/output/drupal-localgov/run +++ b/tests/snapshots/output/drupal-localgov/run @@ -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 @@ -38,18 +38,29 @@ function cmd { } +# 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 } @@ -68,12 +79,14 @@ 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 } +# Start the project. function start { cp -v --no-clobber .env.example .env || true @@ -103,7 +116,7 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - "${TTY}" \ + ${TTY} \ "${service}" "${@}" } diff --git a/tests/snapshots/output/drupal-localgov/tools/docker/images/web/root/etc/nginx/conf.d/default.conf b/tests/snapshots/output/drupal-localgov/tools/docker/images/web/root/etc/nginx/conf.d/default.conf new file mode 100644 index 0000000..13e395a --- /dev/null +++ b/tests/snapshots/output/drupal-localgov/tools/docker/images/web/root/etc/nginx/conf.d/default.conf @@ -0,0 +1,22 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +server { + server_name _; + + root /app/web; + + location / { + try_files $uri /index.php?$query_string; + } + + location ~ \.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; + try_files $fastcgi_script_name =404; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param QUERY_STRING $query_string; + fastcgi_intercept_errors on; + fastcgi_pass php:9000; + } +} diff --git a/tests/snapshots/output/drupal/.env.example b/tests/snapshots/output/drupal/.env.example index ed69226..345a746 100644 --- a/tests/snapshots/output/drupal/.env.example +++ b/tests/snapshots/output/drupal/.env.example @@ -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" diff --git a/tests/snapshots/output/drupal/.gitignore b/tests/snapshots/output/drupal/.gitignore index 8506c64..01d9ebb 100644 --- a/tests/snapshots/output/drupal/.gitignore +++ b/tests/snapshots/output/drupal/.gitignore @@ -3,6 +3,7 @@ .editorconfig .env .gitattributes +.phpunit.result.cache vendor/ web/.csslintrc web/.eslintignore @@ -39,5 +40,3 @@ web/web.config .env docker-compose.override.yaml - - diff --git a/tests/snapshots/output/drupal/Dockerfile b/tests/snapshots/output/drupal/Dockerfile index 7164bf6..6c629a6 100644 --- a/tests/snapshots/output/drupal/Dockerfile +++ b/tests/snapshots/output/drupal/Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update -yqq \ RUN docker-php-ext-configure gd --with-jpeg -RUN docker-php-ext-install gd pdo_mysql zip +RUN docker-php-ext-install gd opcache pdo_mysql zip COPY --chown=app:app phpunit.xml* ./ diff --git a/tests/snapshots/output/drupal/run b/tests/snapshots/output/drupal/run index 708c254..bf87429 100755 --- a/tests/snapshots/output/drupal/run +++ b/tests/snapshots/output/drupal/run @@ -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 @@ -121,7 +136,7 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - "${TTY}" \ + ${TTY} \ "${service}" "${@}" } diff --git a/tests/snapshots/output/drupal/tools/docker/images/web/root/etc/nginx/conf.d/default.conf b/tests/snapshots/output/drupal/tools/docker/images/web/root/etc/nginx/conf.d/default.conf new file mode 100644 index 0000000..13e395a --- /dev/null +++ b/tests/snapshots/output/drupal/tools/docker/images/web/root/etc/nginx/conf.d/default.conf @@ -0,0 +1,22 @@ +# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. + +server { + server_name _; + + root /app/web; + + location / { + try_files $uri /index.php?$query_string; + } + + location ~ \.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; + try_files $fastcgi_script_name =404; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param QUERY_STRING $query_string; + fastcgi_intercept_errors on; + fastcgi_pass php:9000; + } +}