Add a deploy hook for `drush deploy`?

Created on 5 February 2024, 9 months ago

Problem/Motivation

Drush 10.3 added a drush deploy command that runs these commands:

drush updatedb --no-cache-clear
drush cache:rebuild
drush config:import
drush cache:rebuild
drush deploy:hook

However, if someone uses Config Ignore, and the config_ignore.settings.yml file changed and this command is run, there could still be config to import. drush config:import should be run again if a previously ignored file is no longer ignored and should be imported.

Steps to reproduce

Ignore a file. Deploy. Un-ignore the file. Deploy. You should then run config import again, and see there was still config to import.

Proposed resolution

A deploy hook can be created that will import config and rebuild the cache again. However, it looks like the hook would only be run once.

Maybe there is a way to delete the record that it ran, in order to make it run every time drush deploy is run? Or maybe there's another solution?

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @solideogloria
  • Status changed to Closed: won't fix 9 months ago
  • 🇨🇭Switzerland bircher 🇨🇿

    Hi, yes I know about the deploy hook, I added it to drush. 😀
    It runs after a config import and would run too late to solve the issue outlined here. But in addition deploy hooks are not meant to be used in contib modules, if you see one somewhere it is probably a bug.

    The problem outlined should already have been solved by 🐛 Use ignore settings from storage being transformed if they exist Fixed

    But thanks for thinking this through! If this problem still exists we can look into a solution that adresses it adequately.

  • Ah, so it was fixed in a recent release. Was it fixed in 8.x-3.1?

    Anyways, so what you're saying is that I don't need to have the following anymore in my CI/CD? That's awesome.

    drush cim -y
    drush cim -y
    
  • 🇨🇭Switzerland bircher 🇨🇿

    I don't remember in what version it was fixed, but for sure since the stable release 3.0.

    And yes you don't have to do two imports any more unless you do split splits with config split, but you probably shouldn't do that anyway.

    You are welcome!

Production build 0.71.5 2024