This Docker composition is an effort to provide an integrated Phabricator and Jenkins setup for reference. It presently has umpteen security issues etc but may still be a useful reference for some of the steps required to get these two systems working together.
Phabricator provides many software development features including VCS serving and browsing, ticketing, and some tools for build systems. Jenkins is a dedicated build server. The integration is aided by the Uber phabricator-jenkins-plugin.
The existing Phabricator image and Jenkins image from Bitnami are used as the base images for this composition.
You may wish to add these lines to your /etc/hosts file to aid in
accessing the created containers. Phabricator requires a . in its name
so it can't be just phabricator. Jenkins is running on port 8080 so
access it via http://jenkins:8080/
127.0.0.1 jenkins 127.0.0.1 phabricator.local
This was tested with a pipeline project. The project itself is private but
the Jenkinsfile is included here as example_Jenkinsfile.
These instructions are abbreviated at this point and assume some ability to navigate Phabricator and Jenkins.
To start (depending on your Docker setup, sudo may be required):
docker-compose up -dYou can watch the Phabricator container log and wait a couple minutes until the overseer deamon starts.
The login:password for Phabricator is user:bitnami1 and for Jenkins
user:bitnami. Please change them or entirely remove those users.
For those new to docker-compose, note that the image names are prefixed by
the project name. This is derived from the directory containing the
docker-compose.yml file unless overridden on the cli.
- Create a bot user named
jenkins - Create repository
- Note: In this case I will use an external repository, often you would just have Phabricator host the official repository itself.
- Select the VCS type
- Specify a name
- Optionally specify a callsign
- If you want to use a 'normal'
.gitmodulesfile for Git submodules you will likely want to specify a short name. This will provide/sources/shortnameURL for cloning which is more compatible with other hosting URL layouts. - Set built-in URI's to I/O type read-only
- Create a new URI to the external repository such as
ssh://git@github.com:altendky/stwith I/O type observe - Add credentials if it is a private external repository
- Activate the repository
- Create a build plan
- Select commit
- Add a build step of type
Make HTTP Request - Set the URI to:
http://jenkins:8080/jenkins/job/${repository.callsign}/buildWithParameters?DIFF_ID=${buildable.diff}&PHID=${target.phid}&COMMIT=${buildable.commit} - Set HTTP Method to POST
- Add Jenkins credential (to be created in Jenkins later)
- Name
phabricator@jenkins - Username:
phabricator - Password: pick something
- Name
- Set
When completeto wait for message
- Create a herald rule
- Commits
- Global
- Rule name:
Build Commit- Add the relevant repositories towhen>repository>is any of- Set the Action torun build plansand selectBuild Commit
- Install the Uber phabricator-jenkins-plugin
- Clone
https://github.com/uber/phabricator-jenkins-plugin- This was tested with
0ba61e0cc30bc8b0fe5bd5110a60f37df32fcd55
- This was tested with
- From the clone
./gradlew assemble - In Jenkins manage plugins and install
./build/libs/phabricator-plugin.hpivia the advanced tab andUpload Plugin.
- Clone
- Install then configure "Docker" plugin
- Manage > Configure > Add new cloud > Docker
- Name: Host Docker
- Host URI:
unix://var/run/docker.sock - Check enabled
- Test the connection for no errors
- Manage > Configure > Add new cloud > Docker
- Create a new item
- Have the name match the Phabricator repositories callsign
- Select pipeline
- Select Ok
- Specify pipeline script from SCM
- Confugre the appropriate SCM
- Set the URL to
ssh://git@phabricator.local/diffusion/THECALLSIGN/the-name.git - In additional behaviours > Add
- wipeout repository and force clone
- advanced submodule
- check recursively update
- check use credentials from parent
- Add SSH user name with private key credentials
- Generate a keypair in Phabricator for the 'jenkins' bot user
- Username
git - Select
Enter directlyand paste the private key
- Branch specifier
${COMMIT} - Uncheck lightweight checkout
- Advanced
- Set the name to match the Phabricator repository name
- Check this project is parametrized
- Add three string parameters named
DIFF_ID,PHID, andCOMMIT - Save
- Add a new user matching the credentials entered into Phabricator above
- Jenkins > Manage > Configure
- Disable CSRF protection
- Yeah... This is bad but I haven't figured it out yet.
- Default Phabricator credentials
- Add
- Phabricator conduit key
- URL
http://phabricator.local- This should be HTTPS, but no SSL certificates setup here yet
- Description
jenkins@phabricator.local - Conduit token
- Generate one for the
jenkins@phabricator.localuser over in Phabricator
- Generate one for the
- Phabricator notifications
- Select the
http://phabricator.localcredentials
- Select the
- Disable CSRF protection
Find a commit and run the build plan manually. Check the build page for a
completed status and in the Make HTTP Request Artifacts section
for the Jenkins build URI.