Navigation:  Commands and Procedures > Automated Builds >

Continous Integration

Previous pageReturn to chapter overviewNext page

Within Visual Build

 

The ContinuousIntegration.bld sample shows how to implement continuous integration builds (automatic builds whenever source code changes are submitted to source control) with Visual Build.

 

 

BuildBot

 

Continuous integration can be implemented via BuildBot by invoking the Visual Build command-line interface.  In BuildBot, add a ShellCommand like this:

 

from buildbot.plugins import steps

 

f.addStep(steps.ShellCommand(command=["C:\Program Files\VisBuildPro9\VisBuildCmd.exe", "/b", "ProjectFile.bld"]))

 

 

Jenkins/Hudson

 

Continuous integration can be performed via Jenkins/Hudson by invoking the Visual Build command-line interface.

 

1.In Jenkins/Hudson, create a new job to Build a free-style software project.
2.Add a build step of Execute Windows batch command with a command like:

"C:\Program Files\VisBuildPro9\VisBuildCmd.exe" /b "C:\Program Files\VisBuildPro9\Samples\RegEdit.bld"

 

 

TeamCity

 

Continuous integration can be implemented via TeamCity by invoking the Visual Build command-line interface.

 

1.In TeamCity, create a new project.
2.Create a new build configuration with a Runner Type of Command Line, a Working directory of the path to the .bld file, a Command executable of C:\Program Files\VisBuildPro9\VisBuildCmd.exe, and Command parameters of /b ProjectFile.bld.

 

 

Team Foundation Build

 

Visual Build projects can also be called from Team Foundation Build by invoking the Visual Build command-line interface from an MSBuild Exec task (2008 and earlier).  Add code like this to the end of the TFSBuild.proj file (see this article for more details on modifying and running the Team Build build definition):

 

</ItemGroup>

 <Target Name="AfterCompile">

   <Exec Command='"C:\Program Files\VisBuildPro9\VisBuildCmd" /b "$(SolutionRoot)\MyProject.bld"'/>

 </Target>

</Project>

 

In addition to the AfterCompile target, several additional targets are available for specifying when Visual Build should be called.  And the BeforeBuild and AfterBuild targets can also be used from regular Visual Studio projects (outside of Team Foundation Build).

 

For Visual Studio 2010 and later, use the InvokeProcess activity (FileName -> %ProgramFiles%\VisBuildPro9\VisBuildCmd, Arguments -> /b "$(SolutionRoot)\MyProject.bld").

 

 

CruiseControl .NET

 

Continuous integration can be implemented via CruiseControl .NET by invoking the Visual Build command-line interface from an Executable task in the CCNet.config file.  For example:

 

<cruisecontrol>

  <project>

     <name>Sample</name>

     <triggers />

     <tasks>

        <exec>

          <executable>C:\Program Files\VisBuildPro9\VisBuildCmd.exe</executable>

          <baseDirectory>C:\Program Files\VisBuildPro9\Samples</baseDirectory>

          <buildArgs>/b RegEdit.bld</buildArgs>

          <buildTimeoutSeconds>1000</buildTimeoutSeconds>

      </exec>

    </tasks>

  </project>

</cruisecontrol>