Browse Source

Add a script to update a production installation

Baptiste Jonglez 8 years ago
parent
commit
9782b02fca
2 changed files with 21 additions and 0 deletions
  1. 7 0
      INSTALL.md
  2. 14 0
      update_prod.sh

+ 7 - 0
INSTALL.md

@@ -89,6 +89,13 @@ You probably also need to configure your webserver to allow to send very large
 files in a POST request.  An upper limit of 200 MB should be enough, even for
 very large pictures in raw format.
 
+Updating a production installation
+----------------------------------
+
+There is a script, `update_prod.sh`, that handles updating an existing
+production installation.  It install new dependencies and collect static
+files.
+
 Tile generation
 ---------------
 

+ 14 - 0
update_prod.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -e
+
+# Check if running in a virtualenv
+[ -z "$VIRTUAL_ENV" ] && { echo 'Please run this script in a virtualenv!'; exit 1;}
+
+git pull
+pip install -r requirements.txt
+./manage.py collectstatic
+
+echo
+echo
+echo "** Update done.  Don't forget to restart gunicorn (e.g. using 'supervisorctl')"