Page MenuHomePhabricator

post-receive-hook configured from Phabricator web interface
Closed, WontfixPublic

Description

Our workflow:
developers push code to Phabricator remote repositories -> manually we pull the new commits somewhere that the users can access it, but can't not change it;
users don't have a local checkout of the repositories; they just use the code from a read-only global/shared location;

Problem:
If there are 100 commits every day, then there will be 100 manual pulls every day.

Idea:
We would like to have a 'post-receive-hook' for all repositories that is configured from the Phabricator web interface similar to 'Mirrors' which should get the location where to pull and the branch which should be checkout. If the repository doesn't exist in the given location, then Phabricator will clone it.
Also for one repository we would like to configure many locations to pull on diferent branches.

PS: part of the same discution: Q410

Event Timeline

epriestley claimed this task.
epriestley added a subscriber: epriestley.

I think this use case (specifically, deploying working copies of a repository to a Phabricator host) is extremely unusual.

You can already use Harbormaster to trigger an integration or deployment workflow. This is a much more powerful tool. See:

https://secure.phabricator.com/book/phabricator/article/harbormaster/

Thank you Evan for your ansewer!

Deploying working copies of a repository to a Phabricator host I think so too is far way from the best solution.

As you sugested, I had a look at Harbormaster Application. Unfortunately, I don't know how to configure it. I was wandering if you can point me to some examples.

Hi Evan!

I checked all the documentation regarding Harbourmaster, Almanac and Drydock Applications and I configured our local instalation using as example this Phabricator installation.
Even it's quite complicate to set it up, it makes sense for unit tests, but for simple commands it doesn't because it's quite hard to maintain.

Something simple for us would be:
Create a Herald Rule for Commits type Global -> Action: Run simple command

I would like to know if you think this makes sens or not.

Thanks for your support!

I have no plans to support that in the upstream. Running commands on the Phabricator host is a very unusual use case, and it would allow anyone who can write a Herald rule to write one that runs rm -rf / or compromises the Phabricator install by reading session keys out of MySQL.

You can write a custom action yourself, but be aware that doing so will substantially compromise the security of your install.