I've a little unprofessional site running of my own. For
servicization/deamonizing I simply created a so called `init.d` script,
and for deploying I've made a simple bash-alias that compiles and
replaces and restarts the yesod daemon. Effectively this means that my
yesod site starts automatically at boot up and I can also easily restart it.
This was the first time I dealt with init.d scripts and I think I got it
working alright. Here are some very unpolished pastes of the code I
effectively use.
init.d-script: https://gist.github.com/1e2534545cbf9a7e788a
deployment-aliases:
https://github.com/Tarrasch/dotfiles/blob/dtek/zsh/zsh_aliases#L53-63
In the above unpolished scripts "dp", "dportalen" and "DtekPortalen"
basically is the name of my yesod project, so it should be changed to
whatever you call yours respectively. Note that the deployment script
also compiles the site, VPSs usually can't handle that.
Also, one needs to install the init.d script, I once found and used a
command that easily could install/uninstall init.d-scripts, but I can't
find it anymore :/
So this is how I solved deployment of my yesod service, and I'm
interested to know how other people have solved this, or if there is any
official recommendations in the community.
Best Wishes,
Arash Rouhani
Yes, that probably makes more sense. I've avoided using that command
just because it's longer and (theoretically) more confusing to new
users. You're hitting the opposite problem: an experienced user
getting confused by the overly-simplified command. I got similar
comments on the book.
>
> 2)
>
> And if my understanding is correct, Yesod apps cannot be daemonized by
> itself. Should users run Yesod apps with, for instance, the "screen"
> command?
I've personally been using angel recently. But yes, the idea would be
to use some kind of monitoring daemon. I've got some deployment
scripts[1] that I use in my newer setups. It works, but it's not yet
completely polished.
Michael
[1] https://github.com/yesodweb/deploy
git pull && cabal clean && cabal configure && cabal build
Then I just restart the various app instances.
I haven't bothered to automate it. I'm wondering if there is a trick
to get around my library issues.
It's all behind an Apache instance through a reverse proxy. I don't
have enough load that I've had to do static content through Apache.
Drew Haven
drew....@gmail.com
Michael
I love that I can do the whole build without affecting the running
server, so the downtime is pretty low. The differences between the
production and dev systems is small enough that I'm not worried about
the restart issue. Also, I have the alternate and my traffic isn't
large yet, otherwise I might dedicate a box for build/testing.
Drew Haven
drew....@gmail.com