I tried continuous integration tools Travis CI, CircleCI and codeship, but found none of them provide support document for phabricator. Does anyone have ideas about how to do continuous integration (CI) with Phabricator?
I have done an integration with Travis-CI by adding post diff and land hooks to Phabricator to push diffs as branches to GitHub where Travis looks for branch updates. As far as I know, Travis-CI integrates only with GitHub, so if your main repo is there and Phabricator is pointing to it, it can be done.
If you want to take this approach, the place to start is with creating your own ArcanistConfiguration and overriding didRunWorkflow
. See also how to create a new library. The API documentation is pretty good, but I had to go through some trial and error to get what I wanted. The Phabricator people are probably happy to answer questions.
You can also look into the Phabricator conduit differential.createcomment
to script messages to diffs like so:
arc call-conduit --conduit="https://my.phabricator.com/" --arcrc-file="robot.arcrc" \
differential.createcomment <<EOF
{"revision_id":"1234","message":"Yer build done failed"}
EOF
Where robot.arcrc
is an arcrc
file with the credentials to push messages, and 1234
is the revision number. You would have to use the conduit
API to get the revision number.
So, I think the answer is you may have to build your own custom solution depending on which CI integration for the CI tool you want to integrate with. And here's a discussion of Travis support for Phabricator.
Edit: Here's traphic, an example of extending arcanist to push diffs to branches on GitHub on arc diff
and remove them on arc land
. As Travis-CI looks for update from GitHub, it will build your diffs.
Side note: This is mostly a brain dump. I know good answers have more code examples and links are frowned on, but the question was pretty open ended and was looking for pointers, so I'm trying to be helpful.
If you are using Jenkins, the nice guys at Uber created a Jenkins Phabricator Differential plugin that makes it possible to really clean up your job configs (if you've already set them up using the links from zerodiff's post).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With