Bamboo: .NET Setups

Are there any samples around of different approaches to configuring a .NET build process using Visual Studio as the builder?

I've been trying multiple jobs in a stage, multiple stages in a job, and dealing with having lots of different test projects within a solution. So it would be useful if there was a guide to good/best practice in this area.

2 answers

1 accepted

2 votes
Accepted answer

Not that I'm aware of. We have also been using Bamboo for .Net builds. Our solutions are either a web site and many business layer projects, or a web service with associated business layer projects.

We have set up the web site and web services as web applications in VS. That way we can use the publish target to put everything into a zip and use the generated deploy.cmd to deploy to IIS.

So our first stage does our builds - up to 3 different configurations, debug(dev), test(qa) and release(live). Each build is a job in that stage so they can be done in parallel. Each job has a task that versions the dlls based on the version in JIRA and then creates shared artifacts so we can use them later on in the process without having to check everything out of SVN again. So we have 3 packages and then all the test dlls and test config files (vsmdi, etc.)

In the next stage, we run all our unit tests and code coverage (using NCover) by re-using the debug package.

In the next stage we deploy to IIS by calling the project.deploy.cmd that VS spits out when you call msbuild webproject.csproj /T:Publish

We then have another stage which is a manual stage which deploys to test. That way we can do some manual testing before we deploy to QA. Once QA is happy, we have another manual stage to deploy to live.

Hope that helps?

Thanks Bernard. I was starting to head down the artifacts as inter-stage communication route but wasn't sure on whether I was about to waste a lot of time :)

I found the following ANT exec line to be effective. It calls the visual studio environment setup batch file, then invokes the solution build. If the compile/build fails, exec is returned a nonzero exit code, so ANT can act appropriately. Build output is written to a file, useful for diagnostics.

<exec executable="cmd.exe" failonerror="true">
   <!-- execute a command which sets up and invokes the visual studio solution builder -->
   <arg value="/s /c &quot; call &quot;%VS100COMNTOOLS%/vsvars32.bat&quot; &amp;&amp; devenv.exe ${gui.solution.file} /rebuild Debug /Out ${gui.build.logfile} &quot;"/>
</exec>



Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,629 views 22 17
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you