LaTeX build server with Git and Hudson on Ubuntu 10.04
I’m currently working on a bigger paper for university using LaTeX. As it’s necessary to compile source files multiple times (especially when using BibTeX or TOCs), build runs can take quite some time. As an example, my current build script:
#!/bin/bash BN=paper pdflatex -interaction=nonstopmode $BN.tex bibtex $BN pdflatex -interaction=nonstopmode $BN.tex bibtex $BN pdflatex -interaction=nonstopmode $BN.tex makeindex -s $BN.ist -t $BN.glg -o $BN.gls $BN.glo pdflatex -interaction=nonstopmode $BN.tex pdflatex -interaction=nonstopmode $BN.tex rm -rf $BN.aux rm -rf $BN.lof rm -rf $BN.lot rm -rf $BN.out rm -rf $BN.toc rm -rf $BN.bbl rm -rf $BN.blg rm -rf $BN.brf rm -rf $BN.idx rm -rf $BN.glo rm -rf $BN.ist rm -rf $BN.glg rm -rf $BN.gls rm -rf texput.log
This is OK on my workstation, but running a build on my notebook using a small 1.4 GHz single core processor can take up to a minute which is definitely too long. So I looked for solutions how to move the build process to a central server. As I was already using Git for source control on the project, I tried setting up a remote repository on the server which triggered a build using a post-receive script. This basically worked fine, but I wanted to go a step further. I had a look at CI servers and gave Hudson a try as it seems to have a lot of features while being quite easy to set up.
The result is the following: Hudson is polling the Git repository (can be remote or local, in my case it’s a self-hosted remote gitosis installation, but could be github too), starting a new build on changes and publishing the resulting PDF if successful. Hudson is accessible over https using an Apache2 server as frontend to a Tomcat installation.
Ready? Let’s go.