Skip to content
forked from vaneyckt/Jently

A Ruby app that makes your Jenkins CI automatically run tests on Github pull requests and updates their commit status. This fork from the original project fixes various issues and adds the ability to monitor multiple projects for pull requests.

License

Notifications You must be signed in to change notification settings

accorvin/Jently

 
 

Repository files navigation

<img src=“https://travis-ci.org/vaneyckt/Jently.png?branch=master” />

Introduction

Jently is a Ruby app that makes it possible for Jenkins to run tests on open pull requests on Github. Jently itself acts as a mediator between Jenkins and Github. It talks to Github to determine the existence an open pull request and then instructs Jenkins to run the appropriate job for the pull request, specifying to test the branch that the pull request was made on. After the Jenkins job has finished, Jently collects the result and updates the status of the relevant pull request.

Features

  • Jently automatically re-runs tests whenever new commits are added to either the pull request itself or the branch that the pull request needs to be merged into.

  • Jently uses the Github Commit Status API to update the status of the last commit of a pull request. Whenever possible, a status update contains a link to the Jenkins job that was run to ascertain the correct status.

Getting Started

There are 5 small steps involved in getting Jently up and running. These steps assume you have a recent version of Ruby installed and have sufficient access to your Jenkins CI so as to add builds.

Modifying your Jenkins CI

You will need to setup a parameterized Jenkins build for testing pull requests. Jently will instruct Jenkins to use this build for running tests on an open pull request and which branch to test. You can tell Jently about this build by modifying its configuration file. We will look at this configuration file in a later step, but for now let’s focus on setting up the parameterized build.

On the Configure build screen of your job, you’ll want to check the ‘This build is parameterized’ checkbox. Add ‘branch’ and ‘id’ string parameters. This id is used to determine the status of the job after it has been started.

Further down on the Configure build screen you can specify your Source Code Management settings. Make sure that your branch specifier is set to ‘$branch’.

Downloading Jently

You’ll need to clone the Jently repository to your hard drive in order to get started. You can do this by running:

git clone https://github.com/accorvin/Jently.git

Modifying the configuration file

A configuration file can be found in the /config directory. There are a few configuration details that you will need to specify before running Jently. The comments in the file should hopefully make it easy to get everything set up right.

Installing the software

Jently uses bundler to install the Ruby gems it requires. You can install bundler by running:

gem install bundler

You can now use bundler to install the required gems by navigating into the Jently folder and running:

bundle install

Running Jently

Navigate into the Jently folder and run:

bundle exec rake jently:start

This command will start Jently as a daemon process in the background. If this is your first run, Jently will start by creating a .yaml file in the /db directory to help keep track of pull requests.

Common problems

  • ensure that Jently has read and write permissions for the /db folder and its contents.

  • certain older versions of Ruby have been observed to suffer the occasional hiccup. Ruby 2.0.0-p195 will work perfectly.

About

A Ruby app that makes your Jenkins CI automatically run tests on Github pull requests and updates their commit status. This fork from the original project fixes various issues and adds the ability to monitor multiple projects for pull requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%