Skip to content

Commit

Permalink
Merge pull request #332 from wunderio/feature/drupal10
Browse files Browse the repository at this point in the history
Upgrade project to Drupal 10. Resolves #313, #315.
  • Loading branch information
tormi authored Jan 30, 2023
2 parents 524265a + 0ed8dcc commit f90fbc5
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 93 deletions.
11 changes: 4 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ orbs:
silta: silta/[email protected]

executors:
cicd80:
cicd81:
docker:
- image: wunderio/silta-cicd:circleci-php8.0-node16-composer2-v0.1
- image: wunderio/silta-cicd:circleci-php8.1-node16-composer2

workflows:
version: 2
commit:
jobs:
- silta/drupal-validate:
name: validate
executor: cicd80
executor: cicd81
post-validation:
- run: echo "You can add additional validation here!"

Expand All @@ -25,7 +24,7 @@ workflows:

- silta/drupal-build-deploy: &build-deploy
name: build-deploy
executor: cicd80
executor: cicd81
codebase-build:
- silta/drupal-composer-install
- silta/npm-install-build
Expand Down Expand Up @@ -54,5 +53,3 @@ workflows:
filters:
branches:
only: /dependabot\/.*/


12 changes: 6 additions & 6 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: drupal-project
recipe: drupal9
recipe: drupal10

config:
php: "8.0"
php: "8.1"
via: nginx
webroot: web
database: "mariadb:10.3"
Expand Down Expand Up @@ -46,9 +46,9 @@ services:
environment:
HASH_SALT: notsosecurehash
ENVIRONMENT_NAME: lando
DB_NAME_DRUPAL: drupal9
DB_USER_DRUPAL: drupal9
DB_PASS_DRUPAL: drupal9
DB_NAME_DRUPAL: drupal10
DB_USER_DRUPAL: drupal10
DB_PASS_DRUPAL: drupal10
DB_HOST_DRUPAL: database
DRUSH_OPTIONS_URI: https://drupal-project.lndo.site
# Support debugging with XDEBUG 3.
Expand Down Expand Up @@ -121,4 +121,4 @@ env_file:
- .lando/.env

# Tested with Lando version
version: v3.6.1
version: v3.11.0
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ Drush alias for **current** Silta feature branch deployment is `drush @current s
- Drush alias: `lando drush @local st`
- SSH: `lando ssh (-s <service>)`

### [Setup](https://docs.lando.dev/basics/installation.html)
### [Setup](https://docs.lando.dev/getting-started/installation.html)

1. Install the latest [Lando](https://github.com/lando/lando/releases) and read the [documentation](https://docs.lando.dev/).
2. Update your project name and other Lando [Drupal 9 recipe](https://docs.lando.dev/config/drupal9.html)'s parameters at `.lando.yml`.
2. Update your project name and other Lando [Drupal 10 recipe](https://docs.lando.dev/drupal/)'s parameters at `.lando.yml`.
3. Run `lando start`.

### [Services](https://docs.lando.dev/config/services.html)
### [Services](https://docs.lando.dev/core/v3/services.html)

- `chrome` - uses [selenium/standalone-chrome](https://hub.docker.com/r/selenium/standalone-chrome/) image, uncomment the service definition at `.lando.yml` to enable.
- `elasticsearch` - uses official [Elasticsearch image](https://hub.docker.com/r/elastic/elasticsearch), uncomment the service definition at `.lando.yml` to enable. Requires [at least 4GiB of memory](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html).
- `kibana` - uses official [Kibana image](https://hub.docker.com/r/elastic/kibana), uncomment the service definition at `.lando.yml` to enable.
- `mailhog` - uses Lando [MailHog service](https://docs.lando.dev/config/mailhog.html).
- `node` - uses Lando [Node service](https://docs.lando.dev/config/node.html).
- `mailhog` - uses Lando [MailHog service](https://docs.lando.dev/mailhog/).
- `node` - uses Lando [Node service](https://docs.lando.dev/node/).

### [Tools](https://docs.lando.dev/config/tooling.html)
### [Tools](https://docs.lando.dev/core/v3/tooling.html)

- `lando` - tools / commands overview.
- `lando grumphp <commands>` - run [GrumPHP](https://github.com/phpro/grumphp) code quality checks. Modified or new files are checked on git commit, see more at `lando grumphp -h` or [wunderio/code-quality](https://github.com/wunderio/code-quality).
Expand All @@ -56,7 +56,7 @@ Drush alias for **current** Silta feature branch deployment is `drush @current s

### Drupal development hints

- [Updating Drupal core](https://www.drupal.org/docs/8/update/update-core-via-composer).
- [Updating Drupal core](https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-composer).
- [Altering scaffold files](https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold#toc_4) (`robots.txt`, `.htaccess` etc.).

### Running tests
Expand Down
45 changes: 17 additions & 28 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wunderio/drupal-project",
"description": "Wunder's template for Drupal 9 projects.",
"description": "Wunder's template for Drupal 10 projects.",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
Expand All @@ -15,40 +15,39 @@
}
],
"require": {
"php": ">=7.4",
"composer/installers": "^2.0",
"php": ">=8.1",
"composer/installers": "^2.1",
"cweagans/composer-patches": "^1.7",
"drupal/admin_toolbar": "^3.1",
"drupal/core-composer-scaffold": "^9.3",
"drupal/core-recommended": "^9.3",
"drupal/monolog": "^2.0",
"drupal/simplei": "^1.2",
"drupal/warden": "^3.0@RC",
"drush/drush": "^11.0",
"drupal/admin_toolbar": "^3.3",
"drupal/core-composer-scaffold": "^10.0",
"drupal/core-recommended": "^10.0",
"drupal/monolog": "^3.0@beta",
"drupal/simplei": "^2.0@beta",
"drush/drush": "^11.4",
"vlucas/phpdotenv": "^5.4",
"webflo/drupal-finder": "^1.2",
"wunderio/drupal-ping": "^2.3"
"wunderio/drupal-ping": "^2.2"
},
"require-dev": {
"drupal/core-dev": "^9.3",
"phpspec/prophecy-phpunit": "^2.0",
"wunderio/code-quality": "^2.1"
"drupal/core-dev": "^10.0",
"wunderio/code-quality": "^2.2"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"discard-changes": true,
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"koodimonni/composer-dropin-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpro/grumphp": true
"phpro/grumphp": true,
"phpstan/extension-installer": true
}
},
"autoload": {
Expand All @@ -58,12 +57,6 @@
"files": ["load.environment.php"]
},
"scripts": {
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
Expand Down Expand Up @@ -110,11 +103,7 @@
]
},
"composer-exit-on-patch-failure": true,
"patches": {
"drupal/warden": {
"https://www.drupal.org/project/warden/issues/3024254": "https://git.drupalcode.org/project/warden/-/commit/b28f9cf2b9acdd21ed3584bf5276b39f11f1cb49.patch"
}
},
"patches": {},
"dropin-paths": {
"web/": [
"type:web-dropin",
Expand Down
2 changes: 1 addition & 1 deletion grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ grumphp:
tasks:
php_compatibility:
run_on: '%grumphp.run_on_paths%'
testVersion: '8.0'
testVersion: '8.1'
check_file_permissions: ~
php_check_syntax:
run_on: '%grumphp.run_on_paths%'
Expand Down
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ parameters:
- '#Missing cache backend declaration for performance.#'
- '#Plugin manager has cache backend specified but does not declare cache tags.#'
- '#Unsafe usage of new static\(\)#'
includes:
- %currentWorkingDirectory%/vendor/mglaman/phpstan-drupal/extension.neon
- %currentWorkingDirectory%/vendor/phpstan/phpstan-deprecation-rules/rules.neon
39 changes: 1 addition & 38 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Drupal\Core\Site\Settings;
use DrupalFinder\DrupalFinder;
use Symfony\Component\Filesystem\Filesystem;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

class ScriptHandler {

Expand Down Expand Up @@ -60,41 +60,4 @@ public static function createRequiredFiles(Event $event) {
}
}

/**
* Checks if the installed version of Composer is compatible.
*
* Composer 1.0.0 and higher consider a `composer install` without having a
* lock file present as equal to `composer update`. We do not ship with a lock
* file to avoid merge conflicts downstream, meaning that if a project is
* installed with an older version of Composer the scaffolding of Drupal will
* not be triggered. We check this here instead of in drupal-scaffold to be
* able to give immediate feedback to the end user, rather than failing the
* installation after going through the lengthy process of compiling and
* downloading the Composer dependencies.
*
* @see https://github.com/composer/composer/pull/5035
*/
public static function checkComposerVersion(Event $event) {
$composer = $event->getComposer();
$io = $event->getIO();

$version = $composer::VERSION;

// The dev-channel of composer uses the git revision as version number,
// try to the branch alias instead.
if (preg_match('/^[0-9a-f]{40}$/i', $version)) {
$version = $composer::BRANCH_ALIAS_VERSION;
}

// If Composer is installed through git we have no easy way to determine if
// it is new enough, just display a warning.
if ($version === '@package_version@' || $version === '@package_branch_alias_version@') {
$io->writeError('<warning>You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.</warning>');
}
elseif (Comparator::lessThan($version, '1.0.0')) {
$io->writeError('<error>Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing</error>.');
exit(1);
}
}

}
2 changes: 1 addition & 1 deletion silta/php.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dockerfile for the PHP container.
FROM wunderio/silta-php-fpm:8.0-fpm-v0.1
FROM wunderio/silta-php-fpm:8.1-fpm

COPY --chown=www-data:www-data . /app
2 changes: 1 addition & 1 deletion silta/shell.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dockerfile for the Shell container.
FROM wunderio/silta-php-shell:php8.0-v0.1
FROM wunderio/silta-php-shell:php8.1

COPY --chown=www-data:www-data . /app
2 changes: 1 addition & 1 deletion silta/silta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# for all possible options.

php:
drupalCoreVersion: "9"
drupalCoreVersion: "10"

# Configure reference data that will be used when creating new environments.
referenceData:
Expand Down

0 comments on commit f90fbc5

Please sign in to comment.