[python-uk] Suggestions / best practices for deployment
Matt Hamilton
matth at netsight.co.uk
Wed May 15 13:00:16 CEST 2013
On 15 May 2013, at 10:57, Harry Percival wrote:
> Dear UK Python chums,
>
> some of you probably know I'm writing a book about TDD for O'Reilly. I'm looking for some help with the (first) chapter on deployment.
>
> http://www.obeythetestinggoat.com/what-to-say-about-deployment.html
>
> What do you use for deployment? Do you have any kind of automated scripts? How do you manage virtualenvs, the database, apache/uwsgi config... What do you think might work as a sort of "best practice lite" for a simple site for beginners? (django, sqlite database, static files)
We use zc.buildout for all our deployment stuff, as it can handle not just python things, but also other stuff too (e.g. setting up a Solr server, or varnish proxy, etc) and allows multiple buildout files with inheritances between them. ie. we have a base.cfg, a dev.cfg, a staging.cfg and a live.cfg, the latter three build upon the first. Live might set up a cluster of Zope instances, an haproxy instance and varnish. dev.cfg might set up debuggers and extra reporting etc.
To take this further, the Plone community does a lot of CI testing and buildout helps with this as you could have a travis.cfg which might set up the environment for Travis.
A good set of slides on this:
http://www.slideshare.net/zupo/travis-ci-fun-and-easy-ci-for-your-plone-packages
Or, for instance, we use Jenkins in-house and one of our projects, a Pyramid project has a specific buildout file for use with jenkins which uses sqllite instead of Postgres, and sets up some default content for the tests to run against.
-Matt
--
Matt Hamilton, Technical Director
Netsight Internet Solutions Limited
http://www.netsight.co.uk/matth
Tel: 0117 90 90 90 1 Ext. 15
Registered in England No. 3892180
Registered office: 40 Berkeley Square, Clifton, Bristol, BS8 1HU
More information about the python-uk
mailing list