Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial carries continues on from the previous tutorials Part 1: Create your First ProjectPart 2: Create your First Configuration and  Part 3: Create your First Repository and it is recommended that these are completed before reading this tutorial.

So far we have created a project, attached a configuration and created a repository, however we still cannot run a build! Fear not, by the end of this tutorial you will have be ready to run your first build up and running.

In this tutorial we will be creating an a Visual Studio action that will build our Fluent NHibernate source repository using Visual Studio. This tutorial assumes you have Visual Studio installed on your server.

...

Go ahead and try running a build. The easiest way to run a build is by using the Quick Build button (Fast forward icon) on the configuration tile. The quick build action will run a build with the default actions parameters passed into the build process.

Once the build has been run, it will turn red, as seen shown below. The reason the build failed is that there are no actions for the build to complete. Well this is easily fixed by adding some actions to the Configuration Workflow in the Configuration Wizard. Click the Edit Configuration button (Edit pencil icon) on the configuration tile to enter the Configuration Wizard then click 4 Stagesnavigate to the Stages section of the Configuration Wizard.

Stages & Workflow Editor

Welcome to the Stage & Workflow Editor. This is where you define the individual actions that will be executed run when a build is runexecuted. For more detailed information on working with workflows, check out the Managing Stages section.

...

Continua CI creates a default 'Build' Stage when a new configuration is created and this stage can be seen is displayed near the top of the page in the Stage Editor. Each stage is represented as a blue chevron and is accompanied by a stage gate, which is represented as a box with a triangle missingcut out. Stages can be used as a way to break a complex build process into smaller, logical pieces. For example, your build may consist of a build stage, a test stage and a deployment stage. For this tutorial however the default 'Build' stage will be all we need.

...

Actions are the individual build steps that are executed when a build is run. These actions range from running a batch file to running a build runner and executing unit tests. All actions are defined and controlled through the bottom section of the stages page. On the left you can find all the available actions and to the right is the Workflow Editor where the action execution order is defined.

...

Selecting an action will bring up the action dialog where you can set all the properties for your Visual Studio action. In this tutorial we will need to point this action to the Fluent NHibernate Visual Studio .sln file, so lets set the Project File property to $Source.Fluent_Nhibernate$/src/FluentNHibernate.sln. Continua CI supports Variables, Objects & Expressions which we are using in this field to point to our repository. You can see that we are using $Source.Fluent_Nhibernate$ to point to our repository rather then providing a concrete file path. This is done so that you do not need to worry about where repositories are located as Continua CI looks after all repository management for you. So lets breakdown what is happening when we define our project file to point to $Sourceas $Source.Fluent_Nhibernate$/src/FluentNHibernate.sln.

...

For this tutorial we only need to set the project file, make sure set the action is to enabled and set the Using property to whichever Visual Studio version that is installed on the server.

...