I'm trying to get CruiseControl.Net working with MSBuild (this is my first exposure to CruiseControl.Net). I thought I'd done the configuration correctly, however I just get the following error message when starting up:
[cc]Jun-22 20:02:55 Main - error setting config file on controller
net.sourceforge.cruisecontrol.CruiseControlException: error configuring project MyProject
at *SNIP*
Caused by: net.sourceforge.cruisecontrol.CruiseControlException: Unknown plugin for: <msbuild>
at *SNIP*
[cc]Jun-22 20:02:55 Main - error configuring project MyProject
As far as I can work out, this would appear to indicate that I'm missing the MSBuild plugin, however all documentation that I can find indicates that the MSBuild plugin has been included with CruiseControl.Net since version 1.0
I'm using the latest binary release (v 2.8.3)
Here is my config xml:
<project name="MyProject">
<listeners>
<currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
</listeners>
<bootstrappers></bootstrappers>
<modificationset quietperiod="10">
<filesystem folder="C:\snip\main"/>
</modificationset>
<schedule interval="60">
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<workingDirectory>C:\snip\main</workingDirectory>
<projectFile>MyProject.sln</projectFile>
<buildArgs>/p:Configuration=Debug /v:diag</buildArgs>
<targets>Build;Test</targets>
<timeout>900</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</schedule>
<log />
<publishers />
</project>
Any advice on how I can troubleshoot this would be much appreciated.
Aggg - it appears that I have unwittingly downloaded CruiseControl, instead of CruiseControl.Net (and to make things even more confusing I was looking at CruiseControl.Net documentation)
Related
Problem Context:
We initially created a MFP hybrid project with the iOS environment using MFP Studio plugin for Eclipse. We have this project under source control (Git on DevOps). Some team members in our team are doing iOS development for this project and since they are not familiar with Eclipse, they are wanting to use the CLI instead. Other developers in the same team will continue to use Studio since they are writing Java code for the MFP adapters and want to leverage the capabilities Eclipse provides such as compilation, code auto-completion, etc.
Problem:
After pulling down the MFP project code from Git (fresh pull), if Studio is first used to “Build All Environments” and “Run on MobileFirst Platform”, we can then run the MFP app without any problems. We can then also switch to the CLI for building and deploying artifacts and the CLI commands work just fine.
Now, say that after pulling down the code from Git (fresh pull), instead of using Studio, we start using right away the CLI for building and deploying artifacts. Under such scenario, the CLI throws errors. It seems that the CLI is missing steps that Studio knows how to do. The errors we get when using the CLI right away for building and deploying (mfp bd) after a fresh pull from Git are the following:
$ mfp bd
All apps and adapters were successfully built.
Initializing MobileFirst Console.
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:147: Compile failed; see the compiler error output for details.
Total time: 1 second
Error: Build process failed. Please check the stack above for details.
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:380: Element <project> inside <configureApplicationServer>: File '/Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp/bin/HatchReadyApp.war' does not exist.
Total time: 1 second
Error: Build process failed. Please check the stack above for details.
objc[81801]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Starting server worklight.
Server worklight started with process ID 81800.
[wladm] Unexpected response from http://192.168.1.126:10080/worklightadmin/management-apis/1.0/runtimes/HatchReadyApp/adapters?locale=en_US:
[wladm] <?xml version="1.0" encoding="UTF-8"?>
[wladm] <deploy-adapter-result ok="false" productVersion="6.3.0.00-20150214-1702">
[wladm] <transaction id="168" type="UPLOAD_ADAPTER" status="FAILURE" timeCreated="2015-04-13T13:53:18.599Z" timeUpdated="2015-04-13T13:53:18.870Z" userName="admin" appServerId="Liberty">
[wladm] <project name="HatchReadyApp"/>
[wladm] <description filename="SBBAdapter.adapter" name="SBBAdapter" alreadyDeployed="false"/>
[wladm] <errors>
[wladm] <error mbeanName="com.worklight.common.server.jmx.api:qualifier=HatchReadyApp,type=ProjectManagement" date="2015-04-13T13:53:18.831Z" phase="PREPARE" code="FAILURE" exception="RuntimeException" details="Runtime synchronization failed. Cannot deploy adapter to runtime"/>
[wladm] </errors>
[wladm] <warnings/>
[wladm] </transaction>
[wladm] </deploy-adapter-result>
Error: The MobileFirst server that you have configured does not appear to be running. Start the server with 'mobilefirst start'.
More details:
If I start the MFP server first before doing a 'mfp bd', it also fails with a similar error:
$ mfp start
Initializing MobileFirst Console.
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:147: Compile failed; see the compiler error output for details.
Total time: 1 second
Error: Build process failed. Please check the stack above for details.
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:380: Element <project> inside <configureApplicationServer>: File '/Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp/bin/HatchReadyApp.war' does not exist.
Total time: 1 second
Error: Build process failed. Please check the stack above for details.
objc[55444]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Starting server worklight.
Server worklight started with process ID 55443.
MFP info output:
$ mfp info
OS: darwin x64
Release: 14.1.0
System Memory: 89MB free out of 16384MB
Node: v0.10.30
MobileFirst CLI: 6.3.0.00.20150214-1708
Current directory: /Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp
Current project: /Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp
Adapter: getOffers (/Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp/adapters/SBBAdapter/SBBAdapter.xml)
Description: SBBAdapter
Type: http
Procedures: test, getUser, getAccounts, getTransactions, getGoals, getDashboardData, getFeasibility, submitAuthentication, getTradeoffSolution, getOffers
Application: Hatch (/Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp/apps/Hatch/application-descriptor.xml)
Description: Hatch
Type: hybrid application
Features:
Environments: iphone
Skins:
Server location: /Users/olivieri/.ibm/mobilefirst/6.3.0/server
Server binary: /Users/olivieri/.ibm/mobilefirst/6.3.0/server/wlp/bin/server
MobileFirst instance: /Users/olivieri/.ibm/mobilefirst/6.3.0/server/wlp/usr/servers/worklight
objc[85669]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
WebSphere Application Server 8.5.5.3 (1.0.6.cl50320140731-0257) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_51-b13 (en_US)
Environment variables:
TERM_PROGRAM: Apple_Terminal
ANDROID_HOME: /Users/olivieri/android-sdks
SHELL: /bin/bash
TERM: xterm-256color
TMPDIR: /var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/
Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.JKtd63AtGc/Render
TERM_PROGRAM_VERSION: 343.6
TERM_SESSION_ID: D5FA1866-C7B1-4AC0-A045-B8BD0AF18A5D
ANT_HOME: /Users/olivieri/Development/apache-ant-1.9.4
USER: olivieri
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.ECR6tzx7Xe/Listeners
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0
PATH: /Users/olivieri/Development/apache-ant-1.9.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/IBM/MobileFirst-CLI:/Users/olivieri/Development/gradle-1.12/bin:/Users/olivieri/android-sdks/tools:/Users/olivieri/android-sdks/platform-tools
PWD: /Users/olivieri/git/Ready.App.3.Hatch/HatchReadyApp
LANG: en_US.UTF-8
XPC_FLAGS: 0x0
XPC_SERVICE_NAME: 0
SHLVL: 2
HOME: /Users/olivieri
LOGNAME: olivieri
DISPLAY: /private/tmp/com.apple.launchd.8nfQqEAeMS/org.macosforge.xquartz:0
_: /Applications/IBM/MobileFirst-CLI/IBMnode/bin/node
WLP_USER_DIR: /Users/olivieri/.ibm/mobilefirst/6.3.0/server/wlp/usr
Thanks to the IBM folks who helped us resolve this problem. To fix this issue, we had to make two changes to the following file: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
We replaced the following two sections [in this file] as shown below:
1)
<!--
<path id="server-classpath">
<fileset dir="${worklight.jars.dir}" includes="worklight-jee-library.jar" />
<fileset dir="${worklight.server.install.dir}/wlp/dev" includes="**/*.jar" />
</path>
-->
<path id="server-classpath">
<fileset dir="${worklight.jars.dir}" includes="worklight-jee-library.jar" />
<fileset dir="${worklight.server.install.dir}/wlp/dev" includes="**/*.jar" />
<!-- add server/lib folder to classpath -->
<fileset dir="${worklight.app.dir}/../server/lib" includes="**/*.jar" />
</path>
2)
<!--
<target name="build-WAR" description="Build worklight WAR for project">
<echo message="Building worklight WAR for project ${ProjectName}" />
<javac
srcdir="server/java"
destdir="bin/classes"
classpathref="server-classpath"
verbose="true"
includeantruntime="false"
/>
<war-builder
projectfolder="${basedir}"
destinationfolder="bin/war"
warfile="bin/${ProjectName}.war"
classesfolder="bin/classes">
</war-builder>
</target>
-->
<target name="build-WAR" description="Build worklight WAR for project">
<echo message="Building worklight WAR for project ${ProjectName}" />
<!-- first clear out the existing bin/classes contents -->
<delete includeemptydirs="true">
<fileset dir="bin/classes" includes="**/*"/>
</delete>
<javac
srcdir="server/java"
destdir="bin/classes"
classpathref="server-classpath"
verbose="true"
includeantruntime="false"
/>
<if>
<available file="server/java/resources" />
<then>
<!-- now copy the contents of server/java/resources into bin/classes so they get included in the war -->
<copy todir="bin/classes/resources" failonerror="false">
<fileset dir="server/java/resources"/>
</copy>
</then>
</if>
<war-builder
projectfolder="${basedir}"
destinationfolder="bin/war"
warfile="bin/${ProjectName}.war"
classesfolder="bin/classes">
</war-builder>
</target>
After making the above changes, we could then run the 'mfp restart' and 'mfp bd' commands without any errors.
I'm pretty new to build servers but have been asked by my employer to do some testing (because F5 is not a build process, as the excellent article by Jeff Atwood says). At this stage, I'm working on getting some sample builds and test reports up and running on a CruiseControl.NET server. So far, I've gotten a build up and running (the configuration file will need some tidying up before adding new builds/projects but the proof of concept is there) but the reporting is causing something of a headache.
The main report I'm looking for is for out NUnit tests and SpecFlow integration tests. The tests run fine (as I'm getting a sensible looking xml file generated) and am looking to merge that in to the main build results so that I can show the results of the NUnit/SpecFlowtests.
Whenever the build completes, the following is reported in the messages (in ViewFarmReport.aspx): "Failing Tasks : XmlLogPublisher "
This combined with the following error reported in the Windows application log (source - CC.Net)
2015-03-24 08:36:52,987 [Initech.SuperCrm-DEV] ERROR CruiseControl.NET [(null)] - Publisher threw exception: ThoughtWorks.CruiseControl.Core.CruiseControlException: Unable to read the contents of the file: C:\CCNet\BuildArtifacts\Initech.SuperCrm-DEV\msbuild-results-7c657954-2c3e-405f-b0f1-7da1299788fd.xml ---> System.IO.FileNotFoundException: Could not find file 'C:\CCNet\BuildArtifacts\Initech.SuperCrm-DEV\msbuild-results-7c657954-2c3e-405f-b0f1-7da1299788fd.xml'.
(company/application name "censored")
This leads me to suspect that the failure to merge in the msbuild results (which I believe CruiseControl.NET automatically scrapes since version... 1.5 or 1.6?) is preventing the NUnit results from being merged in.
There is no msbuild-results file in the BuildArtifacts folder, which does not surprise me as I do not believe my current msbuild configuration allows for xml based logging as I am using the ThoughtWorks.CruiseControl.MsBuild.dll logger.
According to the online documentation for CruiseControl.NET there is XML enabled custom logger: ThoughtWorks.CruiseControl.MsBuild.XmlLogger which can be used, however the download location for this logger: here
appears not to exist any more.
Can anyone say whether I'm thinking along the right lines here and what my options are?
For reference, here is my complete configuration:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define MSBuildPath="C:\Windows\Microsoft.NET\Framework\v4.0.30319" />
<cb:define WorkingBaseDir="C:\CCNet\Builds" />
<cb:define ArtifactBaseDir="C:\CCNet\BuildArtifacts" />
<cb:define MSBuildLogger="C:\Program Files (x86)\CruiseControl.NET\server
\ThoughtWorks.CruiseControl.MsBuild.dll" />
<cb:define NUnitExe="C:\Jenkins\Nunit\nunit-console.exe" />
<cb:define name="vsts_ci">
<executable>C:\Jenkins\tf.exe</executable>
<server>http://tfs-srv:8080/tfs/LEEDS/</server>
<domain>CONTOSO</domain>
<autoGetSource>true</autoGetSource>
<cleanCopy>true</cleanCopy>
<force>true</force>
<deleteWorkspace>true</deleteWorkspace>
</cb:define>
<project name="Initech.Libraries" description="Shared libraries used in all Initech projects"
queue="Q1">
<state type="state" directory="C:\CCNet\State"/>
<artifactDirectory>$(ArtifactBaseDir)\Initech.Libraries</artifactDirectory>
<workingDirectory>$(WorkingBaseDir)\Initech.Libraries</workingDirectory>
<triggers>
<intervalTrigger
name="continuous"
seconds="30"
buildCondition="IfModificationExists"
initialSeconds="5"/>
</triggers>
<sourcecontrol type="vsts">
<cb:vsts_ci/>
<workspace>CCNET_Initech.Libraries</workspace>
<project>$/InitechLibraries/Initech.Libraries</project>
</sourcecontrol>
</project>
<project name="Initech.SuperCrm-DEV" description="Initech.SuperCrm Application, Development
Version" queue="Q1">
<cb:define ArtifactDirectory="$(ArtifactBaseDir)\Initech.SuperCrm-DEV" />
<cb:define WorkingDirectory="$(WorkingBaseDir)\Initech.SuperCrm-DEV" />
<cb:define OutputDirectory="$(WorkingDirectory)\Initech.SuperCrm\bin\Debug" />
<cb:define ProjectFile="Initech.SuperCrm.sln" />
<cb:define NUnitLog="$(WorkingDirectory)\NunitResults.xml" />
<state type="state" directory="C:\CCNet\State"/>
<artifactDirectory>$(ArtifactDirectory)</artifactDirectory>
<workingDirectory>$(WorkingDirectory)</workingDirectory>
<triggers>
<!-- check the source control every X time for changes,
and run the tasks if changes are found -->
<intervalTrigger
name="continuous"
seconds="30"
buildCondition="IfModificationExists"
initialSeconds="5"/>
</triggers>
<sourcecontrol type="vsts">
<cb:vsts_ci/>
<workspace>CCNET_Initech.SuperCrm-DEV</workspace>
<project>$/InitechSuperCrm/SuperCrm/Initech.SuperCrm-DEV</project>
</sourcecontrol>
<tasks>
<exec>
<executable>C:\Program Files (x86)\DXperience 12.1\Tools\DXperience
\ProjectConverter-console.exe</executable>
<buildArgs>$(WorkingDirectory)</buildArgs>
</exec>
<msbuild>
<executable>$(MSBuildPath)\MSBuild.exe</executable>
<workingDirectory>$(WorkingDirectory)</workingDirectory>
<projectFile>$(ProjectFile)</projectFile>
<timeout>900</timeout>
<logger>$(MSBuildLogger)</logger>
</msbuild>
<exec>
<executable>$(NUnitExe)</executable>
<buildArgs>/xml=$(NUnitLog) /nologo $(WorkingDirectory)\$(ProjectFile)
</buildArgs>
</exec>
</tasks>
<publishers>
<buildpublisher>
<sourceDir>$(OutputDirectory)</sourceDir>
<useLabelSubDirectory>true</useLabelSubDirectory>
<alwaysPublish>false</alwaysPublish>
<cleanPublishDirPriorToCopy>true</cleanPublishDirPriorToCopy>
</buildpublisher>
<merge>
<files>
<file>$(NUnitLog)</file>
</files>
</merge>
<xmllogger logDir="C:\CCNet\BuildArtifacts\Initech.SuperCrm-DEV\buildlogs" />
<artifactcleanup cleanUpMethod="KeepLastXBuilds"
cleanUpValue="50" />
</publishers>
</project>
</cruisecontrol>
I've been tearing my hair while trying to figure this out, and I don't have much to begin with, so any help would be greatly appreciated.
After a prolonged period of banging my head against the wall, I seem to have finally found the solution (well solutions).
1) Kobush.Build.dll (https://www.nuget.org/packages/Kobush.Build/) can be used as the logger for MSBuild. Looking at the attributions in CruiseControl.NET's documentation, it appears to have been written by the same developer (but extended).
2) Some tweaks were needed due to the default location of the msbuild-report output. Because, by default, it was dumped to the buildartifacts folder then it is susceptible to being prematurely deleted.
I no longer clean the publish directory prior to copying (in the buildpublisher) and perform the merge and xmllogger portions of the publisher before artifact cleanup.
As a result, I now have msbuild and nunit output/results integrated in to the main build log and these can be consumed through the CruiseControl.NET dashboard.
There's probably a tidier way of handling this, but at the moment I'm just getting a proof of concept going.
I am having issues understanding Cruise Control.
I would like to create a build automation in order to perform the build in my project. To do that I created the following entry in the ccnet.config file
<project name="My Web Release " description="Web config">
<workingDirectory>d:\GIT</workingDirectory>
<triggers/>
<sourcecontrol type="git">
<repository>GIT REPO</repository>
<branch>release-name</branch>
<autoGetSource>true</autoGetSource>
<fetchSubmodules>true</fetchSubmodules>
<executable>C:\Program Files (x86)\Git\cmd\git.exe</executable>
<tagOnSuccess>false</tagOnSuccess>
<commitBuildModifications>false</commitBuildModifications>
<commitUntrackedFiles>false</commitUntrackedFiles>
<tagCommitMessage> Build {0}</tagCommitMessage>
<tagNameFormat>Build-{0}</tagNameFormat>
<committerName>Build</committerName>
<committerEMail>build#build.com</committerEMail>
<workingDirectory>$(workingDirectory)\Sources\WEB</workingDirectory>
<timeout>600000</timeout>
</sourcecontrol>
<tasks>
<msbuild>
<executable>c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<buildFile>BuildScript.xml</buildFile>
<targets>NewBuild</targets>
<logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>
<publishers>
<xmllogger />
<artifactcleanup cleanUpMethod="KeepLastXBuilds" cleanUpValue="50" />
</publishers>
</project>
And I do have a BuildScript.xml file.
My question is:
Is this a nAnt or MSBUILD script?
I am asking because I am trying to follow the documentation but I get a lot of issues regarding unknown tasks and so on.
For instance, this:
<property name="configuration" value="CLOSED" />
Would generate a unknown "property" task.
I am looking at MSBuild documentation to use a Move task.
and I got to this line:
<move file="originPath" tofile="TargetPath"/>
But I get:
BuildScript.xml(18,3): error MSB4036: The "Move" task was not
found. C heck the following: 1.) The name of the task in the project
file is the same as the name of the task class. 2.) The task class is
"public" and implements the Microsoft.Build.Framework.ITask interface.
3.) The task is correctly declared w ith in the project file, or in the *.tasks files located in the "C:
\Windows\Microsoft.NET\Framework\v2.0.50727" directory.
What is driving me crazy is that it was working before we migrated to Cruise Control.
Is this being interpreted as nAnt or MSBuild? Any ideas on why I am getting these errors?
It looks like your mixing nant and msbuild, if it was msbuild it would look like
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Tools="4.0">
<Target Name="Move">
<PropertyGroup>
<configuration>CLOSED</configuration>
</PropertyGroup>
<Move SourceFiles="Somefilefile" DestinationFolder="c:\temp"/>
</Target>
</Project>
So casing was an issue and that you need to specify the tools version as move is available from 4.0.
For background: I've got quite a nice TeamCity setup; containing a ci build and a release build which uses WiX to build my installers and patch all the version numbers. When I do a new release build, I'd like to automatically create MSP patches against a previous set of installers. I'm thinking either tagged RTM in TeamCity, or as a list of version numbers.
The approach I'm leaning towards is creating a separate config and getting the msi artifacts of all the previous builds that fit the criteria (tag or version number). Tag would seem a lot neater, but I can't see anything in the documentation about how you use it?
I've got a script to build the MSP patch, but it relies on a PCP file which needs to be edited in ORCA to describe the patch.
In terms of editing the PCP, is there anything else I can use other than the ORCA to edit? I've been looking at moving to the WiX method here: http://wix.sourceforge.net/manual-wix3/patch_building.htm which looks promising.
Does anyone know if you can access artifacts in TeamCity by Tag in the same or another build?
Does anyone have any other insights into automatically building/chaining MSP patch files in TeamCity?
You can build the .PCP file using the PatchCreation element in the WiX toolset. That will probably give you the necessary flexiblity necessary to create the customized .PCP files.
Sorry, don't use TeamCity.
Sorry, don't use TeamCity. :)
To add to Rob's answer:
#2. TeamCity can retrieve items by tag:
http://servername:8080/httpAuth/app/rest/buildTypes/id:bt13/builds?status=SUCCESS&tag=RTM
#3. I used the PatchCreation element (Rob suggested above) in the WiX toolset and he's right its flexible enough for this. Here is an outline of what I've built, it all seems to work quite well in testing,
The teamcity project has a number of build parameters, they are:
New version number - default as changeme, so if its not been changed it breaks the build.
Old version number - as above
New build repo - this is the buildtypeid, look at querystring for your project and it will have buildTypeId=btXX. The XX is the number that should be supplied here.
Old build repo - as above
The teamcity project has the following steps:
MSBuild runner to run build.msbuild (see below)
Run Candle on the patch.wxs to create a patch.wixobj file
Run Light on patch.wixobj to create a patch.pcp
Unpack new version (command: msiexec /q /a new.msi) -
Unpack old version (command: msiexec /q /a old.msi) - choose a different working dir
Create patch (command: msimsp -s patch.pcp p hotfix-%system.msiOldVersion%-%system.msiNewVersion%.msp -l patch.log
MSBuild to Create patch.pcp
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--<Import Project="references\MSBuild.Community.Tasks.Targets"/>-->
<UsingTask AssemblyFile="references\MSBuild.Community.Tasks.dll" TaskName="WebDownload"/>
<UsingTask AssemblyFile="references\MSBuild.Community.Tasks.dll" TaskName="TemplateFile"/>
<Target Name="Build">
<!-- preconditions for build -->
<Error Condition="'$(msiOldVersion)' == 'changeme'" Text="Use run custom build, setting the client version of the msi"/>
<Error Condition="'$(msiOldVersion)' == ''" Text="Use run custom build, setting the client version of the msi"/>
<Error Condition="'$(msiNewVersion)' == 'changeme'" Text="Use run custom build, setting the new version of the msi"/>
<Error Condition="'$(msiNewVersion)' == ''" Text="Use run custom build, setting the new version of the msi"/>
<Message Text="Old Version: $(msiOldVersion)"/>
<Message Text="New version: $(msiNewVersion)"/>
<!-- download files from teamcity... -->
<WebDownload FileUri="http://server:8080/httpAuth/repository/download/bt$(msiOldRepo)/trunk/Path/bin/Release/en-us/installer-v-v.$(msiOldVersion).msi" UserName="download" Password="abcdefgh" FileName="downloads/oldversion.msi" />
<WebDownload FileUri="http://server:8080/httpAuth/repository/download/bt$(msiNewRepo)/trunk/Path/bin/Release/en-us/installer-v.$(msiNewVersion).msi" UserName="download" Password="abcdefgh" FileName="downloads/newversion.msi" />
<!-- fill in blanks in patch.wxs -->
<ItemGroup>
<Tokens Include="oldVersion">
<ReplacementValue>$(msiOldVersion)</ReplacementValue>
</Tokens>
<Tokens Include="newVersion">
<ReplacementValue>$(msiNewVersion)</ReplacementValue>
</Tokens>
</ItemGroup>
<TemplateFile Template="template.wxs" OutputFileName="patch.wxs" Tokens="#(Tokens)"/>
</Target>
Template.wxs used by MSBuild script
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<PatchCreation
Id="deadbeef-dead-beef-dead-beefdeadbeef"
CleanWorkingFolder="no"
OutputPath="patch.pcp"
WholeFilesOnly="no">
<PatchInformation
Description="Small Update Patch"
Comments="Small Update Patch"
Manufacturer="Your Manufacturer"/>
<PatchMetadata
AllowRemoval="yes"
Description="Hotfix"
ManufacturerName="Your Manufacturer"
MoreInfoURL="http://yourwebsite.com"
TargetProductName="Your Product Name"
Classification="Hotfix"
DisplayName="Hotfix - TBC"/>
<Family DiskId="5000"
MediaSrcProp="Sample"
Name="Sample"
SequenceStart="5000">
<UpgradeImage SourceFile="downloads\newunpack\newVersion.msi" Id="SampleUpgrade">
<TargetImage SourceFile="downloads\oldunpack\oldVersion.msi" Order="2"
Id="SampleTarget" IgnoreMissingFiles="no" />
</UpgradeImage>
</Family>
<PatchSequence PatchFamily="SamplePatchFamily"
Supersede="yes" />
</PatchCreation>
</Wix>
In attempting to set up a build for a demo project I am working on, I received the following exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Documents and Settings\Administrator\Local Settings\Temp\1bea7440-959c-4dd4-89ad-05dcd00e369c\ThoughtWorks.CruiseControl.MsBuild.dll'
Question: What don't I have configured correctly?
Below is my task block from my ccnet.config file:
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<workingDirectory>C:\CCWorkingDirectory\DemoApplication</workingDirectory>
<projectFile>DemoApplication.sln</projectFile>
<!--<buildArgs>/noconsolelogger /v:quiet
/p:Configuration=Debug
/p:ReferencePath="C:\Program Files\NUnit 2.4.7\bin"
</buildArgs>-->
<targets>ReBuild</targets >
<timeout>600</timeout >
<!--<logger>c:\Program Files\CruiseControl.NET\server\Rodemeyer.MsBuildToCCNet.dll</logger >-->
</msbuild>
</tasks>
You need to include ThoughtWorks.CruiseControl.MsBuild.dll in the working directory of your application.
So you need to put ThoughtWorks.CruiseControl.MsBuild.dll in C:\CCWorkingDirectory\DemoApplication
Here's a link about the MSBuild tag.
You could alternatively include it in the logger tag like so:
<logger>
C:\Program Files\CruiseControl.NET\server\
ThoughtWorks.CruiseControl.MsBuild.dll
</logger>