linci

me@home:~$ whatis -s1 linci
linci (1)   - Continuous Integration server for Linux.

linci is a tool to create a continuous integration server for running builds and jobs. It was written to be light enough to run on a cloud VM with 512MB of RAM.

linci itself has no server component, its a framework for running build scripts. It uses tsp and ii deamons for scheduling jobs and sending job status to IRC.

Config files

Build configs are flat files with targets much like make, except that each target must be a single command.

There are a many build tools out there (grunt, maven, make, cmake, etc..) each with different merits, the aim of linci is to abstract the differences so that calling linci build works for all projects.

By making build targets a single command devs have to submit the build instructions to version control along side the code. Its a normal good practice to include a Makefile alongside the code.

This is what a linci build configuration looks like

linci> list myproj

/var/linci/config/myproj.build

description: Example build
environment:
init: p4-checkout.sh ssl:vbox:1424 //depot/myproj/... 
clean: rm -rf *

targets::

sync: p4-update.sh
test: test/compile-bash.sh
deb: sudo deploy/builddeb.sh
install: sudo deploy/installdeb.sh
publish: sudo -E /var/linci/config/lib/publish.sh myproj-*.x86_64.deb 

Lines before targets:: must be executed individually e.g.

linci> build myproj clean

All the lines after targets:: are executed in order when you call

linci> build myproj
More details about configuring jobs is available here linci configuration

Notifications

Notifications are handled by IRC via the beautifully simple ii. Everytime a build is run and when it finishes a message is sent to an IRC channel. The channel used is determined by environment variables so you can change notifications per build. Linci also supports email and xtomp integration or any other tool that has a cli interface.

Queues

One of the convenient features of Jenkins is the ability to setup build queues, by default linci uses tsp (task spooler with TS_SLOTS=10) you can replace tsp with any other scheduler you like or write your own by setting the SCHEDULER environment variable.

Generally linci is configured by setting environment variables, often this is done as expected by editing files in /etc/linci, also there can be per build variables setup in the environment: target. So, for example, you can change the scheduler just for one job to bypass the queueing and run immediatly.

API

linci has no GUI, so it does not need an API, everything you can do on the CLI you can automated with trivial ssh scripts.

me@home:~$ ssh ci@ci linci build myproj

Scheduling jobs in the future

Use cron and at.
e.g.

linci> echo linci build myproj | at 18:00

Supported version controls systems

Any tool that has a command line interface.

linci has no scripts for polling version control systems for changes, you can write one and cron it, but better is to use triggers, or webhooks.

Supported build tools

Any tool that has a command line interface.

Supported job schedulers

The default scheduler is

tsp -n -f -L
Any script can take two arguments, the name of the run and the script to run, and will return 0 for success and anything else for failure can be used as the scheduler. Ths simplest possible scheduler is a script that contains
bash $2
This will run all jobs immediatly.

Slaves

Currently linci has no concept of master and slave. By using SSH its easy to get linci to call builds on other servers.