Apr 1, 2015

Powershell build and release automation

devops, powershell, continuous delivery

I’ve been learning a lot lately about psake and Powershell on my new project. Getting the build to run with psake was almost trivial, as was collecting the build artifacts and bundling them. That took all of 2 hours. Plug it into TeamCity and you’re done. If you haven’t looked into automating your build and deploy for .Net projects with psake and powershell you owe it to yourself to look into it. It’s well worth it!

The deployment part was a bit more complicated. I’ve been focusing on that aspect for the better part of the past two weeks. Of course there is a lot of discovery work since I’m new to the project and the setup is quite complex and we have 5 different environments we deploy to.

I ran into a couple of snags with nuget of all things - my biggest complaint here is that you can’t get a packages.config file when installing packages from the command line. Basically we’re planing on using Octopus for deployments - another team here is doing that already - and we have to package our artifacts as nuget packages. The tentacles than pull packages down and install them on the target machines.

Another issues I’ve hit is with Chocolatey. We use it to bootstrap the target machines and install Windows features like IIS and .Net Framework 4.x. We don’t have local admin rights on our development boxes here (don’t get me started) and that’s made testing the prerequisites install hard, but this is not a tool limitation.

I just wanted to jot some ideas down about he things I’m doing. I’ll prepare a lengthier posts in a little while that may include some concrete examples of some of the things I’m talking about.