In my last post I argued that we should start treating our build pipelines as code, as potentially complex applications that serve a single purpose: To test, publish and deploy your software.
What I didn’t mention was how to get there. Do I want everyone to throw away their beloved Jenkins and go develop their own buildservers?
Well, yes, but I also want to do the heavy lifting for you:
LambdaCD is a library that gives you
- An execution engine to execute your build steps one after another (and stops on failure)
- Persistence and and API to access state and history of your pipeline
- A basic UI to visualize and interact with your pipeline.
- A few basic building-blocks for your pipeline, e.g. manual triggers, parallel execution of steps, …
What is left for you to do is code the structure of your pipeline and your build-steps. Build steps are regular Clojure functions that take input data and return a map with results. The structure of your pipeline is a nested list of such functions.
In short, this is what you code:
And this is what you get: (yes, I know this isn’t stellar web design)
The easiest way to get started is to use Leiningen to generate a project for you:
lein new lambdacd <SOME-PROJECT-NAME>. This will create a project for you that you can run using
lein uberjar creates a self-contained jar-file that can run on any server with java installed. That’s all you need for your very own, custom built build-server!
Now go ahead, have a look at the generated code, play around a bit and then come back, tell me what you think.