Hi John,

Building on Ray's answer to use Upstart, I've recently started using a 
Git-based deployment method that essentially uses a Git post-receive hook 
to re-deploy the application with a simple git push.

To set-up, create a bare repo and a working tree on the deploy host, and 
the relevant Upstart job. We then deploy using *`git push 
deployhost:path/to/deploy-repo.git master:deploy`*. When a push is received 
on the deploy branch, the hook on the remote repo updates the working tree, 
and restarts the Upstart job. (I use SystemD services in place of Upstart 
when I get the choice - IMO it beats Upstart hands-down, but that's an 
aside!)

I've put the post-receive hook at 
https://gist.github.com/james-henderson/6263386 - hope this helps!

Regards,

James

On Sunday, 18 August 2013 17:21:22 UTC+1, John Jacobsen wrote:
>
> Many thanks to everyone who replied about deploying a Web server to 
> production.  Specific replies: 
>
> On Aug 17, 2013, at 6:51 PM, Mark Mandel <mark....@gmail.com <javascript:>> 
> wrote: 
>
> > 
> > On Sun, Aug 18, 2013 at 6:52 AM, John Jacobsen 
> > <eigen...@gmail.com<javascript:>> 
> wrote: 
> >> After some prototyping and development, we are now getting to the stage 
> where "lein run" and a Jetty server running from -main aren't going to cut 
> it. 
> > 
> > At the risk of asking a dumb question, but being quite new to Clojure, I 
> don't mind - why do you say they won't cut it? 
>
> On Aug 18, 2013, at 9:25 AM, Norman Richards 
> <o...@nostacktrace.com<javascript:>> 
> wrote: 
>
> > Other than that, mechanically our deploy is not significantly different 
> from a lein ring server, so maybe you can explain what your concerns with 
> that are? 
>
> My main concern was just the need to ssh into the server and run leiningen 
> in the background, as opposed to setting up a "real" server which starts at 
> boot time.  I'm OK w/ wrapping 'lein ring server-headless' with 
> Apache/Nginx, if there are no known issues w/ that approach. 
>
>
> On Aug 17, 2013, at 4:52 PM, Ray Miller <r...@1729.org.uk <javascript:>> 
> wrote: 
>
> > One option is simply to write an upstart script that invokes 'lein 
> > ring server-headless' and sit an apache or nginx proxy in front of it. 
> > That's how my website is currently running. Alternatively, you could 
> > deploy your application as a war to tomcat or jetty. 
> > 
> > The upstart configuration, which is installed to /etc/init/cms.conf, 
> > can be found here: https://gist.github.com/ray1729/6258845 
>
> That's very helpful -- can you be a little more specific about what you 
> mean by "sit an apache or nginx proxy in front of it"?  It looks like your 
> example is self-contained (need Clojure/lein + upstart, and that's it). 
>
> Thanks again everyone. 
>
> John 
>
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to