This is a series on my findings around building open source software online for free. There are many SAAS (Software As A Service) platforms out there and a lot of these are free to use with your open source projects. But not all of these work with C# and .Net. So this series highlights the tools and products out there that work with .Net in different phases of the software development life cycle.
Publish & Deploy
Once we are happy with our code, had it tested and happy with what we have, we need a way to distribute it to our customers. For Websites and Web applications, we want to deploy it onto the web somewhere where it can run. I will cover a few choices available to .Net developers that I have come across.
- GitHub Pages
If your code is a library, or a utility or console application, then you may want to distribute it to other developers and IT Pros to use and enjoy. There are several ways to make these available through direct downloads and package managers.
- Github Releases
AppVeyor is my go-to build server. For some extra information in AppVeyor, there is this great article from scott hanselman and it also features in the build section of this series. In terms of publishing and deploying applications, AppVeyor has a very detailed Deployment documentation, and can take your build artifacts and push them almost anywhere you can think of. FTP, Amazon, Azure, to SQL, GitHub Releases (mentioned below) and custom scripts for when you have an API available to publish to. You can publish from artifacts after a successful build manually, or add it as the final build step on every build, or with conditions. They even provide their own NuGet feed if you want to use the build outputs as in-house betas during development.
OnCheckin is an Australian company that provides continuous delivery from check to deployment, and manages all the steps in between for you. It looks to be very customisable, and provides one site for free. It supports config transforms for the deployment side, and Bitbucket and GitHub for source control, as well as private SVN and git, and Team Foundation Server. You can set up your host provider manually or using a publish profile, such as connecting to an Azure website, or any private host you may have.
You can host just about anything in Azure these days. From compute, to websites, Linux or windows VMs, even backing stores for your mobile apps. In terms of places to deploy to, Azure is a great option, easy to use, flashy dashboards and plenty of configuration tweaking to be had, If that's your thing. Publishing a website to Azure with visual studio deploy couldn't be simpler. There are even a bunch of ways to get Azure to pull in changes when you commit to your source control, deploy from Dropbox and heaps of other options. And its not too expensive either, depending on your load and traffic, and how many peripheral services you need.
AppHarbor is a Platform As A Service (PAAS) for .Net applications. I haven't had a chance to use this myself, but it does look like a nice offering. For their free plan, you get a single web worker, with a domain of myapp.apphb.com. For $10 a month you can add unlimited custom domains, and SSL for another $10.If you want load balanced across two web workers, or one web and one background worker, it $50 a month. But you can basically scale up and out and pay for the privilege in any configuration you choose. As well as integration into the likes of GitHub, CodePlex and Bitbucket, it has an ecosystem of add-ons available (free and paid services) to extend your application.
For the ultimate in continuous deployment there is GitHub Pages. Just push changes to your git repository on GitHub and your changes go live. Each GitHub user gets one user site using a repository called username.github.io where username is the user or organisation name of the GitHub account. As well as this, you can have one per project, and this is done using a branch names gh-pages inside your project's repository. Since this is hosted by GitHub it makes it easy and free to not only have a site for each of your projects, but your own personal site or blog at no cost to you. That is as long as you don't mind the whole thing being open source (or at least source open).
NuGet is Microsoft's package manager for Visual Studio Projects. It is where you can find code files/snippets to install in your project, dll dependencies to link to, utility applications, and more recently plugins/extensions into extensibility points in Visual Studio. Going Forward, NuGet will be the way all dependencies are installed and resolved. As well as the main public repository of packages at www.nuget.org, The software is open source and free to use so you can host your own repository, or user other providers available such as www.myget.org. The Visual Studio tooling even supports pointing at a folder or network share to resolve packages.
Chocolatey is a twist on NuGet. Rather than being for your code, it is for your machine. Easily installed from cmd or PowerShell, you can use the command choco install foo to install applications you want to be able to use on the machine. Two flavours of apps are available, though not all are available in both. There is the portable packages, that run from their own folder and do not require installing. Then there is the usual installed application, usually based on msi or other windows installers. A Typical package looks like a NuGet package, and contains scripts and instructions to download installers and run them on the machine. Some of them do require human intervention to click through wizards. On a build machine, Chocolatey has been very useful for me to install utilities, such as PSake, GitVersion and Nuget. The bonus is I can run the same script on a new development machine or VM, and get all the required utilities installed and ready to go automatically. Chocolately ran a Kickstarter late last year to get funding for a new 2.0 approach under the name 'The Chocolatey Experience'. I also use it regularly now on windows to install tools like paint.net, Inkscape, notepad++ and other tools like that, without having to find and download the latest installers myself. Very cool.
PsGet is a package manager for PowerShell. Pretty simple and easy to use. Allows you to pull down and install PowerShell Modules from PowerShell. Their directory list of packages is just a GitHub Repository and it is easy to add your packages to it. I use this mainly to get Posh-Git installed, but there are other great PowerShell packages in there as well.
Each repository on GitHub has the ability to set up GitHub Releases based off of tags. These can have files attached, and are a simple as easy way to host the downloadable source and executables or libraries for each specific release version. As mentioned above you can even publish to here from a release build on AppVeyor either manually or automatically.
So that's what I've got for publishing and deployments. Again this is nowhere near definitive, but a good cross section to get you a little more aware. Next up we move onto other tools to help with developing you code further, starting with Documentation.
Obviously I am going to keep finding tools I've missed, bit it looks like I should mention Octopus Deploy, a deployment engine to automate your environment deployments. As well as the expensive paid versions, there is a Community Edition that lets you deploy 5 projects to up to 10 'Tentacles' for up to 5 users. Might be worth checking out as well.