4196b409b8b0 deploy

contrib/deploy: start working on some sample deployment files
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 13 Jun 2010 10:44:27 -0400
parents 993a35243d1c
children 04f43fdb2423
branches/tags deploy
files .hgignore contrib/deploy/gunicorn.conf.py contrib/deploy/wsgi.py

Changes

--- a/.hgignore	Sun Jun 13 10:35:31 2010 -0400
+++ b/.hgignore	Sun Jun 13 10:44:27 2010 -0400
@@ -4,3 +4,6 @@
 .DS_Store
 tags
 .ropeproject
+*.swo
+*.swp
+*.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/deploy/gunicorn.conf.py	Sun Jun 13 10:44:27 2010 -0400
@@ -0,0 +1,10 @@
+# Example gunicorn configuration file.
+# Edit as necessary.
+
+bind = "127.0.0.1:8000"
+workers = 2
+daemon = False
+pidfile = "gunicorn.pid"
+logfile = "gunicorn.log"
+proc_name = "gunicorn-hgreview-myrepo"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/deploy/wsgi.py	Sun Jun 13 10:44:27 2010 -0400
@@ -0,0 +1,26 @@
+# An example WSGI script for serving hg-review's web UI.
+# Edit as necessary.
+
+# If hg-review is not on your webserver's PYTHONPATH, uncomment the lines
+# below and point it at the hg-review/review directory.
+import sys
+sys.path.insert(0, "/Users/sjl/src/hg-review/review")
+
+REPO = '/Users/sjl/Desktop/hg-review'
+READ_ONLY = True
+ALLOW_ANON_COMMENTS = True
+ANON_USER = 'Anonymous <anonymous@example.com>'
+
+from mercurial import hg, ui
+from web_ui import app
+from api import ReviewDatastore
+
+_ui = ui.ui()
+_ui.setconfig('ui', 'user', ANON_USER)
+repo = hg.repository(_ui, REPO)
+
+app.read_only = READ_ONLY
+app.debug = False
+app.datastore = ReviewDatastore(ui, repo)
+
+application = app