Page MenuHomePhabricator

Is there a easy way to create hooks?
OpenPublic

Asked by remusvrm on May 30 2016, 10:23 AM.

Details

We have a few git repositories hosted in Phabricator.
We have a checkout of this repositories on local disk of every developer.
Also we have a checkout of this repositories in a global location that all the users can use the code without permissions of modifying it.
All the time when a developer pushes new commits in a specific repository, a hook pulls the new commits in the global location in order the users to use the new code.

The administrator needs to create a hook and configure it for each repository.
I was wandering if there is an easy way to create this hook using the Phabricator interface, and add only the locations where the daemons should pull when a repository has new commits. In this way we don't have to touch the files on the server.

Thanks for your support!

Answers

avivey
Updated 2,888 Days Ago

There's no global way to install git hooks as part of Phabricator, but there are other options:

  • Phabricator can mirror a repository to a specified location - see Diffusion URIs guide - essentially, replacing this specific hook (You still need to configure it for each repository).
  • Herald supports hooks-like rules, which can replace a sub-set of use-cases for commit hooks. You could initiate a Harbormaster build to perform such actions, or write a custom Herald Action (D8784 has an example; This is not officially supported).

New Answer