From f29105b2d7fb7f09f5d8c6037447fa3a5f8f340c Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 4 Oct 2014 21:29:05 +0000 Subject: [PATCH] deploy.sh: make sure git is installed --- .../databases/tests/functional_tests/tests.py | 2 +- .../domains/tests/functional_tests/tests.py | 1 + orchestra/bin/orchestra-admin | 23 +++++++++++++++++-- scripts/container/deploy.sh | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/orchestra/apps/databases/tests/functional_tests/tests.py b/orchestra/apps/databases/tests/functional_tests/tests.py index ec7e8bd3..f142ccbc 100644 --- a/orchestra/apps/databases/tests/functional_tests/tests.py +++ b/orchestra/apps/databases/tests/functional_tests/tests.py @@ -12,7 +12,7 @@ from orchestra.utils.system import run from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii from ... import backends, settings -from ...models import Satabase +from ...models import Database class DatabaseTestMixin(object): diff --git a/orchestra/apps/domains/tests/functional_tests/tests.py b/orchestra/apps/domains/tests/functional_tests/tests.py index 979db056..d4fe1dd2 100644 --- a/orchestra/apps/domains/tests/functional_tests/tests.py +++ b/orchestra/apps/domains/tests/functional_tests/tests.py @@ -197,6 +197,7 @@ class DomainTestMixin(object): self.addCleanup(partial(self.delete, self.domain_name)) self.update(self.domain_name, self.domain_update_records) self.add(self.www_name, self.www_records) + time.sleep(1) self.validate_update(self.MASTER_SERVER_ADDR, self.domain_name) time.sleep(5) self.validate_update(self.SLAVE_SERVER_ADDR, self.domain_name) diff --git a/orchestra/bin/orchestra-admin b/orchestra/bin/orchestra-admin index 19d91cda..49ef7102 100755 --- a/orchestra/bin/orchestra-admin +++ b/orchestra/bin/orchestra-admin @@ -157,7 +157,8 @@ function install_requirements () { if $testing; then APT="${APT} \ - iceweasel" + iceweasel \ + dnsutils" PIP="${PIP} \ selenium \ xvfbwrapper \ @@ -178,12 +179,30 @@ function install_requirements () { run apt-get update run apt-get install -y $APT - run pip install $PIP + run pip install $PIP --allow-external orchestra-orm --allow-unverified orchestra-orm + # Install ca certificates + if [[ ! -e /usr/local/share/ca-certificates/cacert.org ]]; then + mkdir -p /usr/local/share/ca-certificates/cacert.org + wget -P /usr/local/share/ca-certificates/cacert.org \ + http://www.cacert.org/certs/root.crt \ + http://www.cacert.org/certs/class3.crt + update-ca-certificates + fi # Some versions of rabbitmq-server will not start automatically by default unless ... sed -i "s/# Default-Start:.*/# Default-Start: 2 3 4 5/" /etc/init.d/rabbitmq-server sed -i "s/# Default-Stop:.*/# Default-Stop: 0 1 6/" /etc/init.d/rabbitmq-server run update-rc.d rabbitmq-server defaults + + # Patch passlib + from collections import OrderedDict + + IMPORT="from django.contrib.auth.hashers import mask_hash, _" + COLLECTIONS="from collections import OrderedDict" + sed -i "s/${IMPORT}, SortedDict/${IMPORT}\n ${COLLECTIONS}/" \ + /usr/local/lib/python2.7/dist-packages/passlib/ext/django/utils.py + sed -i "s/SortedDict/OrderedDict/g" \ + /usr/local/lib/python2.7/dist-packages/passlib/ext/django/utils.py } export -f install_requirements diff --git a/scripts/container/deploy.sh b/scripts/container/deploy.sh index 3cfc7738..db01a713 100755 --- a/scripts/container/deploy.sh +++ b/scripts/container/deploy.sh @@ -51,7 +51,7 @@ if [[ ! $CURRENT_VERSION ]]; then run "cp $HOME/django-orchestra/orchestra/bin/orchestra-admin /usr/local/bin/" fi -sudo orchestra-admin install_requirements +sudo orchestra-admin install_requirements --testing if [[ ! -e $BASE_DIR ]]; then cd $HOME