Commit 810346afb4686e19a8741c7efb0a98a0ee825d3c

Authored by Sergio Oliveira
1 parent 3904d09c

new demo server and solr config

Showing 1 changed file with 17 additions and 2 deletions   Show diff stats
@@ -19,6 +19,11 @@ environments = { @@ -19,6 +19,11 @@ environments = {
19 'hosts': [], #TODO 19 'hosts': [], #TODO
20 'key_filename': '~/.ssh/id_rsa', 20 'key_filename': '~/.ssh/id_rsa',
21 }, 21 },
  22 + 'demo': {
  23 + 'hosts': ['colab-demo.tracy.com.br'],
  24 + 'key_filename': '~/.ssh/id_rsa',
  25 + 'port': 22,
  26 + },
22 } 27 }
23 28
24 29
@@ -27,8 +32,8 @@ WORKON_COLAB = '{} && workon colab'.format(SOURCE_VENV) @@ -27,8 +32,8 @@ WORKON_COLAB = '{} && workon colab'.format(SOURCE_VENV)
27 32
28 33
29 def environment(name): 34 def environment(name):
30 - env.update(environments[name])  
31 - env.environment = name 35 + env.update(environments[name])
  36 + env.environment = name
32 environment('dev') 37 environment('dev')
33 38
34 39
@@ -48,6 +53,15 @@ def install(local_settings=None): @@ -48,6 +53,15 @@ def install(local_settings=None):
48 if local_settings: 53 if local_settings:
49 put(local_settings, '~/colab/src/colab/local_settings.py') 54 put(local_settings, '~/colab/src/colab/local_settings.py')
50 55
  56 + if not exists('~/apache-solr-3.6.2/'):
  57 + run('wget http://archive.apache.org/dist/lucene/solr/3.6.2/apache-solr-3.6.2.tgz')
  58 + run('tar xzf apache-solr-3.6.2.tgz')
  59 + run('rm apache-solr-3.6.2.tgz')
  60 +
  61 + with cd('~/apache-solr-3.6.2/example/solr/conf/'):
  62 + if not exists('stopwords_en.txt'):
  63 + run('cp stopwords.txt stopwords_en.txt')
  64 +
51 if env_created: 65 if env_created:
52 update_requirements() 66 update_requirements()
53 67
@@ -71,6 +85,7 @@ def deploy(update=False): @@ -71,6 +85,7 @@ def deploy(update=False):
71 run('python manage.py syncdb') 85 run('python manage.py syncdb')
72 run('python manage.py migrate') 86 run('python manage.py migrate')
73 run('python manage.py collectstatic --noinput') 87 run('python manage.py collectstatic --noinput')
  88 + run('python manage.py build_solr_schema -f ~/apache-solr-3.6.2/example/solr/conf/schema.xml')
74 89
75 sudo('supervisorctl restart all') 90 sudo('supervisorctl restart all')
76 91