This project is read-only.

psake-ci Example


This example uses the PoShRabbit module to create a mini continuous integration system. Note that this is not meant as a general-purpose CI system, it is meant to be example code for the PoShRabbit project (so please don't email me looking for information or advice on getting it working for your own project).


This example uses a RabbitMQ exchange to distribute CI messages between three agents: the mercurial monitor, the build agent, and the status agent.

The mercurial monitor periodically checks source control for new commits. When a new commit is detected, a message is sent over the exchange to trigger a build on the build agent. In addition, both the build agent and mercurial monitor send status updates that can be consumed by the status agent.


You must have:
  • PoShRabbit module installed on your system.
  • a RabbitMQ server available; this example assumes you do not need to authenticate with the RabbitMQ server.
  • a Mercurial repository with a project in it.
  • the project must build with psake, and it must use the default psake script file name 'default.ps1'.


Update the config.ps1 file with your own RabbitMQ and Mercurial settings.

The example requires three active PowerShell sessions. In the first session, run the start-buildagent.ps1 script. This script starts the psake-based build agent that waits for changeset notification messages from the Mercurial monitor. In the next session, run start-statusagent.ps1. This script receives build status notification messages and outputs them to the console. Finally, in the last session, run start-hgmonitor.ps1. This script polls the Mercurial repository, looking for new changesets to buid.


You can run multiple build agents simultaneously - since they all connect to the same queue on the same RabbitMQ exchange, they will automatically load-balance the builds!

Last edited Nov 23, 2010 at 7:18 PM by beefarino, version 1


No comments yet.