Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.I am moving all of the "deployment hooks" code from devshop to Hosting Git, now calling them "git hooks". That's what I called the checkboxes for running updb, cc all, etc.
I'm moving them into Hosting Git.
Here's the plan:
- Add 'git_hooks' column to {hosting_git} table.
- Add 'Git Hooks' field listing checkboxes of available hooks along with code for insert and update. (For site nodes only.)
- Add 'hook_hosting_git_hooks()' to allow modules to return list of git hooks.
- Add git_hooks as a provision context property.
- Add code to run each git hook on git checkout and git pull tasks. If git pull or checkout is being run on a platform, run the git hooks for every site on the platform.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 2897894-defautsdraft.patch | 1.32 KB | helmo |
| #6 | 2897894-git-hooks.patch | 21.39 KB | Jon Pugh |
| #5 | 2897894-git-hooks.patch | 21.39 KB | Jon Pugh |











Comments
Comment #5
Jon PughComment #6
Jon PughComment #7
helmo CreditAttribution: helmo at Initfour websolutions commentedI added one minor fix to the feature branch.
On a test platform (from git) with a site (not in git) I get "No hooks to invoke in site s1.example.com: %hooks." ..
Clearly a missing placeholder ... but more.
I selected two hook for the platform, but none for the site.
Looking at the code there seems no way that it uses the hooks configured for the site ... should that be removed from the create node form?
Comment #8
Jon PughI think we should only allow hooks on sites.
Also, a site can have git hooks even if it is not in git, if it's platform is in git.
I have a big branch in devshop that would switch to use these tasks, so it's going to take a bit more time to get this right. I don't think we will get it done for 3.12.0
Comment #9
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commented#2888523: Add "Sanitize database" site task would also be a nice one to add to the default list once ready.
Comment #10
Jon PughRight now if you use Hosting Git to setup a site with a git repo using the recommended "drupal-composer" project, the platform verify fails.
The reason is that the site is missing components until
composer installis run. So we need to be able to run composer install pre-verify for situations like this.See https://www.drupal.org/docs/develop/using-composer/using-composer-to-man...
or
https://github.com/drupal-composer/drupal-project
Comment #12
Jon PughThe problem I'm describing in the comment above is fixed in #2937147: Add Composer support directly to Provision., going out in the next release.
Comment #13
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedI just pushed some api doc updates...
And here's a patch that might help with the site vs platform hooks ... let me know if it conflicts with your thoughts.
Comment #14
Jon PughI've created a pull request for improved tests that check Git settings.
They aren't passing yet, and need tests to confirm the hooks run on task execute.
https://github.com/aegir-project/tests/pull/15