Using PowerShell to Create Windows Users

Due to replication needing a few Windows users scattered about the place, I needed to write a PowerShell script to create the users as part of the Octopus Deploy automated deployment. For completeness, I have added some users to this script, but you can use “Sensitive” variables in Octopus Deploy to hide away important informationContinue reading “Using PowerShell to Create Windows Users”

Restore Private NuGet Feed Packages During Visual Studio Team Services Build

Update! As of February 2016, you should be able to use the standard “NuGet Installer” vNext build task. The New Way Add the Nuget Installer build task, which can be found under “Add build step” -> “Package”. You will need to supply a NuGet.config file with the address of your custom feed: <?xml version=”1.0″ encoding=”utf-8″?>Continue reading “Restore Private NuGet Feed Packages During Visual Studio Team Services Build”

Using Visual Studio Online PowerShell Build Step To Publish NuGet Package

Update! As of February 2016, you can now use the ready-made vNext NuGet Publisher step to do this and it is even easier. The New Way Add a new vNext build step using “Add build step…” -> Package -> NuGet Publisher. Select “Internal NuGet Feed” and paste in your feed url – job done. WithContinue reading “Using Visual Studio Online PowerShell Build Step To Publish NuGet Package”

Using an In Memory Database as a Test Double with Entity Framework

If you are using Entity Framework and you want to test your application without the real database, the typical technique employed is to write a repository or query provider that you can substitute with a stub during the test. Sometimes, though, you are better off pushing things a couple of levels deeper. This is whereContinue reading “Using an In Memory Database as a Test Double with Entity Framework”

The Relative Cost of Octopus Deploy

One of the best things about Octopus Deploy is the simplicity of the pricing. These numbers were correct at the time of writing, but the exact numbers aren’t the interesting bit – it is the relative cost. Obviously, the community edition is free and covers you up to five of everything (projects, machines, users). ButContinue reading “The Relative Cost of Octopus Deploy”

Sync Your Visual Studio Online and Octopus Deploy Version Numbers

I am using a batch file to update the version number in an AssemblyInfo file based on the Visual Studio Online build number. It overwrites a file named GloabalAssemblyInfo.cs that is linked to all of the projects in the set. This means the version automatically updates each time the software is built, and it meansContinue reading “Sync Your Visual Studio Online and Octopus Deploy Version Numbers”

Run Custom Database Scripts With PowerShell and Octopus Deploy

We are using model-based deployments using Visual Studio database projects and Octopus Deploy. One of the things you can’t do when performing DacPac deployments is include a pre-deployment scrip to disable replication prior to running the deployment (although you can re-enable it in a post-deployment script). The solution is to change the “disable replication” scriptContinue reading “Run Custom Database Scripts With PowerShell and Octopus Deploy”

Send a Notification When Deployments Fail

If you are using Octopus Deploy as part of a continuous delivery pipeline, you’ll probably find that deployments don’t fail very often. This means that when they do, people probably need to be told about it. Here is a simple email notification step that tells you when a deployment fails, including a reasonable amount ofContinue reading “Send a Notification When Deployments Fail”

Packaging and Deploying Visual Studio Database Project With OctoPack and Octopus Deploy

The prevalent method of packaging databases for Octopus Deploy is to use update scripts, along with a tool such as DbUp or ReadyRoll to perform the upgrade and manage which scripts have been run on each environment. If you are using Visual Studio Database projects, though, you’ll be interested in how to perform a model-basedContinue reading “Packaging and Deploying Visual Studio Database Project With OctoPack and Octopus Deploy”