improve developer start scripts

This commit is contained in:
Benjamin Dauvergne 2014-01-21 15:47:06 +01:00
parent 7ab3cf3c0b
commit 4be134a782
5 changed files with 60 additions and 7 deletions

View File

@ -2,6 +2,9 @@
pip install --upgrade setuptools
pip install --upgrade pip
pip install --upgrade pylint
pip install --upgrade -v --allow-all-external --allow-unverified django-admin-tools -r requirements.txt
echo Nothing to test for now
pip install --upgrade -r requirements.txt
./portail-citoyen syncdb --migrate --noinput --no-initial-data
./portail-citoyen loaddata initial_data
./portail-citoyen validate
(pylint -f parseable --rcfile /var/lib/jenkins/pylint.django.rc compte_agglo_montpellier/ | tee pylint.out) || /bin/true
(pylint -f parseable --rcfile /var/lib/jenkins/pylint.django.rc portail_citoyen/ | tee pylint.out) || /bin/true

5
load-base-data.sh Executable file
View File

@ -0,0 +1,5 @@
BASE=`dirname $0`
ENV=${ENV:-dev}
$BASE/run.sh loaddata --traceback initial_data

View File

@ -1,13 +1,13 @@
--allow-all-external
--allow-unverified python-entrouvert
--allow-unverified django-cms
--allow-unverified django-admin-tools
-f https://repos.entrouvert.org/django-cms.git/
django-cms
-f https://repos.entrouvert.org/python-entrouvert.git/
python-entrouvert
requests>=1.0.0
cmsplugin-text-wrapper>=0.5
feedparser
django>=1.5.1,<1.6
git+git://repos.entrouvert.org/authentic.git/#egg=authentic2-9999
git+git://repos.entrouvert.org/django-cms.git/@develop#egg=django-cms-2.4.1.9999
git+git://repos.entrouvert.org/python-entrouvert.git/#egg=python-entrouvert-9999
authentic2
south>=0.8.4
Pillow

15
run.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
BASE=`dirname $0`
PROJECT=portail-citoyen
CTL=$BASE/${PROJECT}
VENV=$BASE/${PROJECT}-venv
if [ ! -n "$VIRTUAL_ENV" ]; then
if [ ! -d $VENV ]; then
$BASE/start.sh norun
fi
. $VENV/bin/activate
fi
export DEBUG=1
$CTL "${@:-runserver}"

30
start.sh Executable file
View File

@ -0,0 +1,30 @@
PROJECT=portail-citoyen
CTL=${PROJECT}
VENV=${PROJECT}-venv
if [ "$VIRTUAL_ENV" = "" ]; then
if which mkvirtualenv >/dev/null 2>&1; then
workon $PROJECT || (mkvirtualenv $PROJECT; workon $PROJECT)
else
if [ ! -d $VENV ]; then
virtualenv --system-site-packages $VENV 2>/dev/null || virtualenv $VENV
fi
. ./$VENV/bin/activate
fi
fi
pip install --upgrade setuptools
pip install --upgrade pip
pip install --upgrade pyOpenSSL ndg-httpsclient requests
sed -i 's/^MAX = 64/MAX = 200/' $VENV/lib/python*/site-packages/ndg/httpsclient/subj_alt_name.py
pip install --upgrade --process-dependency-links -r requirements.txt
if [ ! -f $PROJECT.db ]; then
./$CTL syncdb --all --noinput
./$CTL migrate --fake
if [ -f load-base-data.sh ]; then
./load-base-data.sh
fi
fi
if [ "$1" != "norun" ]; then
export DEBUG=1
./$CTL runserver
fi