https://github.com/metadrop/drupal-updater
Helper to update drupal project's dependencies
https://github.com/metadrop/drupal-updater
composer drupal drush maintenance-scripts
Last synced: 15 days ago
JSON representation
Helper to update drupal project's dependencies
- Host: GitHub
- URL: https://github.com/metadrop/drupal-updater
- Owner: Metadrop
- Created: 2023-02-21T11:21:12.000Z (about 2 years ago)
- Default Branch: 1.x
- Last Pushed: 2025-01-14T15:05:36.000Z (3 months ago)
- Last Synced: 2025-04-10T01:09:44.793Z (15 days ago)
- Topics: composer, drupal, drush, maintenance-scripts
- Language: PHP
- Homepage:
- Size: 58.6 KB
- Stars: 19
- Watchers: 7
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Drupal updater
Drupal updater helps you to update the drupal modules of your site.
It does an update of all your drupal modules and dependencies defined in the composer.json.
It also allows update only securities.
## Requirements
This package works with:
- Drush >=10.
- Composer 2.4 (global).Or alternatively, you can run it inside tools like [ddev](https://ddev.com).
## Installation
Before doing the installation, make sure your environment has composer 2.4 or higher installed locally.
```bash
composer require metadrop/drupal-updater
```Or, if you are using `ddev`:
```bash
ddev composer require metadrop/drupal-updater
```## Configuration
Configuration helps automating update workflows. All the parameters that are repeated through updates
can be added to a configuration file to just launch `drupal-updater`, saving time adding the parameters manually,
or doing custom helpers in local / ci environments.There is a template with configuration ready to use at **vendor/metadrop/drupal-updater/drupal-updater.yml.dist**, to use it just copy it to the root:
```
cp vendor/metadrop/drupal-updater/.drupal-updater.yml.dist .drupal-updater.yml
```The file .drupal-updater.yml at root is the default path, but it is possible to override configuration path by using the **--config** parameter:
```
drupal-updater --config .drupal-updater.securities.yml
```Edit .drupal-updater.yml to setup custom parameters when needed.
### Configuration variables
The following variables can be setup through .drupal-updater.yml
- **author**: Commits author
- **noDev**: Set to true to only update packages deployed in production.
- **onlySecurities**: Set to true to only update securities.
- **packages**: Allows specify which packages will be updated.
- **environments**: Array list of environments to update.## How it works
This module will try to update your dependencies based on how they are required in the composer.json.
- Before starting to update, all the Drupal configuration is consolidated and commited into GIT.
- For each module / package updated the changes are commited:
- For PHP packages, it commits the composer.lock
- For Drupal extensions, it applies the updates, commits the configuration changed and the modified files. On multisites environments it will export/commit the configuration for all environments keeping them all synchronized (see parameters).If a package has an available update and that update can't be done by running `composer update`, it won't do the upgrade. This means that not all packages will be upgraded, but most of them yes.
## Usage
Basic update:
```bash
./vendor/bin/drupal-updater update
```Parameters allowed:
- **--config**: Specify where the configuration file is located.
- **--security**: It will update only securities.
- **--no-dev**: It won't update dev dependencies, only the primary ones.
- **--author**: It sets the git commits author. Example: `Test`
- **--environment**: List of sites (drush alias) to be run on Drupal Multisites. The drush alias must be local.Examples:
- Update securities:
```bash
./vendor/bin/drupal-updater --security
```- Update only primary packages:
```bash
./vendor/bin/drupal-updater --no-dev
```- Update specific packages:
```bash
./vendor/bin/drupal-updater --packages=drupal/core-recommended,drupal/core-dev
```- Update with a specific author:
```bash
./vendor/bin/drupal-updater --author=Test
```- Update on multiple sites (Drupal Multisite):
```bash
./vendor/bin/drupal-updater [email protected],@site2.local,@site3.local,@site4.local
```### DDEV
If you are using `ddev`, you can just run the commands above prepending `ddev exec`.
Example:
```bash
ddev exec ./vendor/bin/drupal-updater --security
```