deploy.sh: make sure git is installed
This commit is contained in:
parent
fb9679e557
commit
fde29e4ddd
2
TODO.md
2
TODO.md
|
@ -161,3 +161,5 @@ APPS app?
|
|||
* Ansible orchestration *method* (methods.py)
|
||||
* interdependency user <-> account with the old usermodel
|
||||
|
||||
|
||||
* replace running_syncdb() by db_ready()
|
||||
|
|
|
@ -7,7 +7,6 @@ from orchestra.admin import ExtendedModelAdmin
|
|||
from orchestra.admin.filters import UsedContentTypeFilter
|
||||
from orchestra.admin.utils import insertattr, get_modeladmin, admin_link, admin_date
|
||||
from orchestra.core import services
|
||||
from orchestra.utils import running_syncdb
|
||||
|
||||
from .forms import ResourceForm
|
||||
from .models import Resource, ResourceData, MonitorData
|
||||
|
@ -136,8 +135,8 @@ def resource_inline_factory(resources):
|
|||
|
||||
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():
|
||||
inline = resource_inline_factory(resources)
|
||||
model = ct.model_class()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
from orchestra.utils import running_syncdb
|
||||
from orchestra.utils import database_ready
|
||||
|
||||
|
||||
class ResourcesConfig(AppConfig):
|
||||
|
@ -8,6 +8,8 @@ class ResourcesConfig(AppConfig):
|
|||
verbose_name = 'Resources'
|
||||
|
||||
def ready(self):
|
||||
if not running_syncdb():
|
||||
if database_ready():
|
||||
from .admin import insert_resource_inlines
|
||||
from .models import create_resource_relation
|
||||
create_resource_relation()
|
||||
insert_resource_inlines()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from rest_framework import serializers
|
||||
|
||||
from orchestra.api import router
|
||||
from orchestra.utils import running_syncdb
|
||||
from orchestra.utils import database_ready
|
||||
|
||||
from .models import Resource, ResourceData
|
||||
|
||||
|
@ -23,7 +23,7 @@ class ResourceSerializer(serializers.ModelSerializer):
|
|||
|
||||
# Monkey-patching section
|
||||
|
||||
if not running_syncdb():
|
||||
if database_ready():
|
||||
# TODO why this is even loaded during syncdb?
|
||||
# Create nested serializers on target models
|
||||
for ct, resources in Resource.objects.group_by('content_type').iteritems():
|
||||
|
|
|
@ -126,6 +126,7 @@ function install_requirements () {
|
|||
python-dev \
|
||||
bind9utils \
|
||||
python-cracklib \
|
||||
libz-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
wkhtmltopdf \
|
||||
|
@ -140,17 +141,21 @@ function install_requirements () {
|
|||
django-transaction-signals==1.0.0 \
|
||||
django-celery==3.1.10 \
|
||||
celery==3.1.13 \
|
||||
kombu==3.0.8 \
|
||||
kombu==3.0.23 \
|
||||
billiard==3.3.0.18 \
|
||||
Markdown==2.4 \
|
||||
django-debug-toolbar==1.2.1 \
|
||||
djangorestframework==2.3.14 \
|
||||
paramiko==1.15.1 \
|
||||
ecdsa==0.11 \
|
||||
Pygments==1.6 \
|
||||
django-filter==0.7 \
|
||||
passlib==1.6.2 \
|
||||
jsonfield==0.9.22 \
|
||||
lxml==3.3.5 \
|
||||
python-dateutil==2.2"
|
||||
django-nose==1.2 \
|
||||
python-dateutil==2.2 \
|
||||
django-iban==0.3.0"
|
||||
|
||||
if $testing; then
|
||||
APT="${APT} \
|
||||
|
|
|
@ -41,3 +41,7 @@ def send_email_template(template, context, to, email_from=None, html=None, attac
|
|||
|
||||
def running_syncdb():
|
||||
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
|
||||
|
|
|
@ -59,7 +59,7 @@ MANAGE="$BASE_DIR/manage.py"
|
|||
if [[ ! $(sudo su postgres -c "psql -lqt" | awk {'print $1'} | grep '^orchestra$') ]]; then
|
||||
# orchestra database does not esists
|
||||
# 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/" \
|
||||
/etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf
|
||||
sudo sed -i "s/^#full_page_writes =\s*.*/full_page_writes = off/" \
|
||||
|
|
Loading…
Reference in a new issue