pip install -r requirements.txt
echo -e "${strong}Installing developer requirements...${normal}"
pip install -r requirements-dev.txt
+echo -e "${strong}Running syncdb...${normal}"
+./manage.py syncdb --noinput
+
echo -e "${strong}Starting new git repository...${normal}"
git init
if [ $SEPARATE -eq 1 -a ! -d $OUT_FILE ]; then
echo "When creating multiple archives, your destination must be a directory."
echo "If it's not, you risk being surprised when your files are overwritten."
- exit
+ exit 1
elif [ `git config -l | grep -q '^core\.bare=false'; echo $?` -ne 0 ]; then
echo "$PROGRAM must be run from a git working copy (i.e., not a bare repository)."
- exit
+ exit 1
+elif ! git rev-parse HEAD &> /dev/null; then
+ echo "You must have some commit in the git working copy."
+ exit 1
fi
# Create the superproject's git-archive
def run(self):
print '>>> restart webserver using gunicorn-debian'
with path('/sbin'):
- sudo('gunicorn-debian restart %s' % self.site_name, shell=False)
+ sudo('gunicorn-debian restart %s' % self.name, shell=False)
class Apache(Task):
def run(self):
"Update the database"
print '>>> migrate'
require('app_path', 'project_name')
- with cd('%(app_path)s/releases/current/%(project_name)s' % env):
+ with cd('%(app_path)s/releases/current' % env):
run('%(app_path)s/ve/bin/python manage.py syncdb --noinput' % env, pty=True)
run('%(app_path)s/ve/bin/python manage.py migrate' % env, pty=True)
"""Collect static files"""
print '>>> collectstatic'
require('app_path', 'project_name')
- with cd('%(app_path)s/releases/current/%(project_name)s' % env):
+ with cd('%(app_path)s/releases/current' % env):
run('%(app_path)s/ve/bin/python manage.py collectstatic --noinput' % env, pty=True)