Commit bd2a20e1ef271e7805d9e530cc40b43ddc3e0e20
1 parent
b14edb1a
Exists in
master
and in
39 other branches
Adding solr instalation to fabfile
-Add install_solr task -Add solr task
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
fabfile.py
| @@ -261,5 +261,27 @@ def deploy(noprovision=False): | @@ -261,5 +261,27 @@ def deploy(noprovision=False): | ||
| 261 | sudo('supervisorctl start all') | 261 | sudo('supervisorctl start all') |
| 262 | 262 | ||
| 263 | 263 | ||
| 264 | +@task | ||
| 265 | +def install_solr(): | ||
| 266 | + """Install Solr""" | ||
| 267 | + if not exists('~/solr-4.6.1'): | ||
| 268 | + link = 'https://archive.apache.org/dist/lucene/solr/4.6.1/solr-4.6.1.tgz' | ||
| 269 | + run('wget {} -O /tmp/solr-4.6.1.tgz'.format(link)) | ||
| 270 | + run('tar xzf /tmp/solr-4.6.1.tgz -C /tmp/') | ||
| 271 | + run('cp -rf /tmp/solr-4.6.1 ~/solr-4.6.1') | ||
| 272 | + run('mv ~/solr-4.6.1/example ~/solr-4.6.1/colab') | ||
| 273 | + run('chmod +x ~/solr-4.6.1/colab/start.jar') | ||
| 274 | + run('rm /tmp/solr-4.6.1') | ||
| 275 | + | ||
| 276 | + with cd('~/solr-4.6.1/colab/solr/collection1/conf/'): | ||
| 277 | + if not exists('stopwords_en.txt'): | ||
| 278 | + run('cp stopwords.txt stopwords_en.txt') | ||
| 279 | + | ||
| 280 | + | ||
| 281 | +@task | ||
| 282 | +def solr(port=8983): | ||
| 283 | + """Start Solr""" | ||
| 284 | + with cd('~/solr-4.6.1/colab'), settings(user='colab'): | ||
| 285 | + run('java -jar start.jar -Djetty.port={}'.format(port)) | ||
| 264 | # Main | 286 | # Main |
| 265 | environment() | 287 | environment() |