GO Examples for MSBuild - reducing the angle bracket tax

Follow

Comments

2 comments

  • Avatar
    Ian Bridson

    Hi Greg


    We use MSBuild for our .Net code, so here our the pipeline and pipeline template for our Build pipeline:


    <pipeline name="PhoenixdotNET_Pipe2" labeltemplate="345.4.5.${COUNT}" isLocked="false" template="dotNET_build">
      <trackingtool link="http://mingle/projects/phoenix/cards/${ID}" regex="#(\d+)" />
      <environmentvariables>
        <variable name="SVN_SOURCE_URL">svn://pclsrcphxpco/Phoenix Application/Branches/Phases/Phase_3_4/Branch_345_X</variable>
        <variable name="SVN_TAG_BASE_URL">svn://pclsrcphxpco/Phoenix Application/Tags/Phases/Phase_3_4</variable>
        <variable name="SVN_TAG_NAME_PREFIX">Branch</variable>
        <variable name="Web_Project_name">PCL.Phoenix.Web.UI</variable>
        <variable name="Services_Project_name">PCL.Services.Web</variable>
      </environmentvariables>
      <materials>
        <svn url="svn://source/Phoenix Application/Branches/Phases/Phase_3_4/Branch_345_X/PCL.Services" username="Build" password="password" dest="wcf/source" />
        <svn url="svn://source/Phoenix Application/Branches/Phases/Phase_3_4/Branch_345_X/PCL.Phoenix.Web" username="Build" password="password" dest="web/source" />
      </materials>
    </pipeline>


    Pipeline Template - dotNET_build


    <pipeline name="dotNET_build">
      <stage name="build">
        <approval type="manual" />
        <jobs>
          <job name="buildWCFJob">
            <tasks>
              <exec command="PCL.Utils.VersionUpdater.exe" args="%GO_PIPELINE_LABEL%" workingdir="wcf/source/References/Executables" />
              <exec command="PCL.Utils.VersionUpdater.exe" args="%GO_PIPELINE_LABEL%" workingdir="web/source/References/Executables" />
              <exec command="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" args="..\MSBuild\WCF.MsBuild.xml" />
              <exec command="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" args="..\MSBuild\Web.MsBuild.xml" />
              <exec command="svn" args="commit -m '[PCLGO Build Server] - Updated PCL.Services version to %GO_PIPELINE_LABEL% following successful build' wcf/source" />
              <exec command="svn" args="commit -m '[PCLGO Build Server] - Updated PCL.Phoenix.Web version to %GO_PIPELINE_LABEL% following successful build' web/source" />
              <exec command="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" args="..\MSBuild\Tag.MsBuild.xml" />
            </tasks>
            <artifacts>
              <artifact src="wcf/release/*" dest="wcfrelease" />
              <artifact src="web/release/*" dest="webrelease" />
            </artifacts>
          </job>
        </jobs>
      </stage>
    </pipeline>


    The VersionUpdater updates file versions using the Go label_template  variable, then the WCF and Web code gets built, and tagged in svn. the Release files are put in 2 artifacts called wcfrelease and webrelease ( as we have n-tier the app servers fetchartifact wcfreelase and the web servers fetch webrelease.


    The msbuild files refer to the Go environment variables defined in the pipeline, plus the standard Go variables, as we have multiple projects and Continuous Integration utilising the same dotNet_build template.

  • Avatar
    Greg

    this is soo, soo great!!


    owe you one Ian.

Please sign in to leave a comment.