diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 32b5c17..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,102 +0,0 @@ -version: 2 -aliases: - - &ssh_key_fingerprint "36:03:e3:ca:b3:0b:82:18:e2:e9:ae:5d:81:17:86:b1" - # Fingerprint of the SSH deploy key of the project used to pull code. - # The value can be found in CircleCI UI -> SSH Permissions. - - - &step_configure_git - run: - name: Configure git - command: | - git config --global user.email "$DEPLOY_USER_EMAIL" && git config --global user.name "$DEPLOY_USER_NAME" - - # Re-usable job to run different types of builds. - - &job-build - working_directory: &working-directory /app - docker: - - image: &builder-image singledigital/bay-ci-builder:5.x - environment: - INSTALL_NEW_SITE: 1 - LAGOON_ENVIRONMENT_TYPE: ci - steps: - - attach_workspace: - at: /workspace - - checkout - # Init environment for development. - - run: if [ -f "./dev-tools.sh" ] && [ ! "$DEV_TOOLS" ]; then ./dev-tools.sh; fi - - setup_remote_docker: - docker_layer_caching: true - - run: .circleci/build.sh - - run: .circleci/test.sh - - run: - name: Copy artifacts - command: .circleci/test-artifacts.sh - when: always - - store_artifacts: - path: /tmp/artifacts - - # Job to perform merge to reference branch after a merge to develop. - - &merge-to-reference - working_directory: *working-directory - docker: - - image: *builder-image - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - environment: - LAGOON_ENVIRONMENT_TYPE: ci - SSH_KEY_FINGERPRINT: *ssh_key_fingerprint - DEPLOY_USER_EMAIL: sdp.devs@dpc.vic.gov.au - DEPLOY_USER_NAME: sdpdeploy - steps: - - attach_workspace: - at: /workspace - - checkout - - *step_configure_git - - setup_remote_docker: - docker_layer_caching: true - - add_ssh_keys: - fingerprints: - - *ssh_key_fingerprint - - run: - name: Merge to reference branch - command: .circleci/merge-to-reference.sh - no_output_timeout: 30m - - -jobs: - build: - <<: *job-build - - build_suggest: - <<: *job-build - docker: - - image: *builder-image - environment: - INSTALL_NEW_SITE: 1 - LAGOON_ENVIRONMENT_TYPE: ci - INSTALL_SUGGEST: 1 - BEHAT_PROFILE: "--profile=suggest" - - merge_to_reference: - <<: *merge-to-reference - - -workflows: - version: 2 - main: - jobs: - - build - - build_suggest: - filters: - branches: - ignore: - - reference - - mergetoreference: - jobs: - - merge_to_reference: - filters: - branches: - only: - - develop diff --git a/.circleci/merge-to-reference.sh b/.circleci/merge-to-reference.sh deleted file mode 100755 index db8b679..0000000 --- a/.circleci/merge-to-reference.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -## -# Merge develop to reference branch in CI. -# - -echo "==> Checking out reference branch" -git checkout reference -echo "==> Merging develop to reference branch" -git merge develop -git checkout develop -- composer.json -git add . -echo "==> Replacing composer require entries starting with dpc-sdp with value dev-reference" -cat composer.json | gojq '.require |= with_entries( - if (.key | test("dpc-sdp/tide")) - then .value = "dev-reference" end)' > composer.json.backup -mv -f composer.json.backup composer.json -echo "==> Add all changes" -git add . -git commit -m "Merge changes from develop." -echo "==> Push the changes to remote reference branch" -git push origin --force reference diff --git a/.ddev/addon-metadata/ddev-drupal-contrib/manifest.yaml b/.ddev/addon-metadata/ddev-drupal-contrib/manifest.yaml new file mode 100644 index 0000000..864be25 --- /dev/null +++ b/.ddev/addon-metadata/ddev-drupal-contrib/manifest.yaml @@ -0,0 +1,19 @@ +name: ddev-drupal-contrib +repository: ddev/ddev-drupal-contrib +version: 1.1.5 +install_date: "2026-07-04T17:00:13+10:00" +project_files: + - commands/host/core-version + - commands/web/eslint + - commands/web/expand-composer-json + - commands/web/nightwatch + - commands/web/phpcbf + - commands/web/phpcs + - commands/web/phpstan + - commands/web/phpunit + - commands/web/poser + - commands/web/stylelint + - commands/web/symlink-project + - config.contrib.yaml +global_files: [] +removal_actions: [] diff --git a/.ddev/addon-metadata/ddev-selenium-standalone-chrome/manifest.yaml b/.ddev/addon-metadata/ddev-selenium-standalone-chrome/manifest.yaml new file mode 100644 index 0000000..668ca93 --- /dev/null +++ b/.ddev/addon-metadata/ddev-selenium-standalone-chrome/manifest.yaml @@ -0,0 +1,19 @@ +name: ddev-selenium-standalone-chrome +repository: ddev/ddev-selenium-standalone-chrome +version: 2.1.0 +install_date: "2026-07-04T17:51:19+10:00" +project_files: + - docker-compose.selenium-chrome.yaml + - config.selenium-standalone-chrome.yaml +global_files: [] +removal_actions: + - | + #ddev-nodisplay + #ddev-description:Remove docker-compose.selenium-chrome_extras.yaml file + if [ -f docker-compose.selenium-chrome_extras.yaml ]; then + if grep -q '#ddev-generated' docker-compose.selenium-chrome_extras.yaml; then + rm -f docker-compose.selenium-chrome_extras.yaml + else + echo "Unwilling to remove '$DDEV_APPROOT/.ddev/docker-compose.selenium-chrome_extras.yaml' because it does not have #ddev-generated in it; you can manually delete it if it is safe to delete." + fi + fi diff --git a/.ddev/addon-metadata/elasticsearch/manifest.yaml b/.ddev/addon-metadata/elasticsearch/manifest.yaml new file mode 100644 index 0000000..878c509 --- /dev/null +++ b/.ddev/addon-metadata/elasticsearch/manifest.yaml @@ -0,0 +1,9 @@ +name: elasticsearch +repository: ddev/ddev-elasticsearch +version: v0.3.3 +install_date: "2026-07-04T17:40:21+10:00" +project_files: + - elasticsearch/ + - docker-compose.elasticsearch.yaml +global_files: [] +removal_actions: [] diff --git a/.ddev/commands/host/build b/.ddev/commands/host/build new file mode 100755 index 0000000..7ab5147 --- /dev/null +++ b/.ddev/commands/host/build @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +## Description: Full rebuild from scratch: wipe web/ and vendor/, then start, poser, symlink-project and install-site. +## Usage: build +## Example: "ddev build" + +set -eu -o pipefail + +cd "${DDEV_APPROOT}" + +# Drupal locks sites/default read-only after install; unlock it so rm can succeed. +if [ -d web/sites/default ]; then + chmod -R u+w web/sites/default +fi +rm -rf web vendor + +ddev start +ddev poser +ddev symlink-project +ddev install-site diff --git a/.ddev/commands/host/core-version b/.ddev/commands/host/core-version new file mode 100755 index 0000000..e3e0122 --- /dev/null +++ b/.ddev/commands/host/core-version @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Switch the core version and rebuild. +## Usage: core-version [version] +## Example: "ddev core-version ^11" or "ddev core-version ~11.1.0" + +set -eu -o pipefail + +# Handle default values. +DRUPAL_CORE=${1:-default} +if [ "$DRUPAL_CORE" == "default" ]; then + DRUPAL_CORE="" +fi + +# Set/clear the env. +ddev dotenv set .ddev/.env.web --drupal-core "${DRUPAL_CORE}" + +# Restart and rebuild. +ddev restart +ddev poser diff --git a/.ddev/commands/web/eslint b/.ddev/commands/web/eslint new file mode 100755 index 0000000..6be295c --- /dev/null +++ b/.ddev/commands/web/eslint @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run eslint inside the web container +## Usage: eslint [flags] [args] +## Example: "ddev eslint" +## ExecRaw: true + +set -eu -o pipefail + +if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then + # Configure prettier + test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json . + test -e .prettierignore || echo '*.yml' > .prettierignore + # Change directory to the project root folder + cd "$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}" || exit + "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --config="../../../core/.eslintrc.passing.json" --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core --ext=.js,.yml . "$@" +else + echo "eslint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'" + exit 1 +fi diff --git a/.ddev/commands/web/expand-composer-json b/.ddev/commands/web/expand-composer-json new file mode 100755 index 0000000..509e414 --- /dev/null +++ b/.ddev/commands/web/expand-composer-json @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Add Drupal core and other needed dependencies. +## Usage: expand-composer-json [flags] [PROJECT_NAME] +## Example: "ddev expand-composer-json ctools" +## ExecRaw: true +## MutagenSync: true + +set -eu -o pipefail + +# Set the default core version. +export DRUPAL_CORE=${DRUPAL_CORE:-^11} + +export _WEB_ROOT=$DDEV_DOCROOT +cd "$DDEV_COMPOSER_ROOT" || exit +curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/expand_composer_json.php +_ddev_drupal_contrib_empty_composer=false +if [[ ! -f composer.json ]]; then + echo "{}" > composer.json + _ddev_drupal_contrib_empty_composer=true +fi +php expand_composer_json.php "$DDEV_SITENAME" +rm -f expand_composer_json.php +if [ "$_ddev_drupal_contrib_empty_composer" = true ]; then + rm -f composer.json +fi diff --git a/.ddev/commands/web/install-site b/.ddev/commands/web/install-site new file mode 100755 index 0000000..5f72cd9 --- /dev/null +++ b/.ddev/commands/web/install-site @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +## Description: Install a fresh Drupal site using the Tide installation profile. +## Usage: install-site +## Example: "ddev install-site" +## ExecRaw: true + +set -eu -o pipefail + +DRUPAL_PROFILE=${DRUPAL_PROFILE:-tide} +DRUPAL_ADMIN_NAME=${DRUPAL_ADMIN_NAME:-admin} +DRUPAL_ADMIN_PASSWORD=${DRUPAL_ADMIN_PASSWORD:-admin} + +drush site:install "${DRUPAL_PROFILE}" -y \ + --account-name="${DRUPAL_ADMIN_NAME}" \ + --account-pass="${DRUPAL_ADMIN_PASSWORD}" \ + --site-name="Single Digital Presence Content Management System" \ + install_configure_form.enable_update_status_module=NULL \ + install_configure_form.enable_update_status_emails=NULL + +drush user:unblock "${DRUPAL_ADMIN_NAME}" + +echo "==> Pointing ClamAV at the local ddev service" +drush -y config:set clamav.settings mode_daemon_tcpip.hostname clamav +drush -y config:set clamav.settings mode_daemon_tcpip.port 3310 + +drush cache:rebuild +drush user:login --no-browser diff --git a/.ddev/commands/web/nightwatch b/.ddev/commands/web/nightwatch new file mode 100755 index 0000000..06b2ea2 --- /dev/null +++ b/.ddev/commands/web/nightwatch @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run nightwatch inside the web container +## Usage: nightwatch [flags] [args] +## Example: "ddev nightwatch" +## ExecRaw: true + +set -eu -o pipefail + +yarn --cwd "$DDEV_DOCROOT/core" test:nightwatch "$DDEV_APPROOT/$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/" "$@" diff --git a/.ddev/commands/web/phpcbf b/.ddev/commands/web/phpcbf new file mode 100755 index 0000000..25393e0 --- /dev/null +++ b/.ddev/commands/web/phpcbf @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run phpcbf inside the web container +## Usage: phpcbf [flags] [args] +## Example: "ddev phpcbf" or "ddev phpcbf -n" +## ExecRaw: true + +set -eu -o pipefail + +if ! command -v phpcbf >/dev/null; then + echo "phpcbf is not available. You may need to 'ddev composer install'" + exit 1 +fi +test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist +phpcbf -s --report-full --report-summary --report-source $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@" diff --git a/.ddev/commands/web/phpcs b/.ddev/commands/web/phpcs new file mode 100755 index 0000000..efcf54a --- /dev/null +++ b/.ddev/commands/web/phpcs @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run phpcs inside the web container +## Usage: phpcs [flags] [args] +## Example: "ddev phpcs" or "ddev phpcs -n" +## ExecRaw: true + +set -eu -o pipefail + +if ! command -v phpcs >/dev/null; then + echo "phpcs is not available. You may need to 'ddev composer install'" + exit 1 +fi +test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist +phpcs -s --report-full --report-summary --report-source $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH --ignore=*/.ddev/* "$@" diff --git a/.ddev/commands/web/phpstan b/.ddev/commands/web/phpstan new file mode 100755 index 0000000..253ff6d --- /dev/null +++ b/.ddev/commands/web/phpstan @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run phpstan inside the web container +## Usage: phpstan [flags] [args] +## Example: "ddev phpstan" or "ddev phpstan -n" +## ExecRaw: true +## MutagenSync: true + +set -eu -o pipefail + +if ! command -v phpstan >/dev/null; then + echo "phpstan is not available. You may need to 'ddev poser'" + exit 1 +fi +test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpstan.neon +# See https://git.drupalcode.org/project/gitlab_templates/-/commit/a107b7f1f79af12e0b09f70be47b68e3f69b4504 +sed -i 's/BASELINE_PLACEHOLDER/phpstan-baseline.neon/g' phpstan.neon +# Add an empty baseline file to ensure it exists. +test -e phpstan-baseline.neon || touch phpstan-baseline.neon + +EXTENSION_DIRECTORY=$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_} +cd "$EXTENSION_DIRECTORY" || exit 1 +# Ensure PHPStan configuration is symlinked from project root. +ln -s $DDEV_DOCROOT/phpstan.neon 2>/dev/null || true +ln -s $DDEV_DOCROOT/phpstan-baseline.neon 2>/dev/null || true +phpstan analyze . "$@" diff --git a/.ddev/commands/web/phpunit b/.ddev/commands/web/phpunit new file mode 100755 index 0000000..b967304 --- /dev/null +++ b/.ddev/commands/web/phpunit @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run phpunit inside the web container +## Usage: phpunit [flags] [args] +## Example: "ddev phpunit" or "ddev phpunit --stop-on-failure" +## Example: "ddev phpunit web/modules/custom/mymodule/tests/src/Unit/MyTest.php" +## Example: "ddev phpunit --filter testMyFunction" +## ExecRaw: true + +set -eu -o pipefail + +if ! command -v phpunit >/dev/null; then + echo "phpunit is not available. You may need to 'ddev composer install'" + exit 1 +fi + +# CHECK for local config. +if [ -f "phpunit.xml" ]; then + # Defer to local config + phpunit "$@" +else + # Check if we are running a specific test or test folder. + if [ $# -gt 0 ] && [ -e "$1" ]; then + TEST_PATH="$1" + shift + phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php "$TEST_PATH" "$@" + else + # Run all custom module tests. + phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@" + fi +fi diff --git a/.ddev/commands/web/poser b/.ddev/commands/web/poser new file mode 100755 index 0000000..e6d6617 --- /dev/null +++ b/.ddev/commands/web/poser @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Expand composer.json and run composer install. +## Usage: poser [flags] [args] +## Example: "ddev poser" or "ddev poser --prefer-source" +## ExecRaw: true +## MutagenSync: true + +set -eu -o pipefail + +export COMPOSER=composer.contrib.json +.ddev/commands/web/expand-composer-json +composer install "$@" +# The -f flag suppresses errors if lock file does not exist. +rm -f composer.contrib.json composer.contrib.lock +touch $DDEV_DOCROOT/core/.env diff --git a/.ddev/commands/web/stylelint b/.ddev/commands/web/stylelint new file mode 100755 index 0000000..521d3bc --- /dev/null +++ b/.ddev/commands/web/stylelint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Run stylelint inside the web container +## Usage: stylelint [flags] [args] +## Example: "ddev stylelint" +## ExecRaw: true + +set -eu -o pipefail + +if "$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --version >/dev/null ; then + # Configure prettier + test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json . + # Change directory to the project root folder + cd "$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}" || exit + "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --color --config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" "./**/*.css" "$@" +else + echo "stylelint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'" + exit 1 +fi diff --git a/.ddev/commands/web/symlink-project b/.ddev/commands/web/symlink-project new file mode 100755 index 0000000..7db02d3 --- /dev/null +++ b/.ddev/commands/web/symlink-project @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +#ddev-generated +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## Description: Symlink project files into the configured location (defaults to `web/modules/custom/[PROJECT_NAME]`) +## Usage: symlink-project [flags] [args] +## Example: "ddev symlink-project" +## ExecRaw: true + +set -eu -o pipefail + +export _WEB_ROOT=$DDEV_DOCROOT +cd "$DDEV_COMPOSER_ROOT" || exit +curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/symlink_project.php + +if [ -n "${PROJECT_FILES-}" ]; then + # Suppress a warning. + PROJECT_FILES=$(ls -A --ignore="web" --ignore="vendor" --ignore="symlink_project.php" --ignore=".ddev" --ignore=".idea") + export PROJECT_FILES +fi + +# Symlink name using underscores. +# @see https://www.drupal.org/docs/develop/creating-modules/naming-and-placing-your-drupal-module +# DRUPAL_PROJECT_FOLDER is used by the symlink-project script in gitlab_templates +export DRUPAL_PROJECT_FOLDER=${DDEV_DOCROOT}/${DRUPAL_PROJECTS_PATH}/${DDEV_SITENAME//-/_} +php symlink_project.php +rm -f symlink_project.php diff --git a/.ddev/config.contrib.yaml b/.ddev/config.contrib.yaml new file mode 100644 index 0000000..216bd53 --- /dev/null +++ b/.ddev/config.contrib.yaml @@ -0,0 +1,27 @@ +## Command provided by https://github.com/ddev/ddev-drupal-contrib +## The #ddev-generated marker has been removed intentionally: this file is +## customised for Tide (a drupal-profile package, symlinked into +## web/profiles/custom instead of the default web/modules/custom). +## To customize this configuration, see: +## https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/ +web_environment: + # To change the Drupal core version, see the README: + # https://github.com/ddev/ddev-drupal-contrib/blob/main/README.md#changing-the-drupal-core-version + # https://git.drupalcode.org/project/gitlab_templates/-/blob/1.9.6/scripts/expand_composer_json.php?ref_type=tags#L15 + - IGNORE_PROJECT_DRUPAL_CORE_VERSION=1 + # Tide is an installation profile, so it is symlinked into + # web/profiles/custom/tide (see the ddev-drupal-contrib README: + # https://github.com/ddev/ddev-drupal-contrib/blob/main/README.md#changing-the-symlink-location). + - DRUPAL_PROJECTS_PATH=profiles/custom + - SIMPLETEST_DB=mysql://db:db@db/db + - SIMPLETEST_BASE_URL=http://web + - BROWSERTEST_OUTPUT_DIRECTORY=/tmp + - BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL} +hooks: + post-start: + - exec-host: | + if [[ -f vendor/autoload.php ]]; then + ddev symlink-project + else + exit 0 + fi diff --git a/.ddev/config.selenium-standalone-chrome.yaml b/.ddev/config.selenium-standalone-chrome.yaml new file mode 100644 index 0000000..842c650 --- /dev/null +++ b/.ddev/config.selenium-standalone-chrome.yaml @@ -0,0 +1,31 @@ +#ddev-generated +# Remove the line above if you don't want this file to be overwritten when you run +# ddev get ddev/ddev-selenium-standalone-chrome +# +# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome +# +web_environment: + - BROWSERTEST_OUTPUT_DIRECTORY=/tmp + - BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL} + - SIMPLETEST_BASE_URL=http://web + - SIMPLETEST_DB=mysql://db:db@db/db + # Use disable-dev-shm-usage instead of setting shm_usage + # https://developers.google.com/web/tools/puppeteer/troubleshooting#tips + # The format of chromeOptions is defined at https://chromedriver.chromium.org/capabilities + - MINK_DRIVER_ARGS_WEBDRIVER=[\"chrome\", {\"browserName\":\"chrome\",\"goog:chromeOptions\":{\"w3c\":true,\"args\":[\"--disable-dev-shm-usage\",\"--disable-gpu\",\"--headless\",\"--dns-prefetch-disable\"]}}, \"http://selenium-chrome:4444/wd/hub\"] + # Nightwatch + - DRUPAL_TEST_BASE_URL=http://web + - DRUPAL_TEST_DB_URL=mysql://db:db@db/db + - DRUPAL_TEST_WEBDRIVER_HOSTNAME=selenium-chrome + - DRUPAL_TEST_WEBDRIVER_PORT=4444 + - DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub + - DRUPAL_TEST_WEBDRIVER_W3C=true + # --window-size=1920,1080 is needed to fix random timeouts in tests. See: https://community.latenode.com/t/selenium-webdriver-timeout-issue-when-running-in-headless-mode-with-c/21952/4 + - DRUPAL_TEST_WEBDRIVER_CHROME_ARGS=--disable-dev-shm-usage --disable-gpu --headless --dns-prefetch-disable --window-size=1920,1080 + - DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false + - DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../ + - DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest + - DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch + # DTT + - DTT_BASE_URL=http://web + - DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"goog:chromeOptions\":{\"w3c\":true,\"args\":[\"--disable-dev-shm-usage\",\"--disable-gpu\",\"--headless\",\"--dns-prefetch-disable\"]}}, \"http://selenium-chrome:4444/wd/hub\"] diff --git a/.ddev/config.yaml b/.ddev/config.yaml new file mode 100644 index 0000000..2a0f8ac --- /dev/null +++ b/.ddev/config.yaml @@ -0,0 +1,315 @@ +name: tide +type: drupal10 +docroot: web +php_version: "8.3" +webserver_type: nginx-fpm +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: mariadb + version: "10.6" +use_dns_when_possible: true +composer_version: "2" +router_http_port: "8080" +router_https_port: "8443" +corepack_enable: false +web_environment: + # Drupal core version used by `ddev poser` (drupal.org gitlab_templates + # expand_composer_json.php). Keep in sync with drupal/core required by + # dpc-sdp/tide_core (and with tide_core's own .ddev/config.yaml). + - DRUPAL_CORE=10.6.x + +hooks: + post-import-db: + - exec: drush cache:rebuild + - exec: drush updatedb -y + - exec: drush cache:rebuild + +# Key features of DDEV's config.yaml: + +# name: # Name of the project, automatically provides +# http://projectname.ddev.site and https://projectname.ddev.site +# If the name is omitted, the project will take the name of the enclosing directory, +# which is useful if you want to have a copy of the project side by side with this one. + +# type: # backdrop, cakephp, craftcms, drupal, drupal6, drupal7, drupal8, drupal9, drupal10, drupal11, generic, laravel, magento, magento2, php, shopware6, silverstripe, symfony, typo3, wordpress +# See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more +# information on the different project types + +# docroot: # Relative path to the directory containing index.php. + +# php_version: "8.3" # PHP version to use, "5.6" through "8.4" + +# You can explicitly specify the webimage but this +# is not recommended, as the images are often closely tied to DDEV's' behavior, +# so this can break upgrades. + +# webimage: # nginx/php docker image. + +# database: +# type: # mysql, mariadb, postgres +# version: # database version, like "10.11" or "8.0" +# MariaDB versions can be 5.5-10.8, 10.11, and 11.4. +# MySQL versions can be 5.5-8.0. +# PostgreSQL versions can be 9-17. + +# router_http_port: # Port to be used for http (defaults to global configuration, usually 80) +# router_https_port: # Port for https (defaults to global configuration, usually 443) + +# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better, +# as leaving Xdebug enabled all the time is a big performance hit. + +# xhgui_https_port: 8142 +# Can be used to change the router https port for xhgui application +# Very rarely used + +# xhgui_http_port: 8143 +# Can be used to change the router http port for xhgui application +# Very rarely used + +# host_xhgui_port: 8142 +# Can be used to change the host binding port of the xhgui +# application. Rarely used; only when port conflict and +# bind_all_ports is used (normally with router disabled) + +# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better, +# as leaving Xhprof enabled all the time is a big performance hit. + +# xhprof_mode: [prepend|xhgui|global] +# Set to "xhgui" to enable XHGui features +# "xhgui" will become default in a future major release + +# webserver_type: nginx-fpm, apache-fpm, generic + +# timezone: Europe/Berlin +# If timezone is unset, DDEV will attempt to derive it from the host system timezone +# using the $TZ environment variable or the /etc/localtime symlink. +# This is the timezone used in the containers and by PHP; +# it can be set to any valid timezone, +# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# For example Europe/Dublin or MST7MDT + +# composer_root: +# Relative path to the Composer root directory from the project root. This is +# the directory which contains the composer.json and where all Composer related +# commands are executed. + +# composer_version: "2" +# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1 +# to use the latest major version available at the time your container is built. +# It is also possible to use each other Composer version channel. This includes: +# - 2.2 (latest Composer LTS version) +# - stable +# - preview +# - snapshot +# Alternatively, an explicit Composer version may be specified, for example "2.2.18". +# To reinstall Composer after the image was built, run "ddev debug rebuild". + +# nodejs_version: "22" +# change from the default system Node.js version to any other version. +# See https://ddev.readthedocs.io/en/stable/users/configuration/config/#nodejs_version for more information +# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation, +# Note that using of 'ddev nvm' is discouraged because "nodejs_version" is much easier to use, +# can specify any version, and is more robust than using 'nvm'. + +# corepack_enable: false +# Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm + +# additional_hostnames: +# - somename +# - someothername +# would provide http and https URLs for "somename.ddev.site" +# and "someothername.ddev.site". + +# additional_fqdns: +# - example.com +# - sub1.example.com +# would provide http and https URLs for "example.com" and "sub1.example.com" +# Please take care with this because it can cause great confusion. + +# upload_dirs: "custom/upload/dir" +# +# upload_dirs: +# - custom/upload/dir +# - ../private +# +# would set the destination paths for ddev import-files to /custom/upload/dir +# When Mutagen is enabled this path is bind-mounted so that all the files +# in the upload_dirs don't have to be synced into Mutagen. + +# disable_upload_dirs_warning: false +# If true, turns off the normal warning that says +# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set" + +# ddev_version_constraint: "" +# Example: +# ddev_version_constraint: ">= 1.22.4" +# This will enforce that the running ddev version is within this constraint. +# See https://github.com/Masterminds/semver#checking-version-constraints for +# supported constraint formats + +# working_dir: +# web: /var/www/html +# db: /home +# would set the default working directory for the web and db services. +# These values specify the destination directory for ddev ssh and the +# directory in which commands passed into ddev exec are run. + +# omit_containers: [db, ddev-ssh-agent] +# Currently only these containers are supported. Some containers can also be +# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit +# the "db" container, several standard features of DDEV that access the +# database container will be unusable. In the global configuration it is also +# possible to omit ddev-router, but not here. + +# performance_mode: "global" +# DDEV offers performance optimization strategies to improve the filesystem +# performance depending on your host system. Should be configured globally. +# +# If set, will override the global config. Possible values are: +# - "global": uses the value from the global config. +# - "none": disables performance optimization for this project. +# - "mutagen": enables Mutagen for this project. +# - "nfs": enables NFS for this project. +# +# See https://ddev.readthedocs.io/en/stable/users/install/performance/#nfs +# See https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen + +# fail_on_hook_fail: False +# Decide whether 'ddev start' should be interrupted by a failing hook + +# host_https_port: "59002" +# The host port binding for https can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_webserver_port: "59001" +# The host port binding for the ddev-webserver can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_db_port: "59002" +# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic +# unless explicitly specified. + +# mailpit_http_port: "8025" +# mailpit_https_port: "8026" +# The Mailpit ports can be changed from the default 8025 and 8026 + +# host_mailpit_port: "8025" +# The mailpit port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be bound directly to localhost if specified here. + +# webimage_extra_packages: [php7.4-tidy, php-bcmath] +# Extra Debian packages that are needed in the webimage can be added here + +# dbimage_extra_packages: [telnet,netcat] +# Extra Debian packages that are needed in the dbimage can be added here + +# use_dns_when_possible: true +# If the host has internet access and the domain configured can +# successfully be looked up, DNS will be used for hostname resolution +# instead of editing /etc/hosts +# Defaults to true + +# project_tld: ddev.site +# The top-level domain used for project URLs +# The default "ddev.site" allows DNS lookup via a wildcard +# If you prefer you can change this to "ddev.local" to preserve +# pre-v1.9 behavior. + +# ngrok_args: --basic-auth username:pass1234 +# Provide extra flags to the "ngrok http" command, see +# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h" + +# disable_settings_management: false +# If true, DDEV will not create CMS-specific settings files like +# Drupal's settings.php/settings.ddev.php or TYPO3's additional.php +# In this case the user must provide all such settings. + +# You can inject environment variables into the web container with: +# web_environment: +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue + +# no_project_mount: false +# (Experimental) If true, DDEV will not mount the project into the web container; +# the user is responsible for mounting it manually or via a script. +# This is to enable experimentation with alternate file mounting strategies. +# For advanced users only! + +# bind_all_interfaces: false +# If true, host ports will be bound on all network interfaces, +# not the localhost interface only. This means that ports +# will be available on the local network if the host firewall +# allows it. + +# default_container_timeout: 120 +# The default time that DDEV waits for all containers to become ready can be increased from +# the default 120. This helps in importing huge databases, for example. + +#web_extra_exposed_ports: +#- name: nodejs +# container_port: 3000 +# http_port: 2999 +# https_port: 3000 +#- name: something +# container_port: 4000 +# https_port: 4000 +# http_port: 3999 +# Allows a set of extra ports to be exposed via ddev-router +# Fill in all three fields even if you don’t intend to use the https_port! +# If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start. +# +# The port behavior on the ddev-webserver must be arranged separately, for example +# using web_extra_daemons. +# For example, with a web app on port 3000 inside the container, this config would +# expose that web app on https://.ddev.site:9999 and http://.ddev.site:9998 +# web_extra_exposed_ports: +# - name: myapp +# container_port: 3000 +# http_port: 9998 +# https_port: 9999 + +#web_extra_daemons: +#- name: "http-1" +# command: "/var/www/html/node_modules/.bin/http-server -p 3000" +# directory: /var/www/html +#- name: "http-2" +# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000" +# directory: /var/www/html + +# override_config: false +# By default, config.*.yaml files are *merged* into the configuration +# But this means that some things can't be overridden +# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge +# and you can't erase existing hooks or all environment variables. +# However, with "override_config: true" in a particular config.*.yaml file, +# 'use_dns_when_possible: false' can override the existing values, and +# hooks: +# post-start: [] +# or +# web_environment: [] +# or +# additional_hostnames: [] +# can have their intended affect. 'override_config' affects only behavior of the +# config.*.yaml file it exists in. + +# Many DDEV commands can be extended to run tasks before or after the +# DDEV command is executed, for example "post-start", "post-import-db", +# "pre-composer", "post-composer" +# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more +# information on the commands that can be extended and the tasks you can define +# for them. Example: +#hooks: +# post-import-db: +# - exec: drush sql:sanitize +# - exec: drush updatedb +# - exec: drush cache:rebuild diff --git a/.ddev/docker-compose.clamav.yaml b/.ddev/docker-compose.clamav.yaml new file mode 100644 index 0000000..5ce3d90 --- /dev/null +++ b/.ddev/docker-compose.clamav.yaml @@ -0,0 +1,21 @@ +# ClamAV daemon for the drupal/clamav module (hard dependency of tide_core). +# Replaces the `clamav` service from the legacy Ahoy docker-compose stack. +# The hostname override to this service is applied by `ddev install-site`. +services: + clamav: + container_name: ddev-${DDEV_SITENAME}-clamav + hostname: clamav + image: clamav/clamav-debian:stable + expose: + - "3310" + environment: + - CLAMAV_NO_MILTERD=true + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: ${DDEV_APPROOT} + volumes: + - clamav:/var/lib/clamav + - ".:/mnt/ddev_config" + +volumes: + clamav: diff --git a/.ddev/docker-compose.elasticsearch.yaml b/.ddev/docker-compose.elasticsearch.yaml new file mode 100644 index 0000000..3625600 --- /dev/null +++ b/.ddev/docker-compose.elasticsearch.yaml @@ -0,0 +1,28 @@ +#ddev-generated +services: + elasticsearch: + container_name: ddev-${DDEV_SITENAME}-elasticsearch + hostname: ${DDEV_SITENAME}-elasticsearch + image: ${ELASTICSEARCH_DOCKER_IMAGE:-elasticsearch:7.17.14} + expose: + - "9200" + - "9300" + environment: + - cluster.name=docker-cluster + - discovery.type=single-node + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - VIRTUAL_HOST=${DDEV_HOSTNAME} + - HTTP_EXPOSE=9200:9200 + - HTTPS_EXPOSE=9201:9200 + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: ${DDEV_APPROOT} + volumes: + - elasticsearch:/usr/share/elasticsearch/data + - ".:/mnt/ddev_config" + healthcheck: + test: ["CMD-SHELL", "curl --fail -s elasticsearch:9200"] + +volumes: + elasticsearch: diff --git a/.ddev/docker-compose.selenium-chrome.yaml b/.ddev/docker-compose.selenium-chrome.yaml new file mode 100644 index 0000000..9da12f4 --- /dev/null +++ b/.ddev/docker-compose.selenium-chrome.yaml @@ -0,0 +1,37 @@ +#ddev-generated +# Remove the line above if you don't want this file to be overwritten when you run +# ddev get ddev/ddev-selenium-standalone-chrome +# +# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome +# +services: + selenium-chrome: + image: selenium/standalone-chromium:138.0 + container_name: ddev-${DDEV_SITENAME}-selenium-chrome + expose: + # The internal noVNC port, which operates over HTTP so it can be exposed + # through the router. + - 7900 + environment: + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTPS_EXPOSE=7900:7900 + - HTTP_EXPOSE=7910:7900 + - VNC_NO_PASSWORD=1 + # Enables multiple parallel connections to the Selenium. + - SE_NODE_MAX_SESSIONS=12 + - SE_NODE_OVERRIDE_MAX_SESSIONS=true + # To enable VNC access for traditional VNC clients like macOS "Screen Sharing", + # uncomment the following two lines. + #ports: + # - "5900:5900" + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: $DDEV_APPROOT + volumes: + # To enable file uploads in E2E tests. + - ${DDEV_APPROOT}:/var/www/html:r + - ".:/mnt/ddev_config" + + web: + links: + - selenium-chrome diff --git a/.ddev/docker-compose.selenium-chrome_extras.yaml b/.ddev/docker-compose.selenium-chrome_extras.yaml new file mode 100644 index 0000000..4b8e233 --- /dev/null +++ b/.ddev/docker-compose.selenium-chrome_extras.yaml @@ -0,0 +1,5 @@ +#ddev-generated +services: + selenium-chrome: + external_links: + - "ddev-router:${DDEV_PROJECT}.${DDEV_TLD}" diff --git a/.ddev/elasticsearch/config/elasticsearch8.yml b/.ddev/elasticsearch/config/elasticsearch8.yml new file mode 100644 index 0000000..3a612d3 --- /dev/null +++ b/.ddev/elasticsearch/config/elasticsearch8.yml @@ -0,0 +1,15 @@ +#ddev-generated +# This file contains the configuration settings for Elasticsearch 8. +# For more information, see https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html + +# https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#cluster-name +cluster.name: "docker-cluster" + +# https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#network.host +network.host: 0.0.0.0 + +# Disable security features +# https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#general-security-settings +xpack.security.enabled: false +xpack.security.autoconfiguration.enabled: false +xpack.security.enrollment.enabled: false diff --git a/.ddev/elasticsearch/docker-compose.elasticsearch8.yaml b/.ddev/elasticsearch/docker-compose.elasticsearch8.yaml new file mode 100644 index 0000000..9e864c3 --- /dev/null +++ b/.ddev/elasticsearch/docker-compose.elasticsearch8.yaml @@ -0,0 +1,6 @@ +#ddev-generated +services: + elasticsearch: + image: ${ELASTICSEARCH_DOCKER_IMAGE:-elasticsearch:8.10.2} + volumes: + - ./elasticsearch/config/elasticsearch8.yml:/usr/share/elasticsearch/config/elasticsearch.yml diff --git a/.env b/.env deleted file mode 100644 index 092eb52..0000000 --- a/.env +++ /dev/null @@ -1,62 +0,0 @@ -## -# File with per-project environment variables. -# -# It is used by Ahoy and other scripts to read default values. -# -# The values must be scalar (cannot be another variable). This file must have -# at least 1 valid (exportable) assignment of value. -# -# You may create .env.local file and store your local environment variables -# there - it will also be loaded by Ahoy and it is excluded from git. -# -# This file may be left as is to assume default values specified in .ahoy.yml. - -# Project name. -# Defaults to the name of the current directory. -# PROJECT_NAME=mysite - -# Docker Compose project name. -# All containers will have this prefix. -# Defaults to $PROJECT_NAME -# COMPOSE_PROJECT_NAME=mysite - -# Drupal module prefix for site-specific modules. -# DRUPAL_MODULE_PREFIX=mysite - -# Path to the root of the project inside of the container. -# APP=/app - -# Path to the site installation relative to the current directory. -# WEBROOT=docroot - -# Local development URL. -# Make sure that there is no trailing slash in the value. -# Defaults to http://.docker.amazee.io -# LOCALDEV_URL=http://mysite.docker.amazee.io - -# Database connection details. -# MYSQL_HOST=mariadb -# MYSQL_PORT=3306 - -# Change to composer.json for site build. -COMPOSER=composer.build.json - -# Uncomment this for site build and set the profile name. -# DRUPAL_PROFILE= - -# Uncomment to run the build in suggest mode. -# In this mode, modules from "suggested" part of composer.json will be -# installed. -# INSTALL_SUGGEST=1 - -# Uncomment to install brand new site. -INSTALL_NEW_SITE=1 - -# Uncomment to refresh search API on deployment. -# DRUPAL_REFRESH_SEARCHAPI=1 - -# Uncomment and add comma-separated list of targets (no spaces). -# PHPCS_TARGETS="src,tests" - -# Uncomment below if Bay integration is enabled. -# BAY_INTEGRATION_ENABLED=1 diff --git a/.gitattributes b/.gitattributes index 17ee2d5..1dc5b00 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,9 +2,5 @@ .gitattributes export-ignore .gitignore export-ignore .github export-ignore -.circleci export-ignore -.circleci/config.yml export-ignore -.env export-ignore -tests export-ignore +.ddev export-ignore composer.json export-ignore -dev-init.sh export-ignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45eee5e..99a3e0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,36 +1,50 @@ name: build -on: push - +on: + push: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - set_status_in_progress: - name: set_status_in_progress - if: always() - uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main - secrets: inherit - with: - context: 'tide_build' - description: 'Tide Build running...' - state: 'pending' - target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} tide_build: name: tide_build - secrets: inherit - uses: dpc-sdp/github-actions/.github/workflows/tide_build.yml@main - with: - module_build: true - runner: biggy-tide - export_config: - name: export_config - secrets: inherit - uses: dpc-sdp/github-actions/.github/workflows/export_config.yml@main - set_status: - name: set_status - needs: [tide_build] - if: always() - uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main - secrets: inherit - with: - context: 'tide_build' - description: 'Tide Build' - target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Validate composer configuration + run: composer validate --ansi --strict --no-check-all --no-check-lock + + - name: Install DDEV + uses: ddev/github-action-setup-ddev@v1 + with: + autostart: false + + - name: Start DDEV + run: ddev start -y + + - name: Build Drupal site (poser) + run: ddev poser + + - name: Symlink profile into the site + run: ddev symlink-project + + - name: Install site with the Tide profile + run: ddev install-site + + - name: Verify installation + run: | + ddev drush status --fields=bootstrap,install-profile,drupal-version + ddev drush pm:list --status=enabled --filter=tide + + # TODO: export_config previously used the ahoy-based reusable workflow + # (dpc-sdp/github-actions/.github/workflows/export_config.yml) and needs a + # DDEV-based rewrite before this branch is merged. + # export_config: + # name: export_config + # secrets: inherit + # uses: dpc-sdp/github-actions/.github/workflows/export_config.yml@main diff --git a/.gitignore b/.gitignore index b1bbca1..2ebf3cd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,14 @@ # https://help.github.com/articles/ignoring-files/#create-a-global-gitignore /composer.lock +/composer.contrib.json +/composer.contrib.lock /composer.build.json /composer.build.lock /docroot +/web /dpc-sdp +.idea .env.local docker-compose.override.yml screenshots diff --git a/README.md b/README.md index f6f9dfa..c27cd73 100644 --- a/README.md +++ b/README.md @@ -61,13 +61,29 @@ composer require drupal/tide is a maintainer of this package. # Development and maintenance -Development is powered by [Dev-Tools](https://github.com/dpc-sdp/dev-tools). Please refer to Dev-Tools' -page for [system requirements](https://github.com/dpc-sdp/dev-tools/#prerequisites) and other details. - -To start local development stack: -1. Checkout this project -2. Run `./dev-tools.sh` -3. Run `ahoy build` +Local development is powered by [DDEV](https://ddev.readthedocs.io/) with the +[ddev-drupal-contrib](https://github.com/ddev/ddev-drupal-contrib) add-on. The profile +repository is the project root; a disposable Drupal site is built into `web/` and the +profile is made available to it via per-file symlinks — code changes at the repository +root take effect immediately, no sync step required. + +To start the local development stack: +1. Checkout this project. +2. Run `ddev start` — starts web, db, elasticsearch, selenium-chrome and clamav services. +3. Run `ddev poser` — installs Drupal core (version pinned by `DRUPAL_CORE` in `.ddev/config.yaml`), `dpc-sdp/tide_core` and all dependencies into `web/` and `vendor/`. +4. Run `ddev symlink-project` — symlinks this profile into `web/profiles/custom/tide` (re-run after adding/removing root-level files; also runs automatically on `ddev start`). +5. Run `ddev install-site` — installs a fresh site using the `tide` installation profile. + +Or run all of the above from scratch in one shot with `ddev build`. + +Day-to-day commands: +- `ddev drush ` — run Drush. +- `ddev ssh` — shell into the web container. + +Contributed-module patches are applied from `dpc-sdp/tide_core`'s `composer.json` +(`extra.patches`) via `cweagans/composer-patches` — enabled by `extra.enable-patching` +in this repository's `composer.json`. Patch files referenced with relative paths live +in `/patches` in this repository, as they resolve against the Composer root. # Related projects - [tide_api](https://github.com/dpc-sdp/tide_api) diff --git a/composer.json b/composer.json index b0528a5..6a5cd0d 100644 --- a/composer.json +++ b/composer.json @@ -3,17 +3,281 @@ "description": "Tide Drupal 10 profile", "type": "drupal-profile", "license": "GPL-2.0-or-later", + "minimum-stability": "dev", + "prefer-stable": true, "require": { - "dpc-sdp/tide_core": "dev-develop" + "dpc-sdp/tide_core": "dev-move-to-ddev" + }, + "require-dev": { + "drush/drush": "^13" }, "repositories": { "drupal": { "type": "composer", - "url": "https://packages.drupal.org/10" + "url": "https://packages.drupal.org/8", + "exclude": ["drupal/token_conditions", "drupal/create_menus_permission"] + }, + "choices": { + "_webform": true, + "type": "package", + "package": { + "name": "choices/choices", + "version": "9.0.1", + "type": "drupal-library", + "extra": { + "installer-name": "choices" + }, + "dist": { + "url": "https://github.com/jshjohnson/Choices/archive/v9.0.1.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "codemirror": { + "_webform": true, + "type": "package", + "package": { + "name": "codemirror/codemirror", + "version": "5.65.12", + "type": "drupal-library", + "extra": { + "installer-name": "codemirror" + }, + "dist": { + "url": "https://github.com/components/codemirror/archive/5.65.12.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "jquery.inputmask": { + "_webform": true, + "type": "package", + "package": { + "name": "jquery/inputmask", + "version": "5.0.8", + "type": "drupal-library", + "extra": { + "installer-name": "jquery.inputmask" + }, + "dist": { + "url": "https://github.com/RobinHerbots/jquery.inputmask/archive/5.0.8.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "jquery.intl-tel-input": { + "_webform": true, + "type": "package", + "package": { + "name": "jquery/intl-tel-input", + "version": "17.0.19", + "type": "drupal-library", + "extra": { + "installer-name": "jquery.intl-tel-input" + }, + "dist": { + "url": "https://github.com/jackocnr/intl-tel-input/archive/v17.0.19.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "progress-tracker": { + "_webform": true, + "type": "package", + "package": { + "name": "progress-tracker/progress-tracker", + "version": "2.0.7", + "type": "drupal-library", + "extra": { + "installer-name": "progress-tracker" + }, + "dist": { + "url": "https://github.com/NigelOToole/progress-tracker/archive/refs/tags/2.0.7.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } }, "asset-packagist": { "type": "composer", "url": "https://asset-packagist.org" + }, + "drupal/create_menus_permission": { + "type": "vcs", + "no-api": true, + "url": "https://github.com/dpc-sdp/create_menus_permission.git" + }, + "ckeditor.autogrow": { + "_webform": true, + "type": "package", + "package": { + "name": "ckeditor/autogrow", + "version": "4.16.1", + "type": "drupal-library", + "dist": { + "url": "https://download.ckeditor.com/autogrow/releases/autogrow_4.16.1.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "ckeditor.codemirror": { + "_webform": true, + "type": "package", + "package": { + "name": "ckeditor/codemirror", + "version": "v1.17.12", + "type": "drupal-library", + "dist": { + "url": "https://github.com/w8tcha/CKEditor-CodeMirror-Plugin/releases/download/v1.17.12/CKEditor-CodeMirror-Plugin.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "ckeditor.image": { + "_webform": true, + "type": "package", + "package": { + "name": "ckeditor/image", + "version": "4.16.1", + "type": "drupal-library", + "dist": { + "url": "https://download.ckeditor.com/image/releases/image_4.16.1.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "ckeditor.link": { + "_webform": true, + "type": "package", + "package": { + "name": "ckeditor/link", + "version": "4.16.1", + "type": "drupal-library", + "dist": { + "url": "https://download.ckeditor.com/link/releases/link_4.16.1.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "jquery.timepicker": { + "_webform": true, + "type": "package", + "package": { + "name": "jquery/timepicker", + "version": "1.14.0", + "type": "drupal-library", + "extra": { + "installer-name": "jquery.timepicker" + }, + "dist": { + "url": "https://github.com/jonthornton/jquery-timepicker/archive/refs/tags/1.14.0.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "jquery.textcounter": { + "_webform": true, + "type": "package", + "package": { + "name": "jquery/textcounter", + "version": "0.9.1", + "type": "drupal-library", + "extra": { + "installer-name": "jquery.textcounter" + }, + "dist": { + "url": "https://github.com/ractoon/jQuery-Text-Counter/archive/0.9.1.zip", + "type": "zip" + }, + "require": { + "composer/installers": "~1.0" + } + } + }, + "drupal/token_conditions": { + "type": "vcs", + "no-api": true, + "url": "https://github.com/dpc-sdp/token_conditions.git", + "exclude": [ + "dev-1.x", + "1.x-dev" + ] + } + }, + "extra": { + "enable-patching": true, + "composer-exit-on-patch-failure": true, + "drupal-scaffold": { + "file-mapping": { + "[project-root]/.gitattributes": false + } + }, + "installer-paths": { + "web/core": [ + "type:drupal-core" + ], + "web/libraries/{$name}": [ + "type:drupal-library", + "type:bower-asset", + "type:npm-asset" + ], + "web/modules/contrib/{$name}": [ + "type:drupal-module" + ], + "web/profiles/contrib/{$name}": [ + "type:drupal-profile" + ], + "web/themes/contrib/{$name}": [ + "type:drupal-theme" + ], + "drush/{$name}": [ + "type:drupal-drush" + ] + }, + "installer-types": ["bower-asset", "npm-asset"] + }, + "config": { + "allow-plugins": { + "composer/installers": true, + "oomphinc/composer-installers-extender": true, + "php-http/discovery": true, + "cweagans/composer-patches": true, + "drupal/core-composer-scaffold": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true, + "tbachert/spi": true + }, + "audit": { + "block-insecure": false } } } diff --git a/dev-tools.sh b/dev-tools.sh deleted file mode 100755 index d7573df..0000000 --- a/dev-tools.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -## -# Install development files from the centralised location - Dev-Tools repository. -# -# === WHAT IS DEV-TOOLS === -# Dev-Tools is a development environment for Drupal sites with tools included. -# https://github.com/dpc-sdp/dev-tools -# -# === WHAT IS THIS FILE AND WHY DO I NEED IT === -# Using Dev-Tools requires initial installation into your project. Once -# installed, it the can be "attached" in every environment were development -# stack is required. This means that your project will have only small number -# of Dev-Tools files committed - the rest of the files will be downloaded each -# time Dev-Tools needs to be "attached". -# -# This file is a script to download Dev-Tools at the latest stable version and -# "attach" it to the current environment. -# Files already committed within current repository will not be overridden. -# -# Usage: -# ./dev-tools.sh -# -# === HOW TO OVERRIDE LOCALLY EXCLUDED FILES === -# To override any files coming from Dev-Tools to persist in the current -# repository, modify `.git/info/exclude` file and commit them. -# -# === HOW TO UPDATE DEV-TOOLS === -# ALLOW_OVERRIDE=1 ./dev-tools.sh -# -# === HOW TO PIN TO SPECIFIC DEV-TOOLS COMMIT === -# For development of Dev-Tools or debugging of the development stack, it may be -# required to point to the specific Dev-Tools's commit rather then use the latest -# stable version. -# -# Uncomment and set the Dev-Tools's commit value and commit this change. -# export GH_COMMIT=COMMIT_SHA - -bash <(curl -L https://raw.githubusercontent.com/dpc-sdp/dev-tools/master/install?"$(date +%s)") "$@"