Installing Hudson/Jenkins On Windows

From LSDevLinux
Jump to: navigation, search

Here are some links to get you started with Jenkins:

You want to install it as a windows service. I don't think you have to install a slave as a windows service if you want to build on the same machine, the master has a build executor built in (but I might be wrong since it's been a while since a experimented with this).


I suggest you install the following plugins:

  • Jenkins Build-Publisher plugin (required for pushing build results to another Hudson instance)
  • Jenkins build timeout plugin (required to abort hanging builds)
  • Dashboard View (optional, allows you to create different views, e.g. for installer builds, release builds etc)
  • Jenkins disk-usage plugin (optional, shows the amount of disk space a project uses)
  • Email-ext plugin (for notification of failing builds; has more configuration options than the built-in one)
  • Instant Messaging Plugin (required by IRC plugin)
  • IRC Plugin (for notification on IRC channel ♯lsdevlinux-status)
  • Jenkins Locks and Latches plugin (I have this installed to prevent building multiple branches at the same time on the same machine. At least in the past it didn't work if you tried to build WW branch while a build of FW trunk was going on because of the registration of COM objects. This might have changed with the refactoring - haven't tried it since)
  • Jenkins NAnt Plugin (required for build)
  • Node Name plugin (optional; column showing the node name that can be configured in views)
  • Jenkins NUnit plugin (required to process NUnit build results)
  • Perforce Plugin (required for build)
  • Jenkins Radiator View plugin (optional, allows to configure a high visibility view that shows the status of the projects, see for a screenshot)
  • Sectioned View plugin (optional, allows structuring a view a little better)
  • Jenkins Setenv plugin (I have this installed on Linux, not sure if we need it on Windows)

General Setup

It is advisable to specify some labels for build executor nodes. This allows to better specify where a job should run, e.g. to make sure that a Windows job only starts on a Windows node.

  • on the Jenkins main page, click on "Build Executor Status"
  • click each node and go into the "Configure" page
  • Specify one or more labels (separated by spaces), e.g. "Windows 32-bit Dallas"

Set up a FieldWorks build

Global settings

Required and suggested global settings (in Manage Jenkins/Configure System):

Section Global properties:

  • environment variables: checked
name: localsys-workaround
value: true

Section Locks:

  • define a lock for FieldWorks. This allows to prevent multiple concurrent builds of FieldWorks on the same machine.


name: FW

Section Build publishing:

  • Public Hudson server:
Name: Calgary Jenkins
Login: <username>
Password: <password>

Section IRC Notification:

  • check Enable IRC Notification
Port: 6667
Channels: #LSDevLinux-status
Under "Advanced":
Nickname: (I suggest using a descriptive name here, e.g. dallas or waxhaw)
Command prefix: (see email)

Adding a project

You can add a new project by clicking the "New Job" link on the left side. We probably should use a descriptive name that tells the platform, branch and whether it's a debug or release build, so I'd suggest naming it according to the following template: FW-<platform>-<branch>-<debug|release>-<location>, e.g. FW-Win32-WW-debug-Dallas. If we have specialized targets we can append to the end, e.g. FW-Win32-WW-release-Dallas-installer

The following settings work for me:

You might want to restrict where this job can be run so that it doesn't try to run on a Linux node. This is especially important when publishing the build results.

  • Restrict where this project can be run: checked
Label Expression: Windows

Section Source Code Management:

  • Perforce:
Path to p4 executable: C:\Program Files\Perforce\p4.EXE
Username: anonymous
Password: (empty)
Workspace (client): hudson-ww-win (should probably add the location to that, i.e. hudson-ww-win-dallas)
Let Hudson Manage Workspace View: checked
Clean Workspace Before Each Build: unchecked
View: //depot/WW/... //hudson-ww-win/...
Options: noallwrite clobber compress locked nomodtime rmdir

Section Build Triggers:

  • Poll SCM: checked
# every 5 minutes
*/5 * * * *

Section Build Environment:

  • Abort the build if it's stuck: Timeout minutes: 60
  • Locks:
Name: FW

Section Build:

  • Execute Windows batch command:
cd Bld
set AssertUiEnabled=false
..\Bin\nant\bin\nant -t:net-3.5 -D:localsys-workaround=True remakefw-hudson

Section Post-build Actions:

  • Record fingerprints of files to track usage: checked
Files to fingerprint: Output\idhfiles.MD5
  • Archive the artifacts: checked
Files to archive: Output/Debug/NUnit-report.html
  • Publish NUnit test result report: checked
Test report XMLs: Output/Debug/*-results.xml
  • Publish build: checked
Public Hudson instance: Calgary Jenkins
Publish unstable builds: checked
Publish failed builds: checked
  • IRC Notification: checked