~abompard/mailman-bundler/mailman-bundler

« back to all changes in this revision

Viewing changes to templates/bin/mailman-post-update.in

  • Committer: Aurélien Bompard
  • Date: 2015-03-18 15:12:27 UTC
  • Revision ID: aurelien@bompard.org-20150318151227-gswkpug8ncjknbv9
fix bzrignore and add missing files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -e
 
4
 
 
5
BINDIR="${buildout:bin-directory}"
 
6
CONFDIR="${buildout:directory}/${mailman-web:project}"
 
7
SETTINGS="${mailman-web:settings}"
 
8
DJANGO_CONTROL_SCRIPT="$BINDIR/${mailman-web:control-script}"
 
9
STATIC_DIR=`"$BINDIR/django-read-settings" STATIC_ROOT`
 
10
DEBUG=`"$BINDIR/django-read-settings" DEBUG`
 
11
 
 
12
set -x
 
13
 
 
14
if [ "$DEBUG" == "False" ]; then
 
15
    mkdir -p "$STATIC_DIR" || :
 
16
    "$DJANGO_CONTROL_SCRIPT" collectstatic --clear --noinput --verbosity 0
 
17
    "$DJANGO_CONTROL_SCRIPT" compress
 
18
fi
 
19
 
 
20
dbdir=$(dirname $($BINDIR/django-read-settings DATABASES.default.NAME))
 
21
mkdir -p $dbdir
 
22
syncdb_cmd="$DJANGO_CONTROL_SCRIPT migrate"
 
23
if [[ ! -t 1 ]]; then
 
24
    # stdout is not a terminal
 
25
    syncdb_cmd="$syncdb_cmd --noinput"
 
26
fi
 
27
$syncdb_cmd
 
28
"$DJANGO_CONTROL_SCRIPT" update_index
 
29
[ ! -f /usr/sbin/postmap ] || "$BINDIR/mailman" aliases