Search code examples
haskellcapistranoweb-deploymentgithookshaskell-snap-framework

Deploy Haskell code that uses the Snap Framework


What's your experience with deploying Haskell code for production in Snap in a stable fashion?

If the compilation fails on the server then I would like to abort the deployment and if it succeeds then I would like it to turn of the snap-server and start the new version instead.

I know there are plenty of ways. Everything from rsync to git-hooks (git pull was a nightmare). But I would like to hear your experiences.


Solution

  • Where I work, we use Happstack and deploy on Ubuntu linux. We actually debianize the web app and all the dependencies, and then build them in the autobuilder.

    To actually install on the server, we just run apt-get update && apt-get install webapp-production

    The advantage of this system is that it makes it easy for all developers to develop against the same version of the dependencies. And you know that all the source code is checked in properly and can be rebuilt anywhere .. not just on one particular machine. Additionally, it provides a mechanism to make patches to libraries from hackage when needed.

    The downside is that apt-get and cabal-install do not get along well. You either have to build everything via apt-get or do everything via cabal-install.