deploy.sh: make sure git is installed

This commit is contained in:
Marc 2014-10-04 14:19:29 +00:00
parent fb9679e557
commit fde29e4ddd
7 changed files with 22 additions and 10 deletions

View File

@ -161,3 +161,5 @@ APPS app?
* Ansible orchestration *method* (methods.py) * Ansible orchestration *method* (methods.py)
* interdependency user <-> account with the old usermodel * interdependency user <-> account with the old usermodel
* replace running_syncdb() by db_ready()

View File

@ -7,7 +7,6 @@ from orchestra.admin import ExtendedModelAdmin
from orchestra.admin.filters import UsedContentTypeFilter from orchestra.admin.filters import UsedContentTypeFilter
from orchestra.admin.utils import insertattr, get_modeladmin, admin_link, admin_date from orchestra.admin.utils import insertattr, get_modeladmin, admin_link, admin_date
from orchestra.core import services from orchestra.core import services
from orchestra.utils import running_syncdb
from .forms import ResourceForm from .forms import ResourceForm
from .models import Resource, ResourceData, MonitorData from .models import Resource, ResourceData, MonitorData
@ -136,8 +135,8 @@ def resource_inline_factory(resources):
return ResourceInline return ResourceInline
if not running_syncdb():
# not run during syncdb def insert_resource_inlines():
for ct, resources in Resource.objects.group_by('content_type').iteritems(): for ct, resources in Resource.objects.group_by('content_type').iteritems():
inline = resource_inline_factory(resources) inline = resource_inline_factory(resources)
model = ct.model_class() model = ct.model_class()

View File

@ -1,6 +1,6 @@
from django.apps import AppConfig from django.apps import AppConfig
from orchestra.utils import running_syncdb from orchestra.utils import database_ready
class ResourcesConfig(AppConfig): class ResourcesConfig(AppConfig):
@ -8,6 +8,8 @@ class ResourcesConfig(AppConfig):
verbose_name = 'Resources' verbose_name = 'Resources'
def ready(self): def ready(self):
if not running_syncdb(): if database_ready():
from .admin import insert_resource_inlines
from .models import create_resource_relation from .models import create_resource_relation
create_resource_relation() create_resource_relation()
insert_resource_inlines()

View File

@ -1,7 +1,7 @@
from rest_framework import serializers from rest_framework import serializers
from orchestra.api import router from orchestra.api import router
from orchestra.utils import running_syncdb from orchestra.utils import database_ready
from .models import Resource, ResourceData from .models import Resource, ResourceData
@ -23,7 +23,7 @@ class ResourceSerializer(serializers.ModelSerializer):
# Monkey-patching section # Monkey-patching section
if not running_syncdb(): if database_ready():
# TODO why this is even loaded during syncdb? # TODO why this is even loaded during syncdb?
# Create nested serializers on target models # Create nested serializers on target models
for ct, resources in Resource.objects.group_by('content_type').iteritems(): for ct, resources in Resource.objects.group_by('content_type').iteritems():

View File

@ -126,6 +126,7 @@ function install_requirements () {
python-dev \ python-dev \
bind9utils \ bind9utils \
python-cracklib \ python-cracklib \
libz-dev \
libxml2-dev \ libxml2-dev \
libxslt1-dev \ libxslt1-dev \
wkhtmltopdf \ wkhtmltopdf \
@ -140,17 +141,21 @@ function install_requirements () {
django-transaction-signals==1.0.0 \ django-transaction-signals==1.0.0 \
django-celery==3.1.10 \ django-celery==3.1.10 \
celery==3.1.13 \ celery==3.1.13 \
kombu==3.0.8 \ kombu==3.0.23 \
billiard==3.3.0.18 \
Markdown==2.4 \ Markdown==2.4 \
django-debug-toolbar==1.2.1 \ django-debug-toolbar==1.2.1 \
djangorestframework==2.3.14 \ djangorestframework==2.3.14 \
paramiko==1.15.1 \ paramiko==1.15.1 \
ecdsa==0.11 \
Pygments==1.6 \ Pygments==1.6 \
django-filter==0.7 \ django-filter==0.7 \
passlib==1.6.2 \ passlib==1.6.2 \
jsonfield==0.9.22 \ jsonfield==0.9.22 \
lxml==3.3.5 \ lxml==3.3.5 \
python-dateutil==2.2" django-nose==1.2 \
python-dateutil==2.2 \
django-iban==0.3.0"
if $testing; then if $testing; then
APT="${APT} \ APT="${APT} \

View File

@ -41,3 +41,7 @@ def send_email_template(template, context, to, email_from=None, html=None, attac
def running_syncdb(): def running_syncdb():
return 'migrate' in sys.argv or 'syncdb' in sys.argv or 'makemigrations' in sys.argv return 'migrate' in sys.argv or 'syncdb' in sys.argv or 'makemigrations' in sys.argv
def database_ready():
return not running_syncdb() and 'setuppostgres' not in sys.argv

View File

@ -59,7 +59,7 @@ MANAGE="$BASE_DIR/manage.py"
if [[ ! $(sudo su postgres -c "psql -lqt" | awk {'print $1'} | grep '^orchestra$') ]]; then if [[ ! $(sudo su postgres -c "psql -lqt" | awk {'print $1'} | grep '^orchestra$') ]]; then
# orchestra database does not esists # orchestra database does not esists
# Speeding up tests, don't do this in production! # Speeding up tests, don't do this in production!
POSTGRES_VERSION=$(psql --version | head -n1 | awk {'print $3'} | cut -d'.' -f1,2) POSTGRES_VERSION=$(psql --version | head -n1 | awk {'print $3'} | sed -r "s/(^[0-9\.]*).*/\1/")
sudo sed -i "s/^#fsync =\s*.*/fsync = off/" \ sudo sed -i "s/^#fsync =\s*.*/fsync = off/" \
/etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf
sudo sed -i "s/^#full_page_writes =\s*.*/full_page_writes = off/" \ sudo sed -i "s/^#full_page_writes =\s*.*/full_page_writes = off/" \