This post is part of a series:
- Jenkins.NET
- Jenkins.NET Plugins
- Setup Jenkins.NET
- Setting up your first job
- Your first build
- Breaking the build
- Diagnosing and fixing a broken build
- Monitoring your build
- Running your tests
- Code Analysis
- Security
- Active Directory Security
For my final post on using Jenkins with .net, here’s how to set it all up in 5 minutes!
Install
- Download the latest version of Jenkins from: http://mirrors.jenkins-ci.org/windows/latest
- Extract the setup files from the zip file.
- Run the Setup.exe.
- Accept all the defaults in the setup wizard.
- Jenkins will now be installed and the main Jenkins page will be open.
Add required .NET Plugins
- Download and install your required .NET framework from: http://www.microsoft.com/net/download
- Open the Manage Plugins page, from the Jenkins menu select Jenkins » Manage Jenkins » Manage Plugins.
- Click the “Available” tab.
- Tick the “MSBuild” plugin.
Add optional .NET Plugins
- Tick the plugin for the source control management software your using.
- If you want to run unit tests as part of your build Tick your chosen testing plugin, this guide will use NUnit.
- Tick the “Active Directory Plugin” if you want to use Active Directory for Authentication.
Setup Jenkins
- Open the main setup page, from the Jenkins menu select Jenkins » Manage Jenkins » Configure System.
- Under the MSBuild section, click the “Add MSBuild” button.
- Set the name and path to MSBuild for example: Name: v3.5 Path to MSBuild: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe
- Click the “Save” button.
Setting up your first job
- From the Jenkins menu click Jenkins » New Job.
- Set Job name for example: Demo.
- Select the “Build a free-style software project” radio button.
- Then click the “OK” button.
- Jenkins will now create the Job workspace on disk and redirect you to the job configuration page.
Source Control
This guide will use Subversion but there are many available.
- Under the Source Control Management section select the “Subversion” radio button.
- Set the Repository URL for example: https://jenkins-net-demo.googlecode.com/svn/trunk
Build Triggers
- Under the Build Triggers section, tick the Poll SCM checkbox.
- Enter “5 * * * *” in the Schedule text area, this translates to check for changes every 5 minutes.
Build the Solution
- Under the Build section click the “Add build step” button and select “Build a Visual Studio project or solution using MSBuild”.
- Set “MsBuild Version” to V3.5 (The version we setup previously)
- Set “MsBuild Build File” to the name of the demo solution: Jenkins-net-demo.sln
- Click the “Save” button and you’ll be redirected to the Demo project page
- Click the “Build Now” link.
You’re done!