From ada1cad5dd5b7b4884955a1b398e4ecd42084c63 Mon Sep 17 00:00:00 2001 From: Ofer Shaal <37725-shaal@users.noreply.drupalcode.org> Date: Sun, 9 Mar 2025 19:32:04 +0000 Subject: [PATCH 01/13] Upgrade to latest Drupal and latest ddev --- .ddev/config.yaml | 19 ++++++++++--------- .gitpod.yml | 2 +- .../drupal/drupalpod-setup/composer_setup.sh | 2 ++ .../drupal/drupalpod-setup/fallback_setup.sh | 2 +- .gitpod/images/Dockerfile | 6 +++--- recipes/.gitignore | 1 + 6 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 recipes/.gitignore diff --git a/.ddev/config.yaml b/.ddev/config.yaml index 595e0b04..ae58c860 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -19,14 +19,13 @@ corepack_enable: false # name: # Name of the project, automatically provides # http://projectname.ddev.site and https://projectname.ddev.site -# type: # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress +# 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 -# "drupal" covers recent Drupal 8+ # docroot: # Relative path to the directory containing index.php. -# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" +# 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, @@ -39,7 +38,7 @@ corepack_enable: false # 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-16. +# 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) @@ -54,9 +53,11 @@ corepack_enable: false # "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. -# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn +# 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 @@ -76,9 +77,9 @@ corepack_enable: false # - 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 refresh". +# To reinstall Composer after the image was built, run "ddev debug rebuild". -# nodejs_version: "20" +# 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, @@ -204,8 +205,8 @@ corepack_enable: false # You can inject environment variables into the web container with: # web_environment: -# - SOMEENV=somevalue -# - SOMEOTHERENV=someothervalue +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue # no_project_mount: false # (Experimental) If true, DDEV will not mount the project into the web container; diff --git a/.gitpod.yml b/.gitpod.yml index c654a54f..6c358201 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ -image: drupalpod/drupalpod-gitpod-base:20240905 +image: drupalpod/drupalpod-gitpod-base:20250309 # DDEV and composer are running as part of the prebuild # when starting a workspace all docker images are ready diff --git a/.gitpod/drupal/drupalpod-setup/composer_setup.sh b/.gitpod/drupal/drupalpod-setup/composer_setup.sh index c8493d75..4504c102 100644 --- a/.gitpod/drupal/drupalpod-setup/composer_setup.sh +++ b/.gitpod/drupal/drupalpod-setup/composer_setup.sh @@ -31,6 +31,8 @@ ddev composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient ddev composer config --no-plugins allow-plugins.php-http/discovery true +ddev composer config --no-plugins allow-plugins.tbachert/spi true + # Add project source code as symlink (to repos/name_of_project) # double quotes explained - https://stackoverflow.com/a/1250279/5754049 if [ -n "$DP_PROJECT_NAME" ]; then diff --git a/.gitpod/drupal/drupalpod-setup/fallback_setup.sh b/.gitpod/drupal/drupalpod-setup/fallback_setup.sh index 9fed6fac..16c17e19 100644 --- a/.gitpod/drupal/drupalpod-setup/fallback_setup.sh +++ b/.gitpod/drupal/drupalpod-setup/fallback_setup.sh @@ -5,6 +5,6 @@ set -eu -o pipefail export DP_INSTALL_PROFILE='demo_umami' export DP_PROJECT_TYPE='project_core' export DP_PROJECT_NAME="drupal" -export DP_CORE_VERSION='11.0.1' +export DP_CORE_VERSION='11.1.4' export DP_EXTRA_DEVEL=1 export DP_EXTRA_ADMIN_TOOLBAR=1 diff --git a/.gitpod/images/Dockerfile b/.gitpod/images/Dockerfile index ee671cbc..298779ba 100644 --- a/.gitpod/images/Dockerfile +++ b/.gitpod/images/Dockerfile @@ -16,19 +16,19 @@ RUN echo "deb [signed-by=/etc/apt/keyrings/ddev.gpg] https://pkg.ddev.com/apt/ * RUN sudo apt-get update && sudo apt-get install -y ddev # Install GitUI (terminal-ui for git) -ARG GITUI_VERSION=v0.26.3 +ARG GITUI_VERSION=v0.27.0 RUN wget https://github.com/extrawurst/gitui/releases/download/${GITUI_VERSION}/gitui-linux-x86_64.tar.gz -P /tmp RUN sudo tar xzf /tmp/gitui-linux-x86_64.tar.gz -C /usr/bin # Install LazyGit (terminal-ui for git) -ARG LAZYGIT_VERSION=0.43.1 +ARG LAZYGIT_VERSION=0.48.0 RUN wget https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz -P /tmp RUN tar -C /tmp -xf /tmp/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz RUN sudo install /tmp/lazygit /usr/local/bin # (get latest Minio version from https://dl.min.io/client/mc/release/linux-amd64/) # Install Minio client -ARG MINIO_CLIENT_VERSION=mcli_20240826104958.0.0_amd64.deb +ARG MINIO_CLIENT_VERSION=mcli_20250221160046.0.0_amd64.deb RUN wget https://dl.min.io/client/mc/release/linux-amd64/${MINIO_CLIENT_VERSION} RUN sudo dpkg -i ${MINIO_CLIENT_VERSION} RUN sudo mv /usr/local/bin/mcli /usr/local/bin/mc diff --git a/recipes/.gitignore b/recipes/.gitignore new file mode 100644 index 00000000..739a3394 --- /dev/null +++ b/recipes/.gitignore @@ -0,0 +1 @@ +/README.txt \ No newline at end of file From 80224e0c50154aa488eb69760832350af8ee514d Mon Sep 17 00:00:00 2001 From: Darren Oh <9472-darrenoh@users.noreply.drupalcode.org> Date: Wed, 8 Oct 2025 23:47:19 +0000 Subject: [PATCH 02/13] [#3504317] feat: Add deployment scripts for Drupal Forge By: darren oh By: rfay By: lostcarpark By: mradcliffe By: markie By: adrianm6254 By: realityloop --- .ddev/config.yaml | 15 ++- .devpanel/cleanup.sh | 5 + .devpanel/composer_setup.sh | 53 ++++++++ .devpanel/contrib_modules_setup.sh | 34 ++++++ .devpanel/create_quickstart.sh | 45 +++++++ .devpanel/custom_package_installer.sh | 44 +++++++ .devpanel/drupal-settings.patch | 19 +++ .devpanel/drupal_setup_contrib.sh | 29 +++++ .devpanel/drupal_setup_core.sh | 41 +++++++ .devpanel/fallback_setup.sh | 10 ++ .devpanel/git_setup.sh | 72 +++++++++++ .devpanel/init-container.sh | 37 ++++++ .devpanel/init.sh | 125 +++++++++++++++++++ .devpanel/install-essential-packages.sh | 52 ++++++++ .devpanel/re-config.sh | 61 ++++++++++ .devpanel/settings.devpanel.php | 11 ++ .github/workflows/docker-publish-image.yml | 105 ++++++++++++++++ .github/workflows/docker-publish-images.yml | 23 ++++ .github/workflows/mirror.yml | 128 ++++++++++---------- .gitignore | 2 - .gitmodules | 4 + repos/drupal | 1 + 22 files changed, 847 insertions(+), 69 deletions(-) create mode 100755 .devpanel/cleanup.sh create mode 100755 .devpanel/composer_setup.sh create mode 100755 .devpanel/contrib_modules_setup.sh create mode 100755 .devpanel/create_quickstart.sh create mode 100755 .devpanel/custom_package_installer.sh create mode 100644 .devpanel/drupal-settings.patch create mode 100755 .devpanel/drupal_setup_contrib.sh create mode 100755 .devpanel/drupal_setup_core.sh create mode 100755 .devpanel/fallback_setup.sh create mode 100755 .devpanel/git_setup.sh create mode 100755 .devpanel/init-container.sh create mode 100755 .devpanel/init.sh create mode 100755 .devpanel/install-essential-packages.sh create mode 100755 .devpanel/re-config.sh create mode 100644 .devpanel/settings.devpanel.php create mode 100644 .github/workflows/docker-publish-image.yml create mode 100644 .github/workflows/docker-publish-images.yml create mode 100644 .gitmodules create mode 160000 repos/drupal diff --git a/.ddev/config.yaml b/.ddev/config.yaml index ae58c860..88209b1b 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -2,16 +2,25 @@ name: DrupalPod type: drupal docroot: web php_version: "8.3" -webserver_type: nginx-fpm +webserver_type: apache-fpm xdebug_enabled: false additional_hostnames: [] additional_fqdns: [] database: type: mariadb - version: "10.6" + version: "10.11" use_dns_when_possible: true composer_version: "2" -web_environment: [] +web_environment: + - APP_ROOT=$DDEV_COMPOSER_ROOT + - WEB_ROOT=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT + - DB_HOST=db + - DB_PORT=3306 + - DB_USER=db + - DB_PASSWORD=db + - DB_NAME=db + - DP_APP_ID=drupalpod + - DB_DRIVER=mysql corepack_enable: false # Key features of DDEV's config.yaml: diff --git a/.devpanel/cleanup.sh b/.devpanel/cleanup.sh new file mode 100755 index 00000000..3ffcd95e --- /dev/null +++ b/.devpanel/cleanup.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +# Remove composer.json. A fresh one will be generated. +rm -f "${APP_ROOT}"/composer.json diff --git a/.devpanel/composer_setup.sh b/.devpanel/composer_setup.sh new file mode 100755 index 00000000..10fca381 --- /dev/null +++ b/.devpanel/composer_setup.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +set -eu -o pipefail +cd $APP_ROOT + +# For versions end with x - add `-dev` suffix (ie. 9.3.x-dev) +# For versions without x - add `~` prefix (ie. ~9.2.0) +d="$DP_CORE_VERSION" +case $d in +*.x) + install_version="$d"-dev + ;; +*) + install_version=~"$d" + ;; +esac + +if [ ! -f composer.json ]; then + # Create required composer.json and composer.lock files + time composer create-project -n --no-install drupal/recommended-project:"$install_version" temp-composer-files + cp "$APP_ROOT"/temp-composer-files/* "$APP_ROOT"/. + rm -rf "$APP_ROOT"/temp-composer-files +fi + +# Programmatically fix Composer 2.2 allow-plugins to avoid errors +composer config --no-plugins allow-plugins.composer/installers true +composer config --no-plugins allow-plugins.drupal/core-project-message true +composer config --no-plugins allow-plugins.drupal/core-vendor-hardening true +composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true +composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true +composer config --no-plugins allow-plugins.phpstan/extension-installer true +composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true +composer config --no-plugins allow-plugins.php-http/discovery true +composer config --no-plugins allow-plugins.tbachert/spi false + +# Add project source code as symlink (to repos/name_of_project) +# double quotes explained - https://stackoverflow.com/a/1250279/5754049 +if [ -n "$DP_PROJECT_NAME" ]; then + composer --no-plugins config \ + repositories.core1 \ + '{"type": "path", "url": "repos/'"$DP_PROJECT_NAME"'", "options": {"symlink": true}}' + + composer --no-plugins config minimum-stability dev +fi + +# Scaffold settings.php. +composer config -jm extra.drupal-scaffold.file-mapping '{ + "[web-root]/sites/default/settings.php": { + "path": "web/core/assets/scaffold/files/default.settings.php", + "overwrite": false + } +}' +composer config scripts.post-drupal-scaffold-cmd \ + 'cd web/sites/default && test -z "$(grep '\''include \$devpanel_settings;'\'' settings.php)" && patch -Np1 -r /dev/null < $APP_ROOT/.devpanel/drupal-settings.patch || :' diff --git a/.devpanel/contrib_modules_setup.sh b/.devpanel/contrib_modules_setup.sh new file mode 100755 index 00000000..6892b60a --- /dev/null +++ b/.devpanel/contrib_modules_setup.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +# Check if additional modules should be installed +export DEVEL_NAME="devel" +export DEVEL_PACKAGE="drupal/devel" + +export ADMIN_TOOLBAR_NAME="admin_toolbar_tools" +export ADMIN_TOOLBAR_PACKAGE="drupal/admin_toolbar" + +# TODO: once Drupalpod extension supports additional modules - remove these 2 lines +export DP_EXTRA_DEVEL=1 +export DP_EXTRA_ADMIN_TOOLBAR=1 + +# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient +if [[ "$DP_CORE_VERSION" =~ ^10(\..*)?$ ]]; then + if [ "$DP_PROJECT_TYPE" != "project_core" ]; then + export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient + else + export COMPOSER_DRUPAL_LENIENT='' + fi +fi + +# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient +if [[ "$DP_CORE_VERSION" =~ ^11(\..*)?$ ]]; then + # admin_toolbar and devel are not compatible yet with Drupal 11 + export DP_EXTRA_ADMIN_TOOLBAR= + export DP_EXTRA_DEVEL= + if [ "$DP_PROJECT_TYPE" != "project_core" ]; then + export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient + else + export COMPOSER_DRUPAL_LENIENT='' + fi +fi diff --git a/.devpanel/create_quickstart.sh b/.devpanel/create_quickstart.sh new file mode 100755 index 00000000..cf39db09 --- /dev/null +++ b/.devpanel/create_quickstart.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# --------------------------------------------------------------------- +# Copyright (C) 2024 DevPanel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# For GNU Affero General Public License see . +# ---------------------------------------------------------------------- + +echo -e "-------------------------------" +echo -e "| DevPanel Quickstart Creator |" +echo -e "-------------------------------\n" + + +# Preparing +WORK_DIR=$APP_ROOT +TMP_DIR=/tmp/devpanel/quickstart +DUMPS_DIR=$TMP_DIR/dumps +STATIC_FILES_DIR=$WEB_ROOT/sites/default/files + +mkdir -p $DUMPS_DIR + +# Step 1 - Compress drupal database +cd $WORK_DIR +echo -e "> Export database to $APP_ROOT/.devpanel/dumps" +mkdir -p $APP_ROOT/.devpanel/dumps +drush cr --quiet +drush sql-dump --result-file=../.devpanel/dumps/db.sql --gzip --extra-dump=--no-tablespaces + +# Step 2 - Compress static files +cd $WORK_DIR +echo -e "> Compress static files" +tar czf $DUMPS_DIR/files.tgz -C $STATIC_FILES_DIR . + +echo -e "> Store files.tgz to $APP_ROOT/.devpanel/dumps" +mkdir -p $APP_ROOT/.devpanel/dumps +mv $DUMPS_DIR/files.tgz $APP_ROOT/.devpanel/dumps/files.tgz diff --git a/.devpanel/custom_package_installer.sh b/.devpanel/custom_package_installer.sh new file mode 100755 index 00000000..bc5e167c --- /dev/null +++ b/.devpanel/custom_package_installer.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# --------------------------------------------------------------------- +# Copyright (C) 2024 DevPanel +# You can install any service here to support your project +# Please make sure you run apt update before install any packages +# Example: +# - sudo apt-get update +# - sudo apt-get install nano +# +# ---------------------------------------------------------------------- +if [ -n "$DEBUG_SCRIPT" ]; then + set -x +fi + +# Install APT packages. +if ! command -v npm >/dev/null 2>&1; then + sudo apt-get update + sudo apt-get install -y jq nano npm +fi + +# Enable AVIF support in GD extension if not already enabled. +if [ -z "$(php --ri gd | grep AVIF)" ]; then + sudo apt-get install -y libavif-dev + sudo docker-php-ext-configure gd --with-avif --with-freetype --with-jpeg --with-webp + sudo docker-php-ext-install gd +fi + +PECL_UPDATED=false +# Install APCU extension. Bypass question about enabling internal debugging. +if ! php --ri apcu > /dev/null 2>&1; then + $PECL_UPDATED || sudo pecl update-channels && PECL_UPDATED=true + sudo pecl install apcu <<< '' + echo 'extension=apcu.so' | sudo tee /usr/local/etc/php/conf.d/apcu.ini +fi +# Install uploadprogress extension. +if ! php --ri uploadprogress > /dev/null 2>&1; then + $PECL_UPDATED || sudo pecl update-channels && PECL_UPDATED=true + sudo pecl install uploadprogress + echo 'extension=uploadprogress.so' | sudo tee /usr/local/etc/php/conf.d/uploadprogress.ini +fi +# Reload Apache if it's running. +if $PECL_UPDATED && sudo /etc/init.d/apache2 status > /dev/null; then + sudo /etc/init.d/apache2 reload +fi diff --git a/.devpanel/drupal-settings.patch b/.devpanel/drupal-settings.patch new file mode 100644 index 00000000..96254610 --- /dev/null +++ b/.devpanel/drupal-settings.patch @@ -0,0 +1,19 @@ +diff --git a/settings.php b/settings.php +index e121075454f..9b0d970f3e8 100644 +--- a/settings.php ++++ b/settings.php +@@ -854,6 +854,14 @@ + # $settings['migrate_file_public_path'] = ''; + # $settings['migrate_file_private_path'] = ''; + ++/** ++ * Load DevPanel override configuration, if available. ++ */ ++$devpanel_settings = dirname($app_root) . '/.devpanel/settings.devpanel.php'; ++if (getenv('DP_APP_ID') !== FALSE && file_exists($devpanel_settings)) { ++ include $devpanel_settings; ++} ++ + /** + * Load local development override configuration, if available. + * diff --git a/.devpanel/drupal_setup_contrib.sh b/.devpanel/drupal_setup_contrib.sh new file mode 100755 index 00000000..79ab063e --- /dev/null +++ b/.devpanel/drupal_setup_contrib.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -eu -o pipefail +cd "${APP_ROOT}" + +# Drupal projects with no composer.json, bypass the symlink config, symlink has to be created manually. + +if [ "$DP_PROJECT_TYPE" == "project_module" ]; then + PROJECT_TYPE=modules +elif [ "$DP_PROJECT_TYPE" == "project_theme" ]; then + PROJECT_TYPE=themes +fi + +cat <"${APP_ROOT}"/repos/add-project-as-symlink.sh +#!/usr/bin/env bash +# This file was dynamically generated by a script +echo "Replace project with a symlink" +rm -rf web/$PROJECT_TYPE/contrib/$DP_PROJECT_NAME +cd web/$PROJECT_TYPE/contrib && ln -s ../../../repos/$DP_PROJECT_NAME . +PROJECTASYMLINK + +chmod +x "${APP_ROOT}"/repos/add-project-as-symlink.sh + +if [ -n "$COMPOSER_DRUPAL_LENIENT" ]; then + # Add composer_drupal_lenient for modules on Drupal 10 + composer config --no-plugins --merge --json extra.drupal-lenient.allowed-list '["drupal/'"$DP_PROJECT_NAME"'"]' + time composer require "$COMPOSER_DRUPAL_LENIENT" --no-plugins --no-install +fi +# Add the project to composer (it will get the version according to the branch under `/repo/name_of_project`) +time composer require drupal/"$DP_PROJECT_NAME" --no-interaction --no-plugins --no-install diff --git a/.devpanel/drupal_setup_core.sh b/.devpanel/drupal_setup_core.sh new file mode 100755 index 00000000..5a3957d9 --- /dev/null +++ b/.devpanel/drupal_setup_core.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -eu -o pipefail +cd "${APP_ROOT}" + +# Add a special path when working on core contributions +# (Without it, /web/modules/contrib is not found by website) +composer config --no-plugins repositories.drupal-core2 '{"type": "path", "url": "repos/drupal/core"}' +composer config --no-plugins repositories.drupal-core3 '{"type": "path", "url": "repos/drupal/composer/Metapackage/CoreRecommended"}' +composer config --no-plugins repositories.drupal-core4 '{"type": "path", "url": "repos/drupal/composer/Metapackage/DevDependencies"}' +composer config --no-plugins repositories.drupal-core5 '{"type": "path", "url": "repos/drupal/composer/Plugin/ProjectMessage"}' +composer config --no-plugins repositories.drupal-core6 '{"type": "path", "url": "repos/drupal/composer/Plugin/VendorHardening"}' + +# Removing the conflict part of composer +echo "$(cat composer.json | jq 'del(.conflict)' --indent 4)" >composer.json + +# If a core issue branch was chosen, we want the version of Drupal core that is in that issue branch +# This is very helpful for issues that started with previous Drupal core versions, and the issue version automatically got updated to latest current drupal version +if [ "$DP_PROJECT_TYPE" == "project_core" ] && [ -n "$DP_ISSUE_BRANCH" ]; then + time composer require drupal/core-recommended:* drupal/core-project-message:* drupal/core-composer-scaffold:* --no-update +fi + +# Only after composer update, /web/core get symlinked to /repos/drupal/core +# repos/drupal/core -> web/core +time composer update --no-plugins --no-install + +# vendor -> repos/drupal/vendor +if [ ! -L "$APP_ROOT"/repos/drupal/vendor ]; then + cd "$APP_ROOT"/repos/drupal && + ln -s ../../vendor . +fi + +# Create folders for running tests +mkdir -p "$APP_ROOT"/web/sites/simpletest +mkdir -p "$APP_ROOT"/web/sites/simpletest/browser_output + +# Symlink the simpletest folder into the Drupal core git repo. +# repos/drupal/sites/simpletest -> ../../../web/sites/simpletest +if [ ! -L "$APP_ROOT"/repos/drupal/sites/simpletest ]; then + cd "$APP_ROOT"/repos/drupal/sites && + ln -s ../../../web/sites/simpletest . +fi diff --git a/.devpanel/fallback_setup.sh b/.devpanel/fallback_setup.sh new file mode 100755 index 00000000..e79eebac --- /dev/null +++ b/.devpanel/fallback_setup.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +# Set a default setup (when project type is not specified) +export DP_INSTALL_PROFILE='demo_umami' +export DP_PROJECT_TYPE='project_core' +export DP_PROJECT_NAME="drupal" +export DP_CORE_VERSION=${DP_CORE_VERSION:='11.2.2'} +export DP_EXTRA_DEVEL=1 +export DP_EXTRA_ADMIN_TOOLBAR=1 diff --git a/.devpanel/git_setup.sh b/.devpanel/git_setup.sh new file mode 100755 index 00000000..1231324b --- /dev/null +++ b/.devpanel/git_setup.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +# Add git.drupal.org to known_hosts +mkdir -p ~/.ssh +host=git.drupal.org +SSHKey=$(ssh-keyscan $host 2>/dev/null) +echo "$SSHKey" >>~/.ssh/known_hosts + +# Ignore specific directories during Drupal core development +cp "${APP_ROOT}"/.gitpod/drupal/templates/git-exclude.template "${APP_ROOT}"/.git/info/exclude + +# Get the required repo ready +if [ "$DP_PROJECT_TYPE" == "project_core" ]; then + # Find if requested core version is dev or stable + d="$DP_CORE_VERSION" + case $d in + *.x) + # If dev - use git checkout origin/* + checkout_type=origin + ;; + *) + # stable - use git checkout tags/* + checkout_type=tags + ;; + esac + + # Clone Drupal core repo + if git submodule status repos/drupal > /dev/null 2>&1; then + time git submodule update --init --recursive + else + time git submodule add -f https://git.drupalcode.org/project/drupal.git repos/drupal + time git config -f .gitmodules submodule."repos/drupal".ignore dirty + fi + + # Use origin or tags in git checkout command + cd "${APP_ROOT}"/repos/drupal && + git fetch origin && + git fetch --all --tags && + git checkout "$checkout_type"/"$DP_CORE_VERSION" + + # Ignore specific directories during Drupal core development + cp "${APP_ROOT}"/.gitpod/drupal/templates/git-exclude.template "${APP_ROOT}"/.git/modules/repos/drupal/info/exclude +else + # If not core - clone selected project into /repos and remove existing repos. + if git submodule status repos/"$DP_PROJECT_NAME" > /dev/null 2>&1; then + time git submodule update --init --recursive + else + git rm -r repos/*/ + time git submodule add -f https://git.drupalcode.org/project/"$DP_PROJECT_NAME".git repos/"$DP_PROJECT_NAME" + time git config -f .gitmodules submodule."repos/$DP_PROJECT_NAME".ignore dirty + fi +fi + +# Set WORK_DIR +export WORK_DIR="${APP_ROOT}"/repos/$DP_PROJECT_NAME + +# Checkout specific branch only if there's issue_branch +if [ -n "$DP_ISSUE_BRANCH" ]; then + # If branch already exist only run checkout, + if cd "${WORK_DIR}" && git show-ref -q --heads "$DP_ISSUE_BRANCH"; then + cd "${WORK_DIR}" && git checkout "$DP_ISSUE_BRANCH" + else + cd "${WORK_DIR}" && git remote add "$DP_ISSUE_FORK" https://git.drupalcode.org/issue/"$DP_ISSUE_FORK".git + cd "${WORK_DIR}" && git fetch "$DP_ISSUE_FORK" + cd "${WORK_DIR}" && git checkout -b "$DP_ISSUE_BRANCH" --track "$DP_ISSUE_FORK"/"$DP_ISSUE_BRANCH" + fi +elif [ -n "$DP_MODULE_VERSION" ] && [ "$DP_PROJECT_TYPE" != "project_core" ]; then + cd "${WORK_DIR}" && git checkout "$DP_MODULE_VERSION" +fi + +git add . diff --git a/.devpanel/init-container.sh b/.devpanel/init-container.sh new file mode 100755 index 00000000..d7fb60fb --- /dev/null +++ b/.devpanel/init-container.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# --------------------------------------------------------------------- +# Copyright (C) 2025 DevPanel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# For GNU Affero General Public License see . +# ---------------------------------------------------------------------- + +#== Import database +if [[ $(mysql -h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PASSWORD $DB_NAME -e "show tables;") == '' ]]; then + if [[ -f "$APP_ROOT/.devpanel/dumps/db.sql.gz" ]]; then + echo 'Import mysql file ...' + drush sqlq --file="$APP_ROOT/.devpanel/dumps/db.sql.gz" --file-delete + fi +fi + +if [[ -n "$DB_SYNC_VOL" ]]; then + if [[ ! -f "/var/www/build/.devpanel/init-container.sh" ]]; then + echo 'Sync volume...' + sudo chown -R 1000:1000 /var/www/build + rsync -av --delete --delete-excluded $APP_ROOT/ /var/www/build + fi +fi + +drush -n updb +echo +echo 'Run cron.' +drush cron diff --git a/.devpanel/init.sh b/.devpanel/init.sh new file mode 100755 index 00000000..c34262ff --- /dev/null +++ b/.devpanel/init.sh @@ -0,0 +1,125 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +# Initialize all variables with null if they do not exist +: "${DEBUG_SCRIPT:=}" +: "${DP_INSTALL_PROFILE:=}" +: "${DP_EXTRA_DEVEL:=}" +: "${DP_EXTRA_ADMIN_TOOLBAR:=}" +: "${DP_PROJECT_TYPE:=}" +: "${DEVEL_NAME:=}" +: "${DEVEL_PACKAGE:=}" +: "${ADMIN_TOOLBAR_NAME:=}" +: "${ADMIN_TOOLBAR_PACKAGE:=}" +: "${COMPOSER_DRUPAL_LENIENT:=}" +: "${DP_CORE_VERSION:=}" +: "${DP_ISSUE_BRANCH:=}" +: "${DP_ISSUE_FORK:=}" +: "${DP_MODULE_VERSION:=}" +: "${DP_PATCH_FILE:=}" + +# Assuming .sh files are in the same directory as this script +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +if [ -n "$DEBUG_SCRIPT" ]; then + set -x +fi + +convert_version() { + local version=$1 + if [[ $version =~ "-" ]]; then + # Remove the part after the dash and replace the last numeric segment with 'x' + local base_version=${version%-*} + echo "${base_version%.*}.x" + else + echo "$version" + fi +} + +# Test cases +# echo $(convert_version "9.2.5-dev1") # Output: 9.2.x +# echo $(convert_version "9.2.5") # Output: 9.2.5 +# echo $(convert_version "10.1.0-beta1") # Output: 10.1.x +# echo $(convert_version "11.0-dev") # Output: 11.x + +# Set a default setup if project type wasn't specified +if [ -z "$DP_PROJECT_TYPE" ]; then + source "$DIR/fallback_setup.sh" +fi + +source "$DIR/git_setup.sh" + +# If this is an issue fork of Drupal core - set the drupal core version based on that issue fork +if [ "$DP_PROJECT_TYPE" == "project_core" ] && [ -n "$DP_ISSUE_FORK" ]; then + VERSION_FROM_GIT=$(grep 'const VERSION' "${APP_ROOT}"/repos/drupal/core/lib/Drupal.php | awk -F "'" '{print $2}') + DP_CORE_VERSION=$(convert_version "$VERSION_FROM_GIT") + export DP_CORE_VERSION +fi + +# Measure the time it takes to go through the script +script_start_time=$(date +%s) + +# Remove root-owned files. +sudo rm -rf $APP_ROOT/lost+found + +source "$DIR/contrib_modules_setup.sh" +source "$DIR/cleanup.sh" +source "$DIR/composer_setup.sh" + +if [ -n "$DP_PATCH_FILE" ]; then + echo Applying selected patch "$DP_PATCH_FILE" + cd "${WORK_DIR}" && curl "$DP_PATCH_FILE" | patch -p1 +fi + +# Prepare special setup to work with Drupal core +if [ "$DP_PROJECT_TYPE" == "project_core" ]; then + source "$DIR/drupal_setup_core.sh" +# Prepare special setup to work with Drupal contrib +elif [ -n "$DP_PROJECT_NAME" ]; then + source "$DIR/drupal_setup_contrib.sh" +fi + +time "${DIR}"/install-essential-packages.sh +# Configure phpcs for drupal. +cd "$APP_ROOT" && + vendor/bin/phpcs --config-set installed_paths vendor/drupal/coder/coder_sniffer + +if [ -z "$(drush status --field=db-status)" ] || \ + [ $DP_INSTALL_PROFILE != 'demo_umami' ] || \ + ! printf "11.2.2\n$DP_CORE_VERSION" | sort -C; then + # New site install, different install profile, or lower core version. + time drush -n si --account-pass=admin --site-name="DrupalPod" "$DP_INSTALL_PROFILE" +elif [ $DP_CORE_VERSION != '11.2.2' ]; then + # Run database updates if the core version is different. + time drush -n updb +fi + +# Install devel and admin_toolbar modules. +if [ "$DP_EXTRA_DEVEL" != '1' ]; then + DEVEL_NAME= +fi +if [ "$DP_EXTRA_ADMIN_TOOLBAR" != '1' ]; then + ADMIN_TOOLBAR_NAME= +fi + +# Enable extra modules. +cd "${APP_ROOT}" && + drush en -y \ + $ADMIN_TOOLBAR_NAME \ + $DEVEL_NAME + +# Enable the requested module. +if [ "$DP_PROJECT_TYPE" == "project_module" ]; then + cd "${APP_ROOT}" && drush en -y "$DP_PROJECT_NAME" +fi + +# Enable the requested theme. +if [ "$DP_PROJECT_TYPE" == "project_theme" ]; then + cd "${APP_ROOT}" && drush then -y "$DP_PROJECT_NAME" + cd "${APP_ROOT}" && drush config-set -y system.theme default "$DP_PROJECT_NAME" +fi + +# Finish measuring script time. +script_end_time=$(date +%s) +runtime=$((script_end_time - script_start_time)) +echo "init.sh script ran for" $runtime "seconds" diff --git a/.devpanel/install-essential-packages.sh b/.devpanel/install-essential-packages.sh new file mode 100755 index 00000000..860a3f0e --- /dev/null +++ b/.devpanel/install-essential-packages.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -eu -o pipefail +cd "${APP_ROOT}" + +# Initialize all variables with null if they do not exist +: "${DEBUG_SCRIPT:=}" +: "${DP_EXTRA_DEVEL:=}" +: "${DP_EXTRA_ADMIN_TOOLBAR:=}" +: "${DEVEL_PACKAGE:=}" +: "${ADMIN_TOOLBAR_PACKAGE:=}" + +if [ -n "$DEBUG_SCRIPT" ]; then + set -x +fi + +# Install devel and admin_toolbar modules +if [ "$DP_EXTRA_DEVEL" != '1' ]; then + DEVEL_PACKAGE= +fi +if [ "$DP_EXTRA_ADMIN_TOOLBAR" != '1' ]; then + ADMIN_TOOLBAR_PACKAGE= +fi + +time composer require --dev "drupal/core-dev":* "phpspec/prophecy-phpunit":^2 -W --no-plugins --no-install +time composer require "drush/drush" "drupal/coder" $DEVEL_PACKAGE $ADMIN_TOOLBAR_PACKAGE + +# Only for Drupal core - apply special patch +if [ "$DP_PROJECT_TYPE" == "project_core" ]; then + # Patch the scaffold index.php and update.php files + # See https://www.drupal.org/project/drupal/issues/3188703 + # See https://www.drupal.org/project/drupal/issues/1792310 + echo "$(cat composer.json | jq '.scripts."post-install-cmd" |= . + ["src/composer-drupal-core-setup/patch-core-index-and-update.sh"]')" >composer.json + echo "$(cat composer.json | jq '.scripts."post-update-cmd" |= . + ["src/composer-drupal-core-setup/patch-core-index-and-update.sh"]')" >composer.json + + # Run the patch once + time src/composer-drupal-core-setup/patch-core-index-and-update.sh + + # Get the major version of 'drush/drush' + drush_major_version=$(composer show drush/drush --no-ansi | awk '/versions/ {print $NF}' | cut -d '.' -f1) + + drush_command_dir="$APP_ROOT/drush/Commands/core_development" + mkdir -p "$drush_command_dir" + + # Copy the correct version of DevelopmentProjectCommands.php file to the drush commands directory + cp "$APP_ROOT/src/drush-commands-core-development/$drush_major_version/DevelopmentProjectCommands.php" "$drush_command_dir/." +else + # Only for contrib - add project as symlink + + echo "$(cat composer.json | jq '.scripts."post-install-cmd" |= . + ["repos/add-project-as-symlink.sh"]')" >composer.json + echo "$(cat composer.json | jq '.scripts."post-update-cmd" |= . + ["repos/add-project-as-symlink.sh"]')" >composer.json + time repos/add-project-as-symlink.sh +fi diff --git a/.devpanel/re-config.sh b/.devpanel/re-config.sh new file mode 100755 index 00000000..c7a9f0b3 --- /dev/null +++ b/.devpanel/re-config.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# --------------------------------------------------------------------- +# Copyright (C) 2021 DevPanel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# For GNU Affero General Public License see . +# ---------------------------------------------------------------------- + +#== If webRoot has not been difined, we will set appRoot to webRoot +if [[ ! -n "$WEB_ROOT" ]]; then + export WEB_ROOT=$APP_ROOT +fi + +STATIC_FILES_PATH="$WEB_ROOT/sites/default/files/" +SETTINGS_FILES_PATH="$WEB_ROOT/sites/default/settings.php" + +#Create static directory +if [ ! -d "$STATIC_FILES_PATH" ]; then + mkdir -p $STATIC_FILES_PATH +fi + + +#== Composer install. +if [[ -f "$APP_ROOT/composer.json" ]]; then + cd $APP_ROOT && composer install +fi + +#== Generate hash salt +echo 'Generate hash salt ...' +DRUPAL_HASH_SALT=$(openssl rand -hex 32); +echo $DRUPAL_HASH_SALT > $APP_ROOT/.devpanel/salt.txt + + +# Securing file permissions and ownership +# https://www.drupal.org/docs/security-in-drupal/securing-file-permissions-and-ownership +[[ ! -d $STATIC_FILES_PATH ]] && sudo mkdir --mode 775 $STATIC_FILES_PATH || sudo chmod 775 -R $STATIC_FILES_PATH + +#== Extract static files +if [[ $(mysql -h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PASSWORD $DB_NAME -e "show tables;") == '' ]]; then + if [[ -f "$APP_ROOT/.devpanel/dumps/files.tgz" ]]; then + echo 'Extract static files ...' + sudo mkdir -p $STATIC_FILES_PATH + sudo tar xzf "$APP_ROOT/.devpanel/dumps/files.tgz" -C $STATIC_FILES_PATH + sudo rm -rf $APP_ROOT/.devpanel/dumps/files.tgz + fi + + #== Import mysql files + if [[ -f "$APP_ROOT/.devpanel/dumps/db.sql.gz" ]]; then + echo 'Import mysql file ...' + drush sqlq --file="$APP_ROOT/.devpanel/dumps/db.sql.gz" --file-delete + fi +fi diff --git a/.devpanel/settings.devpanel.php b/.devpanel/settings.devpanel.php new file mode 100644 index 00000000..49943765 --- /dev/null +++ b/.devpanel/settings.devpanel.php @@ -0,0 +1,11 @@ +- + --health-cmd="mysqladmin ping -h localhost -u root --password=root" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + + steps: + - name: Set up Docker Environment + uses: docker/setup-buildx-action@v3 + + - name: Check out code + uses: actions/checkout@v4 + + - name: Setup Drupal + run: | + echo "PREPARE DIR FOR INSTALL" + docker exec ${{ job.services.webserver.id }} bash -c "sudo rm -rf \$APP_ROOT && sudo mkdir -p \$APP_ROOT" + docker exec ${{ job.services.webserver.id }} bash -c "sudo cp -r /app/. \$APP_ROOT/." + docker exec ${{ job.services.webserver.id }} bash -c "sudo chown -R www:www \$APP_ROOT" + docker exec ${{ job.services.webserver.id }} bash -c "export && cd \$APP_ROOT && ls -al" + echo "SET UP GIT" + docker exec ${{ job.services.webserver.id }} bash -c "git config --global --add safe.directory \$APP_ROOT" + echo "INSTALL CUSTOM PACKAGE" + docker exec ${{ job.services.webserver.id }} bash -c "\$APP_ROOT/.devpanel/custom_package_installer.sh" + echo "INSTALL DRUPAL" + docker exec ${{ job.services.webserver.id }} bash -c "cd \$APP_ROOT && ls -al" + docker exec ${{ job.services.webserver.id }} bash -c "\$APP_ROOT/.devpanel/init.sh" + echo "DUMPS DATABASE + STATIC FILE" + docker exec ${{ job.services.webserver.id }} bash -c "\$APP_ROOT/.devpanel/create_quickstart.sh" + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set env to PHP 8.2 environment + if: endsWith(inputs.webserver_image, ':8.2-base-ai') + run: | + echo "IMAGE_TAG=drupalforge/drupalpod:php-8.2" >> $GITHUB_ENV + + - name: Set env to PHP 8.3 environment + if: endsWith(inputs.webserver_image, ':8.3-base-ai') + run: | + echo "IMAGE_TAG=drupalforge/drupalpod:php-8.3" >> $GITHUB_ENV + + - name: Commit and push the container state to Docker Hub + run: | + docker commit ${{ job.services.webserver.id }} ${{ env.IMAGE_TAG }} + docker push ${{ env.IMAGE_TAG }} + + - name: Push to tag latest + if: endsWith(inputs.webserver_image, ':8.3-base-ai') + run: | + docker commit ${{ job.services.webserver.id }} drupalforge/drupalpod:latest + docker push drupalforge/drupalpod:latest diff --git a/.github/workflows/docker-publish-images.yml b/.github/workflows/docker-publish-images.yml new file mode 100644 index 00000000..07f77cfe --- /dev/null +++ b/.github/workflows/docker-publish-images.yml @@ -0,0 +1,23 @@ +name: Docker build and push template +on: + push: + branches: + - drupalforge + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +permissions: + actions: write +jobs: + build-php-8_2: + uses: ./.github/workflows/docker-publish-image.yml + with: + webserver_image: devpanel/php:8.2-base-ai + drupal_core_version: 10.5.1 + secrets: inherit + build-php-8_3: + uses: ./.github/workflows/docker-publish-image.yml + with: + webserver_image: devpanel/php:8.3-base-ai + secrets: inherit diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 4aa5a8ed..792db9ed 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -1,64 +1,64 @@ -# This mirrors daily from an upstream repository. -# These two things must be set: -# UPSTREAM_REPO should be set to something like -# https://git.drupalcode.org/issue/drupalpod-3474581.git -# WORKFLOW_TOKEN is a secret in the "normal" environment containing -# a fine-grained PAT with permissions to read/write content and read/write workflows - -name: Mirror from Upstream -defaults: - run: - shell: bash -on: - schedule: - - cron: '0 0 * * *' # Runs daily at midnight UTC - workflow_dispatch: # Allows manual triggering of the workflow - -permissions: - contents: write - -jobs: - mirror: - runs-on: ubuntu-latest - env: - CLONEDIR: "/tmp/clonedir" - # The environment variables will be in the environment "normal" - environment: "normal" - - steps: - - name: Set up Git environment - run: | - git config --global user.name "GitHub Action" - git config --global user.email "action@github.com" - - - name: Clone upstream repository - run: | - set -x - set -eu -o pipefail - mkdir -p ${CLONEDIR} - # The variable UPSTREAM_REPO must be set in the repository's - # "normal" environment - git clone --mirror "${{ vars.UPSTREAM_REPO }}" "${{ env.CLONEDIR }}" - - - name: Remove existing Git credentials - run: | - git config --global --unset-all http.https://github.com/.extraheader || true - - - name: Push to GitHub - env: - # The WORKFLOW_TOKEN is a fine-grained PAT with - # contents: read-write and - # workflow:read/write perm for this repo - WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} - REPO: ${{ github.repository }} - - run: | - set -x - cd ${{ env.CLONEDIR }} - git remote set-url origin "https://github.com/${REPO}.git" - git config --global user.name "GitHub Action" - git config --global user.email "action@github.com" - git remote set-url origin "https://x-access-token:${WORKFLOW_TOKEN}@github.com/${REPO}.git" - git push --mirror - - +# This mirrors daily from an upstream repository. +# These two things must be set: +# UPSTREAM_REPO should be set to something like +# https://git.drupalcode.org/issue/drupalpod-3474581.git +# WORKFLOW_TOKEN is a secret in the "normal" environment containing +# a fine-grained PAT with permissions to read/write content and read/write workflows + +name: Mirror from Upstream +defaults: + run: + shell: bash +on: + schedule: + - cron: '0 0 * * *' # Runs daily at midnight UTC + workflow_dispatch: # Allows manual triggering of the workflow + +permissions: + contents: write + +jobs: + mirror: + runs-on: ubuntu-latest + env: + CLONEDIR: "/tmp/clonedir" + # The environment variables will be in the environment "normal" + environment: "normal" + + steps: + - name: Set up Git environment + run: | + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + + - name: Clone upstream repository + run: | + set -x + set -eu -o pipefail + mkdir -p ${CLONEDIR} + # The variable UPSTREAM_REPO must be set in the repository's + # "normal" environment + git clone --mirror "${{ vars.UPSTREAM_REPO }}" "${{ env.CLONEDIR }}" + + - name: Remove existing Git credentials + run: | + git config --global --unset-all http.https://github.com/.extraheader || true + + - name: Push to GitHub + env: + # The WORKFLOW_TOKEN is a fine-grained PAT with + # contents: read-write and + # workflow:read/write perm for this repo + WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + REPO: ${{ github.repository }} + + run: | + set -x + cd ${{ env.CLONEDIR }} + git remote set-url origin "https://github.com/${REPO}.git" + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + git remote set-url origin "https://x-access-token:${WORKFLOW_TOKEN}@github.com/${REPO}.git" + git push --mirror + + diff --git a/.gitignore b/.gitignore index 1b5d2424..89cf65ea 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,6 @@ composer.lock # DrupalPod .drupalpod_initiated -.gitmodules -repos/ src/**/node_modules/ src/**/package-lock.json src/**/out/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..10908d5e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "repos/drupal"] + path = repos/drupal + url = https://git.drupalcode.org/project/drupal.git + ignore = dirty diff --git a/repos/drupal b/repos/drupal new file mode 160000 index 00000000..96512344 --- /dev/null +++ b/repos/drupal @@ -0,0 +1 @@ +Subproject commit 965123445745f50c7fc001c72a96650518c267d2 From 308ebb6b2533976f9166e4abcf2231c666de5172 Mon Sep 17 00:00:00 2001 From: Darren Oh <9472-darrenoh@users.noreply.drupalcode.org> Date: Sun, 12 Oct 2025 16:12:48 +0000 Subject: [PATCH 03/13] [#3551704] fix: use Drupal Lenient Composer Plugin when needed --- .devpanel/drupal_setup_contrib.sh | 4 ++-- .devpanel/install-essential-packages.sh | 2 +- .gitpod/drupal/drupalpod-setup/drupal_setup_contrib.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devpanel/drupal_setup_contrib.sh b/.devpanel/drupal_setup_contrib.sh index 79ab063e..4d690f8f 100755 --- a/.devpanel/drupal_setup_contrib.sh +++ b/.devpanel/drupal_setup_contrib.sh @@ -23,7 +23,7 @@ chmod +x "${APP_ROOT}"/repos/add-project-as-symlink.sh if [ -n "$COMPOSER_DRUPAL_LENIENT" ]; then # Add composer_drupal_lenient for modules on Drupal 10 composer config --no-plugins --merge --json extra.drupal-lenient.allowed-list '["drupal/'"$DP_PROJECT_NAME"'"]' - time composer require "$COMPOSER_DRUPAL_LENIENT" --no-plugins --no-install + time composer require "$COMPOSER_DRUPAL_LENIENT" fi # Add the project to composer (it will get the version according to the branch under `/repo/name_of_project`) -time composer require drupal/"$DP_PROJECT_NAME" --no-interaction --no-plugins --no-install +time composer require drupal/"$DP_PROJECT_NAME" --no-interaction --no-install diff --git a/.devpanel/install-essential-packages.sh b/.devpanel/install-essential-packages.sh index 860a3f0e..bf85f6ef 100755 --- a/.devpanel/install-essential-packages.sh +++ b/.devpanel/install-essential-packages.sh @@ -21,7 +21,7 @@ if [ "$DP_EXTRA_ADMIN_TOOLBAR" != '1' ]; then ADMIN_TOOLBAR_PACKAGE= fi -time composer require --dev "drupal/core-dev":* "phpspec/prophecy-phpunit":^2 -W --no-plugins --no-install +time composer require --dev "drupal/core-dev":* "phpspec/prophecy-phpunit":^2 -W --no-install time composer require "drush/drush" "drupal/coder" $DEVEL_PACKAGE $ADMIN_TOOLBAR_PACKAGE # Only for Drupal core - apply special patch diff --git a/.gitpod/drupal/drupalpod-setup/drupal_setup_contrib.sh b/.gitpod/drupal/drupalpod-setup/drupal_setup_contrib.sh index 29986068..608e7d6d 100644 --- a/.gitpod/drupal/drupalpod-setup/drupal_setup_contrib.sh +++ b/.gitpod/drupal/drupalpod-setup/drupal_setup_contrib.sh @@ -22,7 +22,7 @@ chmod +x "${GITPOD_REPO_ROOT}"/repos/add-project-as-symlink.sh if [ -n "$COMPOSER_DRUPAL_LENIENT" ]; then # Add composer_drupal_lenient for modules on Drupal 10 cd "${GITPOD_REPO_ROOT}" && ddev composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/'"$DP_PROJECT_NAME"'"]' - cd "${GITPOD_REPO_ROOT}" && time ddev . composer require "$COMPOSER_DRUPAL_LENIENT" --no-install + cd "${GITPOD_REPO_ROOT}" && time ddev . composer require "$COMPOSER_DRUPAL_LENIENT" fi # Add the project to composer (it will get the version according to the branch under `/repo/name_of_project`) cd "${GITPOD_REPO_ROOT}" && time ddev . composer require drupal/"$DP_PROJECT_NAME" --no-interaction --no-install From 98d46f62f2a235f8f438db1f56458fa3c15a1f43 Mon Sep 17 00:00:00 2001 From: Darren Oh <9472-darrenoh@users.noreply.drupalcode.org> Date: Sun, 12 Oct 2025 21:05:21 -0400 Subject: [PATCH 04/13] Update Drupal core fallback versions --- .devpanel/fallback_setup.sh | 2 +- .github/workflows/docker-publish-images.yml | 2 +- .gitpod/drupal/drupalpod-setup/fallback_setup.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devpanel/fallback_setup.sh b/.devpanel/fallback_setup.sh index e79eebac..e591b12a 100755 --- a/.devpanel/fallback_setup.sh +++ b/.devpanel/fallback_setup.sh @@ -5,6 +5,6 @@ set -eu -o pipefail export DP_INSTALL_PROFILE='demo_umami' export DP_PROJECT_TYPE='project_core' export DP_PROJECT_NAME="drupal" -export DP_CORE_VERSION=${DP_CORE_VERSION:='11.2.2'} +export DP_CORE_VERSION=${DP_CORE_VERSION:='11.2.5'} export DP_EXTRA_DEVEL=1 export DP_EXTRA_ADMIN_TOOLBAR=1 diff --git a/.github/workflows/docker-publish-images.yml b/.github/workflows/docker-publish-images.yml index 07f77cfe..8c6288c5 100644 --- a/.github/workflows/docker-publish-images.yml +++ b/.github/workflows/docker-publish-images.yml @@ -14,7 +14,7 @@ jobs: uses: ./.github/workflows/docker-publish-image.yml with: webserver_image: devpanel/php:8.2-base-ai - drupal_core_version: 10.5.1 + drupal_core_version: 10.5.4 secrets: inherit build-php-8_3: uses: ./.github/workflows/docker-publish-image.yml diff --git a/.gitpod/drupal/drupalpod-setup/fallback_setup.sh b/.gitpod/drupal/drupalpod-setup/fallback_setup.sh index 16c17e19..b444e567 100644 --- a/.gitpod/drupal/drupalpod-setup/fallback_setup.sh +++ b/.gitpod/drupal/drupalpod-setup/fallback_setup.sh @@ -5,6 +5,6 @@ set -eu -o pipefail export DP_INSTALL_PROFILE='demo_umami' export DP_PROJECT_TYPE='project_core' export DP_PROJECT_NAME="drupal" -export DP_CORE_VERSION='11.1.4' +export DP_CORE_VERSION='11.2.5' export DP_EXTRA_DEVEL=1 export DP_EXTRA_ADMIN_TOOLBAR=1 From c4a2f68252524e3a91bf2b9761a976df50fc129d Mon Sep 17 00:00:00 2001 From: Darren Oh <9472-darrenoh@users.noreply.drupalcode.org> Date: Mon, 13 Oct 2025 08:16:21 -0400 Subject: [PATCH 05/13] Change default branch for published images --- .github/workflows/docker-publish-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-images.yml b/.github/workflows/docker-publish-images.yml index 8c6288c5..4b1722f1 100644 --- a/.github/workflows/docker-publish-images.yml +++ b/.github/workflows/docker-publish-images.yml @@ -2,7 +2,7 @@ name: Docker build and push template on: push: branches: - - drupalforge + - main workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 7909945967415777d6d549aa3133552397672dd1 Mon Sep 17 00:00:00 2001 From: Ofer Shaal Date: Mon, 22 Apr 2024 09:00:08 -0400 Subject: [PATCH 06/13] fix: support drupal 11 (#146) * fix: support drupal 11 * fix: improve code * fix: default installation * fix: update mariadb version to 10.6 * fix: update ddev-gitpod image (latest ddev version) * fix: lazygit binaries * fix: remove legacy settings from gitpod.yml * fix: use DP_CORE_VERSION when there's no issue_fork * fix: reorganize scripts order * Update .gitpod/drupal/drupalpod-setup/ddev_setup.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .ddev/config.yaml | 3 ++ .../drupalpod-setup/contrib_modules_setup.sh | 34 ------------------- 2 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 .gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh diff --git a/.ddev/config.yaml b/.ddev/config.yaml index 88209b1b..4fef4007 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -98,6 +98,9 @@ corepack_enable: false # corepack_enable: false # Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm +# corepack_enable: false +# Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm + # additional_hostnames: # - somename # - someothername diff --git a/.gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh b/.gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh deleted file mode 100644 index 6892b60a..00000000 --- a/.gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -eu -o pipefail - -# Check if additional modules should be installed -export DEVEL_NAME="devel" -export DEVEL_PACKAGE="drupal/devel" - -export ADMIN_TOOLBAR_NAME="admin_toolbar_tools" -export ADMIN_TOOLBAR_PACKAGE="drupal/admin_toolbar" - -# TODO: once Drupalpod extension supports additional modules - remove these 2 lines -export DP_EXTRA_DEVEL=1 -export DP_EXTRA_ADMIN_TOOLBAR=1 - -# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient -if [[ "$DP_CORE_VERSION" =~ ^10(\..*)?$ ]]; then - if [ "$DP_PROJECT_TYPE" != "project_core" ]; then - export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient - else - export COMPOSER_DRUPAL_LENIENT='' - fi -fi - -# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient -if [[ "$DP_CORE_VERSION" =~ ^11(\..*)?$ ]]; then - # admin_toolbar and devel are not compatible yet with Drupal 11 - export DP_EXTRA_ADMIN_TOOLBAR= - export DP_EXTRA_DEVEL= - if [ "$DP_PROJECT_TYPE" != "project_core" ]; then - export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient - else - export COMPOSER_DRUPAL_LENIENT='' - fi -fi From 975b7d355eaa156e01e2863939f844f93cc3b235 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wells" Date: Wed, 26 Jun 2024 13:10:44 -0400 Subject: [PATCH 07/13] re-do for D11 --- .gitpod.yml | 1 + .../drupalpod-setup/project-browser-setup.sh | 5 ++++ .vscode/launch.json | 12 ++++++++++ .vscode/settings.json | 1 + .vscode/tasks.json | 23 +++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 .gitpod/drupal/drupalpod-setup/project-browser-setup.sh create mode 100644 .vscode/tasks.json diff --git a/.gitpod.yml b/.gitpod.yml index 6c358201..23fae7df 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -17,6 +17,7 @@ tasks: .gitpod/utils/env-setup.sh .gitpod/drupal/ssh/01-check-private-ssh.sh .gitpod/drupal/drupalpod-setup/drupalpod-setup.sh + .gitpod/drupal/drupalpod-setup/project-browser-setup.sh # VScode xdebug extension vscode: diff --git a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh new file mode 100644 index 00000000..de72b378 --- /dev/null +++ b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +ddev composer remove mglaman/composer-drupal-lenient +ddev composer require drupal/automatic_updates:^3.1.3 +ddev drush en -y project_browser package_manager +ddev drush cset -y package_manager.settings include_unknown_files_in_project_root true diff --git a/.vscode/launch.json b/.vscode/launch.json index 685be73f..6c22ef33 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,18 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "hostname": "0.0.0.0", + "port": 9003, + "pathMappings": { + "/var/www/html": "${workspaceFolder}" + }, + "preLaunchTask": "DDEV: Enable Xdebug", + "postDebugTask": "DDEV: Disable Xdebug" + }, { "name": "Listen for XDebug", "type": "php", diff --git a/.vscode/settings.json b/.vscode/settings.json index eb74d33d..223f2aa3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -55,4 +55,5 @@ "**/vendor": true, }, "workbench.startupEditor": "none", + "php.version": "8.3", } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..aa46be50 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "DDEV: Enable Xdebug", + "type": "shell", + "command": "ddev xdebug on", + "presentation": { + "reveal": "silent", + "close": true + } + }, + { + "label": "DDEV: Disable Xdebug", + "type": "shell", + "command": "ddev xdebug off", + "presentation": { + "reveal": "silent", + "close": true + } + } + ] +} From 84c0fc6c2833cd2642adc0d117d73242be5cc847 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wells" Date: Wed, 26 Jun 2024 13:19:54 -0400 Subject: [PATCH 08/13] need execute permissions for the script --- .gitpod/drupal/drupalpod-setup/project-browser-setup.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .gitpod/drupal/drupalpod-setup/project-browser-setup.sh diff --git a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh old mode 100644 new mode 100755 From 443d88fa841ab845cb71b2d3530a48b2bb2b16a4 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wells" Date: Wed, 26 Jun 2024 13:24:44 -0400 Subject: [PATCH 09/13] some extra nice-to-haves --- .gitpod/drupal/drupalpod-setup/project-browser-setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh index de72b378..5cbe39ae 100755 --- a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh +++ b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash ddev composer remove mglaman/composer-drupal-lenient ddev composer require drupal/automatic_updates:^3.1.3 +ddev drush pmu -y admin_toolbar ddev drush en -y project_browser package_manager +ddev drush en -y navigation ddev drush cset -y package_manager.settings include_unknown_files_in_project_root true +ddev drush cset -y project_browser.admin_settings allow_ui_install true +ddev drush cr From 684f7db0e48863cb0e81a5605ec0b279eafc3ec2 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wells" Date: Mon, 14 Oct 2024 15:11:18 -0400 Subject: [PATCH 10/13] turn off core-dev so that it's a no-questions-asked install --- .gitpod/drupal/drupalpod-setup/project-browser-setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh index 5cbe39ae..1d7d112b 100755 --- a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh +++ b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +ddev composer remove drupal/core-dev ddev composer remove mglaman/composer-drupal-lenient ddev composer require drupal/automatic_updates:^3.1.3 ddev drush pmu -y admin_toolbar @@ -6,4 +7,5 @@ ddev drush en -y project_browser package_manager ddev drush en -y navigation ddev drush cset -y package_manager.settings include_unknown_files_in_project_root true ddev drush cset -y project_browser.admin_settings allow_ui_install true +ddev drush cset -y --input-format=yaml package_manager.settings additional_trusted_composer_plugins \[tbachert/spi\] ddev drush cr From 93295b3a0e2b2501aa4dae4c66d1513f7723139e Mon Sep 17 00:00:00 2001 From: "Christopher J. Wells" Date: Mon, 14 Oct 2024 15:33:29 -0400 Subject: [PATCH 11/13] fix to remove requirement on file we deleted --- .gitpod/drupal/drupalpod-setup/drupalpod-setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh b/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh index a9bc05d9..f310eb44 100755 --- a/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh +++ b/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh @@ -65,7 +65,6 @@ if [ ! -f "${GITPOD_REPO_ROOT}"/.drupalpod_initiated ]; then # Measure the time it takes to go through the script script_start_time=$(date +%s) - source "$DIR/contrib_modules_setup.sh" source "$DIR/cleanup.sh" source "$DIR/composer_setup.sh" From c913eedbf98c11072a1ae49deab01c9c21a3d5bc Mon Sep 17 00:00:00 2001 From: "Christopher J. Wells" Date: Mon, 14 Oct 2024 15:58:54 -0400 Subject: [PATCH 12/13] put contrib setup back - fix the removal of core-dev --- .../drupalpod-setup/contrib_modules_setup.sh | 34 +++++++++++++++++++ .../drupal/drupalpod-setup/drupalpod-setup.sh | 1 + .../drupalpod-setup/project-browser-setup.sh | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh diff --git a/.gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh b/.gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh new file mode 100644 index 00000000..6892b60a --- /dev/null +++ b/.gitpod/drupal/drupalpod-setup/contrib_modules_setup.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +# Check if additional modules should be installed +export DEVEL_NAME="devel" +export DEVEL_PACKAGE="drupal/devel" + +export ADMIN_TOOLBAR_NAME="admin_toolbar_tools" +export ADMIN_TOOLBAR_PACKAGE="drupal/admin_toolbar" + +# TODO: once Drupalpod extension supports additional modules - remove these 2 lines +export DP_EXTRA_DEVEL=1 +export DP_EXTRA_ADMIN_TOOLBAR=1 + +# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient +if [[ "$DP_CORE_VERSION" =~ ^10(\..*)?$ ]]; then + if [ "$DP_PROJECT_TYPE" != "project_core" ]; then + export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient + else + export COMPOSER_DRUPAL_LENIENT='' + fi +fi + +# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient +if [[ "$DP_CORE_VERSION" =~ ^11(\..*)?$ ]]; then + # admin_toolbar and devel are not compatible yet with Drupal 11 + export DP_EXTRA_ADMIN_TOOLBAR= + export DP_EXTRA_DEVEL= + if [ "$DP_PROJECT_TYPE" != "project_core" ]; then + export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient + else + export COMPOSER_DRUPAL_LENIENT='' + fi +fi diff --git a/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh b/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh index f310eb44..a9bc05d9 100755 --- a/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh +++ b/.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh @@ -65,6 +65,7 @@ if [ ! -f "${GITPOD_REPO_ROOT}"/.drupalpod_initiated ]; then # Measure the time it takes to go through the script script_start_time=$(date +%s) + source "$DIR/contrib_modules_setup.sh" source "$DIR/cleanup.sh" source "$DIR/composer_setup.sh" diff --git a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh index 1d7d112b..c040cb98 100755 --- a/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh +++ b/.gitpod/drupal/drupalpod-setup/project-browser-setup.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -ddev composer remove drupal/core-dev +ddev composer remove --dev drupal/core-dev ddev composer remove mglaman/composer-drupal-lenient ddev composer require drupal/automatic_updates:^3.1.3 ddev drush pmu -y admin_toolbar From 976cf59b009ecb8feb5d396fe60d2fd252a2021c Mon Sep 17 00:00:00 2001 From: Darren Oh <9472-darrenoh@users.noreply.drupalcode.org> Date: Sun, 18 Jan 2026 17:51:05 -0500 Subject: [PATCH 13/13] Add updates for Drupal Forge --- .devpanel/init.sh | 10 ++++++++++ .devpanel/settings.devpanel.php | 1 + 2 files changed, 11 insertions(+) diff --git a/.devpanel/init.sh b/.devpanel/init.sh index c34262ff..4551df95 100755 --- a/.devpanel/init.sh +++ b/.devpanel/init.sh @@ -119,6 +119,16 @@ if [ "$DP_PROJECT_TYPE" == "project_theme" ]; then cd "${APP_ROOT}" && drush config-set -y system.theme default "$DP_PROJECT_NAME" fi +# Project Browser setup +composer remove --dev drupal/core-dev +composer remove mglaman/composer-drupal-lenient +composer require drupal/automatic_updates +drush -n pmu admin_toolbar +drush -n en project_browser package_manager navigation +drush -n cset package_manager.settings include_unknown_files_in_project_root true +drush -n cset project_browser.admin_settings allow_ui_install true +drush cr + # Finish measuring script time. script_end_time=$(date +%s) runtime=$((script_end_time - script_start_time)) diff --git a/.devpanel/settings.devpanel.php b/.devpanel/settings.devpanel.php index 49943765..1cff24ba 100644 --- a/.devpanel/settings.devpanel.php +++ b/.devpanel/settings.devpanel.php @@ -9,3 +9,4 @@ $databases['default']['default']['isolation_level'] = 'READ COMMITTED'; $settings['config_sync_directory'] = '../config/sync'; $settings['trusted_host_patterns'] = [getenv('DP_HOSTNAME') ?: '.*']; +$settings['testing_package_manager'] = TRUE;