I am converting our CI platform from CruiseControl to Jenkins and cannot imagine something that looks like it should be relatively easy to do (Disclaimer - I am not an expert on CI automation or assembly, but it has been dropped on my knees, and I find it interesting)
In CruiseControl, I can declare variables like this:
<cb:define rootdir="J:\SOURCES\" /> <cb:define logdir="J:\SOURCES\buildlogs" /> <cb:define iisdir="J:\IIS\" /> <cb:define artifacts="artifacts\" />
Then use them as part of your MSBuild task.
<msbuild> <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable> <workingDirectory>$(rootdir)$(ProjectName)</workingDirectory> <projectFile>$(ProjectName).sln</projectFile> <buildArgs>/p:BuildDate="1";OutDir="$(iisdir)$(ProjectName)\bin\\";WebProjectOutputDir="$(iisdir)$(ProjectName)\\"</buildArgs> <targets>Rebuild;$(ProjectName)</targets> <timeout>180</timeout> <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger> </msbuild>
If the root or IIS directories change, they can be easily applied to all projects at once. We have ~ 60 projects, so this project project will be very time-consuming. Migrating this to Jenkins, the MSBuild command line arguments now look like this (partial fetch, but includes what matters):
OutDir="J:\IIS\ProjectName\bin\\";WebProjectOutputDir="J:\IIS\ProjectName\\"
The IIS directory is hard-coded. I need it to be something like this:
OutDir="${IIS_DIR}\ProjectName\bin\\";WebProjectOutputDir="${ITEM_ROOTDIR}\ProjectName\\"
Is there any way to do this? I tried the section settings plugin, which is useful, but does not meet this need from what I see.
build-automation jenkins msbuild
TechDawg270
source share