Running MSBuild 4.0 and MSBuild 3.5 on Continuous Integration

msbuild-40-and-msbuild-35

With Visual Studio 2010 RC released recently, we jumped on the release and began to code with VS2010.  One issue that popped up was that now all builds were targeting MSBuild 4.0.

That doesn’t seem to be a big problem until our CruiseControl CI server kicked in, downloaded our updated code and failed building the upgraded projects.

Fortunately there is a very quick solution to this little problem.  There are a couple of requirements.

1. You need to have VS2010 RC installed somewhere
2. You need to download the .Net Framework 4.0 (I recommend the full version and not just the Client Profile, it ensures you don’t miss anything)

To fix, do the following:

1. download and install the .Net Framework 4.0 on the CI server (then restart the server)
2. on the computer where VS2010 RC is installed go to the following path:
%programfiles%\MSBuild\Microsoft\VisualStudio
3. copy the v10.0 folder located in that directory into the CI server at the same path (or wherever our MSbuild path is on the CI server)
4. Once that is done, edit the ccnet.config file at the tag and change it to the new .Net 4.0 Framework installed (you should only need to change the section “\v3.5\” to “\v4.0.xxxxx\”

Hope this helps

Tagged : / / / / / / / / / / / / / / /

Bamboo – A Continuous Integration Server – Complete Guide

bamboo-a-continuous-integration-server

Bamboo – A Continues Integration Server

Continuous integration (CI) brings faster feedback to your development process, preventing bugs from piling up and reducing the risk of project delays.

Bamboo enables development teams of any size to adopt CI in minutes, easily integrate it with their work day and scale their build farm using elastic resources in the Amazon EC2 cloud.

Continuous integration (CI) brings faster feedback to your development process, preventing bugs from piling up and reducing the risk of project delays.

Bamboo enables development teams of any size to adopt CI in minutes, easily integrate it with their work day and scale their build farm using elastic resources in the Amazon EC2 cloud.

Bamboo makes every stage of continuous integration adoption easy, intuitive and pain-free.

Set up your first CI build in minutes
Integrate/ Collaboration CI with your current tools and workflow
Scale your build farm on-premises or in the cloud!
Analyse and improve your build performance
Extend Bamboo with plugins and the REST API
Full feature list and system requirements

Integrate/ Collaboration

Bamboo lets you pick how and when you’re notified about builds and integrates easily with tools you’re already using, so your team will be able to work together to keep your builds green!

Notifications via email, RSS, IM or IDE pop-up:
With Bamboo each team member can choose how and when to be notified:

Email, RSS, IM or IDE pop-up notifications
Customised email templates (HTML or plain-text)

Choose which builds to be notified about:

All builds for a project
Specific build plans
Every time a build finishes, only when it fails X times, only when it hangs, or only when it times out

Priorities your build queue
When your build agents are busy, Bamboo builds go into a queue.

Need to see the results of a build ASAP? You can:

Escalate builds to the front of the queue with one click.
Stop in-progress builds.
Move lower-priority builds to the back of the line.

Apply labels and comments to build results
Why did a build fail? What did you fix to turn it green again? Which builds have been tested by your QA team? What builds are approved for release to customers? Bamboo let’s you provide content to your builds results using labels and comments.

  • Apply labels and comments via your Web browser, IDE, or Bamboo’s unique 2-way IM system
  • Subscribe to an RSS feed of all build results with certain labels (e.g. “QA_FAILED”, “PATCH”,etc.)

Run and fix builds from Eclipse and IntelliJ
Bamboo integrates with Eclipse and IntelliJ IDEA to bring build management and notification into the IDE:

  • Run, label and comment builds
  • Receive pop-up notifications for builds you care about
  • Quickly identify failing tests and re-run them locally with just one click

Link builds to JIRA issues
Bamboo integrates with JIRA and allows you to easily:

  • View all builds related to an issue
  • View all issues related to a build, and mark them resolved
  • Embed build status and summary gadgets into your JIRA project dashboards

View changes that triggered builds with FishEye
By integrating Bamboo with FishEye, you can quickly see what files were changed to trigger a build and what JIRA issue the changes were made for. Want to see exactly what changed? FishEye diffs are just a click away!

Run Clover Test Optimization and code coverage
Integrate Clover for Java Test Optimization and code coverage, and you’ll instantly get faster builds and better code quality insights!

  • Clover Test Optimization can make your Java unit and functional tests run several times faster
  • View method, branch and statement coverage
  • See when and where coverage drops over time

Display results in Confluence dashboard portlets
Bamboo provides portlets that can easily be embedded on any Confluence page, so you can keep every project stakeholder up to date on project status.

  • See pass/fail status, duration, and number of failed tests for recent runs of a build plan.
  • View the latest status for all builds in a project.

Embed JavaScript widgets in any HTML page
Bamboo provides JavaScript widgets that can be embedded into any HTML page. With just a few lines of code, create custom pages that include:

  • Latest build results
  • Latest changes
  • Last result of all builds in a project
  • Plan summary graphs

Scale Your Build System

As your team runs more and more CI builds, you’ll want to add more computing power to maintain fast feedback on your build and test results.

Bamboo makes scaling your build system a snap with:

  • Remote agents that run on-premises
  • Elastic agents in the Amazon EC2 cloud.

Remote agents

Your Bamboo server can manage dozens of remote agents simultaneously, taking advantage of available computing power to provide the fastest feedback possible. With remote agents you can:

  • Run multiple builds at once to reduce feedback times
  • Test on different platform configurations

Elastic agents

Elastic agents are remote agents that run in the Amazon Elastic Compute Cloud (EC2). By using the cloud, you can instantly scale your build environment as your development cycles ebb and flow and build queues become longer. Bamboo makes it easy to customize and manage your elastic agents:

  • Schedule agents to start and stop based on known peaks and valleys in your need for CI builds.
  • Cut operational costs by taking advantage of EC2’s reserved instance pricing and availability zones.
  • Customise agent images with different operating systems, installed software, and computing power to create the most flexible building and testing system possible.
  • Reduce data transfer and startup times by using Amazon Elastic Block Storage (EBS) for persistence.

Every build agent (remote or local) has specific capabilities that are used to match the requirements of queued builds.

Bamboo’s web interface makes it easy to manage all your agents and view a log of recent activity for each agent.

Analyse and Improve Your Builds

Your team is running builds on every commit, comprehensive performance and functional tests are running every night, and your build farm has been scaled out. Wondering where and how you can make improvements? Bamboo makes it easy to see the performance of your builds and identify trouble spots and possible improvements.

  • Find out why a build failed
  • View build plan performance across time
  • See what’s breaking most so you can investigate
  • Compare several plans
  • Compare team performance and drill into author details

What happened?
When your builds turn red, you want to fix them as fast as possible! Bamboo provides information to your team that makes root-cause analysis easier, so you can turn the build green again ASAP.

  • Full stack traces for compilation failures
  • Full stack traces for test failures
  • Highlighting of newly failed tests
  • Click-through to the failing code from within the IDE

Build plan summaries at a glance
Bamboo’s plan summary view presents a wealth of information about each build plan including:

  • Results of the latest build
  • Historical pass percentage and average build time
  • Result, duration, and number of failed tests for recent builds
  • Duration and failure trends across time

Find your trouble spots
Bamboo identifies problem areas within each build based on its performance history including:

  • Most common failures
  • Tests that take longest to fix
  • Long-running tests

Compare your build plans
Which builds are turning red the most often? Which builds are taking longest to run? Bamboo reports provide useful information within a few clicks, for the exact set of plans you care about. Reports include:

  • Success percentage
  • Duration
  • Activity
  • of tests
  • of failed tests
  • Time to fix failures
  • Clover code coverage

View the CI scorecard
Who’s submitting bullet-proof code? Who’s going to buy beer for breaking the most builds? Bamboo provides insightful reports for:

  • Full Teams: # of builds triggered / failed / fixed
  • Individuals: build history, last 10 triggered / failed / fixed
  • Groups: Success percentage, # of failed / fixed builds

Extend Bamboo

Bamboo works great right out of the box, and it can be extended to fit your exact needs:

  • Install 3rd party plugins from the Atlassian Plugin Exchange to add support for additional SCMs, test tools and more.
  • Create your own Bamboo plugins. Get help from Atlassian and other Bamboo developers in the Bamboo Development Forum and then share your plugins on the Atlassian Plugin Exchange
  • Use Bamboo’s comprehensive REST API to integrate Bamboo with other tools or automate common tasks.

System requirements and supported development tools

CI server and agent operating systems Windows, Linux, Mac OS X

Cloud platforms

Amazon EC2 (Linux, Windows)

SCM repositories

Built-in support: Subversion, CVS, Perforce
Supported via plugin: Git, Github, Mercurial, Clearcase, Accurev, Dimension

Programming languages

All languages supported — Java, C/C++, C#, VB.net, PHP, Ruby, Python, perl, …

Builders

Ant, Maven, Maven2, make, NAnt, Visual Studio (devenv, MSBuild), custom command line, shell scripts

Test tools

JUnit, any tool with JUnit XML output including: Selenium, TestNG, NUnit, CppUnit, PHPUnit, PyUnit (plugin), PMD (plugin)

Code coverage tools

Atlassian Clover, Corbertura (Plugin), RCov (Plugin)

Build and agent management

Build configuration
  • Plan to agent capability matching
  • Build artifact management
  • Build notification configuration
  • Bulk editing of multiple plans
  • Build result and artifact expiration

Build triggers

  • Commit-triggered builds
  • Manual builds
  • Scheduled builds
  • Dependency-triggered builds

Build queue management

  • Build-queue re-ordering
  • Hung-build detection
  • Configurable queued build timeouts
  • Elastic agent startup

Build result management

  • Label build results via Web browser, IDE, or 2-way IM
  • Comment build results via Web browser, IDE, or 2-way IM
  • Create a Mylyn task to fix failed builds
  • View the most popular labels, all build results with a label, or all labels applied to a build plan.

Agent configuration

  • local, remote and elastic agents
  • Builder, JDK and custom capabilities

Agent management

  • Agent status monitoring

Build result notifications

RSS feed
  • All builds or all failed builds across all plans
  • All builds or all failed builds of a specific plan
  • All builds with a specific label

Email

  • Customized email templates
  • All results or all failed results for a build plan

Instant message

  • Google Talk, Jabber, other XMPP-based clients
  • All results or all failed for a build plan
  • Commment on build results via IM
  • Label build results via IM

IDE notification

  • Pop-up notifiers
  • Pass/fail icons in status bar

External tool integrations

IDE connectors Eclipse, IntelliJ IDEA

JIRA

  • View and manage issues related to a build result
  • View all builds related to an issue
  • View builds related to a JIRA project
  • Display JIRA dashboard gadgets for latest build status and build plan summaries

Confluence

  • View latest result of a build plan
  • View recent results for projects, plans, or authors
  • Charts for recent build duration and test failure count
  • Charts for average build duration and test failure % over time

FishEye

  • View committed changes that triggered a build
  • One-click diff and change history from Bamboo build results

Other tools

  • JavaScript widgets including latest builds, plan status, and summary graphs

Elastic Bamboo

Elastic agent configuration
  • Amazon Machine Image (AMI) customisation
  • Elastic Block Storage (EBS) persistence

Elastic Agent Management

  • Web browser and SSH management
  • Start agents from build queue
  • Agent scheduling
  • Agent usage tracking

Build analysis and reporting

Build plan reports
  • Duration, failed tests for recent builds
  • % Successful builds, average build duration over time
  • Test statistics per plan
  • Individual test history
  • Clover — code coverage per plan
  • Clover — lines of code per plan
  • Avg. time to fix builds

Author reports

  • Build statistics per author
  • Build results per author
  • Activity, failures, fixes per author

Security and user management

Authentication
  • Single sign-on with Atlassian Crowd
  • LDAP integration

Permissions and access control

  • User and group definitions and permissions
  • Anonymous user permissions
  • Plan-level permissions

Extending Bamboo

Plugins
  • Bamboo plugin framework
  • Dozens of 3rd party plugins available for download

API

  • REST API

Reference:

Features:
http://www.atlassian.com/software/bamboo/features/
Bamboo: getting Started
http://confluence.atlassian.com/display/BAMBOO/Bamboo+101
Forum
http://forums.atlassian.com
Plugins
https://plugins.atlassian.com/search/by/bamboo
http://confluence.atlassian.com/display/BAMBOO/Bamboo+Plugin+Guide
Jira and Bamboo
http://www.atlassian.com/better-together/progress_report.jsp

Tagged : / / / / / / / / / / / / / / / / / / / / / /

ANT Builds and Subversion (SVN) | Ant integration with Subversion guide

ant-builds-and-subversion

As I have mentioned in a previous blog entry, I have come to love using ANT in my development environment. One of the things that I like about it is how well it integrates with my Subversion repository using SVNAnt. If you are not using either ANT or Subversion, you owe it to yourself and your team to check it out.

Here we’ll go over a simple build script that exports application files from the Subversion repository into a local folder in the CFEclipse project. You can then view the following entry on how to ftp that into your production/staging server.
First we need to make sure that your ANT install has the necessary SVNAnt jar files. You can download them here: http://subclipse.tigris.org/svnant.html. Once you unpack the svnant-1.0.0.zip file, you’ll find three jar files: svnant.jar, svnClientAdapter.jar, svnjavahl.jar. Place them on your
[ANTInstall]/lib* folder.

Once you have the jar files in place, you can define them in your build file’s property section like so:
<!– svnant lib –>
<property name=”svnant.lib” value=”lib” />
<property name=”svnant.jar” value=”${svnant.lib}/svnant.jar” />
<property name=”svnClientAdapter.jar” value=”${svnant.lib}/svnClientAdapter.jar” />
<property name=”svnjavahl.jar” value=”${svnant.lib}/svnjavahl.jar” />
Followed by this path definition after all your properties have been defined:

<!– path to the svnant libraries. Usually they will be located in ANT_HOME/lib –>
<path id=”project.classpath”>
<pathelement location=”${svnjavahl.jar}” />
<pathelement location=”${svnant.jar}” />
<pathelement location=”${svnClientAdapter.jar}” />
</path>

Now all you have left to do is add the following task definition:
<!– load the svn task –>
<taskdef resource=”svntask.properties” classpathref=”project.classpath”/>

Now you are all set! You can now call tasks like the following export target:

<!– define properties –>
<!– svn repo url –>
<property name=”svn.url” value=”http://[mysvnhost]/svn/repo/myprojectFiles/” />
<property name=”svn.exportPath” value=”[yourDirectory]:\\[pathToYourCFEclipseProject\\build” />

<target name=”svn.export”>
<echo message=”Exporting application files from svn repository:” />
<input message=”Please enter svn repo username:” addproperty=”svn.username” />
<input message=”Please enter svn repo password:” addproperty=”svn.password” />
<mkdir dir=”${svn.destPath}” />
<svn username=”${svn.username}” password=”${svn.password}”>
<export srcUrl=”${svn.url}” destPath=”${svn.exportPath}” revision=”HEAD” />
</svn>
<echo message=” … finished exporting files.” />
</target>

That’s it. No more running command line tasks to get your subversion commands. For additional info and other SVN tasks you can go to http://subclipse.tigris.org/svnant/svn.html

Tagged : / / / / / / / / / / / / / / / / / / /

How to Use SVN Tasks with ANT ?

svn-tasks-with-ant

This post is about using ANT to perform some of the most common source-control related tasks such as export, tagging, and branching. I am using ANT version 1.7.0 and SVN Ant version 1.1-rc3, bound against Subversion 1.4.0.

The related software can be downloaded here:
1.    SVN Ant = http://subclipse.tigris.org/svnant.html
2.    ANT = http://ant.apache.org/
I shall start with build.properties, which lists a few key/value pairs used in our SVN Ant task build file, referred as svn-tasks.xml:

Content of build.properties:
####START of SVN Properties ####
svn.repository.url=http://xyz.com/repos/somereponame
svn.project.base.path=someprojectname
svn.username=user name to access repo
svn.password=password to access repo
#This shall be name of the tag,
#This property should always be updated before build starts
#This property shall be used to export
tag.name=SOME_TAG_NAME_12222008
#This shall be name of new branch,
#this property should be used only when new branch is to be created
new.branch.name=NEW_BRANCH_12222008
####END of SVN Properties ####
Content of svn-tasks.xml:
<property file=”build.properties”></property>

<!– SVN and SVN-ANT Tasks properties –>
<property name=”svn.repository.url” value=”${svn.repository.url}”/>
<property name=”svn.project.base.path” value=”${svn.project.base.path}” />
<property name=”svn.base.url” value=”${svn.repository.url}/${svn.project.base.path}”/>
<property name=”svnant.lib.dir” location=”svn-ant-lib”/>
<property name=”svnant.javahl” value=”false” />
<property name=”svnant.svnkit” value=”true” />
<!– SVN and SVN-ANT Tasks properties –>

<!– *************************************************************** –>
<!–   Set-Up of SVN-ANT classpath                                   –>
<!– *************************************************************** –>
<path id=”svnant.classpath”>
<fileset dir=”${svnant.lib.dir}”>
<include name=”**/*.jar” />
</fileset>
</path>

<!– *************************************************************** –>
<!–   Loading of SVN task                                           –>
<!– *************************************************************** –>
<typedef resource=”org/tigris/subversion/svnant/svnantlib.xml” classpathref=”svnant.classpath” />

<!– *************************************************************** –>
<!– tool-availability: Determine if SVN-ANT is available.           –>
<!– *************************************************************** –>
<target name=”tool-availability”>
<available resource=”org/tigris/subversion/svnant/svnantlib.xml”
classpathref=”svnant.classpath”
property=”available.svnant”
/>
<echo message=”SVN-ANT is available = ${available.svnant}”/>
</target>

<!– **************************************************************** –>
<!– does-svnant-exist: depends on tool-availablility and     –>
<!–                    displays error message                                   –>
<!– ***************************************************************** –>
<target name=”does-svnant-exist” depends=”tool-availability”>
<fail unless=”available.svnant”>
SVN-ANT is not available, cannot perform tagging or checkout/export svn ant task.
</fail>
</target>

<!– ****************************************************************** –>
<!– svntag: performs tagging using properties from                              –>
<!–         build.properties and uses SVNANT tasks                              –>
<!– ******************************************************************* –>
<target name=”svntag” description=”tags individual project using svnant task”>
<property name=”svn.tag.message” value=”Tagging Project ${project.name} with tag name ${tag.name} from trunk “/>
<property name=”src.url”  value=”${svn.base.url}/${project.name}/trunk/”/>
<property name=”dest.url” value=”${svn.base.url}/${project.name}/tags/${tag.name}”/>

<echo message=”${svn.tag.message}”/>
<echo message=”${src.url}”/>
<echo message=”${dest.url}”/>

<svn javahl=”${svnant.javahl}” svnkit=”${svnant.svnkit}” username=”${svn.username}” password=”${svn.password}”>
<copy srcUrl=”${src.url}” destUrl=”${dest.url}” message=”${svn.tag.message}”/>
</svn>
</target>

<!– ****************************************************************** –>
<!– svnexport: performs export using properties from                            –>
<!–            build.properties and uses SVNANT tasks                           –>
<!– ****************************************************************** –>
<target name=”svnexport” description=”exports individual project using svnant task”>
<property name=”svn.tag.message” value=”Exporting Project ${project.name} with tag name ${tag.name}”/>
<property name=”src.url”  value=”${svn.base.url}/${project.name}/tags/${tag.name}”/>
<property name=”destPath” value=”${dest.path}”/>
<echo message=”${svn.tag.message}”/>
<svn javahl=”${svnant.javahl}” svnkit=”${svnant.svnkit}” username=”${svn.username}” password=”${svn.password}”>
<export srcUrl=”${src.url}” destPath=”${destPath}/${project.name}”/>
</svn>
</target>

<!– ****************************************************************** –>
<!– svnbranch: creates a new branch using properties from                       –>
<!–            build.properties and uses SVNANT tasks                           –>
<!– ****************************************************************** –>
<target name=”svnbranch” description=”creates a new branch for individual project using svnant task”>

<property name=”svn.branch.message” value=”Creating new branch for
Project ${project.name} with new branch name ${new.branch.name} from
trunk”/>
<property name=”src.url”  value=”${svn.base.url}/${project.name}/trunk/”/>
<property name=”dest.url” value=”${svn.base.url}/${project.name}/branches/${new.branch.name}”/>

<echo message=”${svn.branch.message}”/>
<echo message=”${src.url}”/>
<echo message=”${dest.url}”/>

<svn javahl=”${svnant.javahl}” svnkit=”${svnant.svnkit}”
username=”${svn.username}” password=”${svn.password}”>
<copy srcUrl=”${src.url}” destUrl=”${dest.url}” message=”${svn.branch.message}”/>
</svn>
</target>

Link: http://java.dzone.com/articles/how-use-svn-tasks-with-ant

Tagged : / / / / / / / / / / / / / / / / /