@task(aliases=['elastic'])
def elasticsearch(ctx):
 import platform
 if (platform.linux_distribution()[0] == 'Ubuntu'):
  ctx.run('sudo service elasticsearch start')
 elif (platform.system() == 'Darwin'):
  ctx.run('elasticsearch')
 else:
  print 'Your system is not recognized, you will have to start elasticsearch manually'

@ task ( aliases = [ 'elastic' ] ) def elasticsearch ( ctx ) : import platform if ( platform . linux_distribution ( ) [ 0 ] == 'Ubuntu' ) : ctx . run ( 'sudo service elasticsearch start' ) elif ( platform . system ( ) == 'Darwin' ) : ctx . run ( 'elasticsearch' ) else : print 'Your system is not recognized, you will have to start elasticsearch manually'
start a local elasticsearch server note: requires that elasticsearch is installed .