2

I have 2 servers

  • Server 1: Contains my central git repos the second
  • Server 2: Contains my edgewell Trac enviroment

I am trying to get trac to update tickets based on git commit messages.

I know that there is a post-receive hook but that will only work on the server 1

How do I tell server 2 to run the trac-admin changeset added cmd?

Also if I created a clone of the git repo on server 2 then I am to use git pull cmds which in turn would call the post-merge hook but this doesn't seem to get called with the same stdin parameters that the post-receive hook has.

Is there a way of setting up server 1 to run an ssh cmd or send a data payload to a web cgi script on server 2 that performs a pull request on the cloned repo and proceeds to perform the trac-admin changeset added cmd?

1 Answers1

1

trac-github has a request handler for a GitHub webhook that does a git update (git.remote('update', '--prune')) and then runs changeset added (rm.notify('changeset_added', reponame, added)). You could write a small plugin that response to a request and does the same, and send the request from a post-receive hook using curl.

However, it might be simpler to push to the mirror repository from the main repository and have the mirror run the post-receive hook to sync the changeset to Trac.

Community
  • 1
  • 1
RjOllos
  • 2,900
  • 1
  • 19
  • 29
  • I like the second option. I looked at the first option but got too confused on what was required to get the hook working. Any examples would great. – thefearlessdog Mar 11 '17 at 23:03