@task
@cmdopts([('geoserver=', 'g', 'The location of the geoserver build (.war file).'), ('jetty=', 'j', 'The location of the Jetty Runner (.jar file).')])
def setup_geoserver(options):
 download_dir = path('downloaded')
 if (not download_dir.exists()):
  download_dir.makedirs()
 geoserver_dir = path('geoserver')
 geoserver_bin = (download_dir / os.path.basename(dev_config['GEOSERVER_URL']))
 jetty_runner = (download_dir / os.path.basename(dev_config['JETTY_RUNNER_URL']))
 grab(options.get('geoserver', dev_config['GEOSERVER_URL']), geoserver_bin, 'geoserver binary')
 grab(options.get('jetty', dev_config['JETTY_RUNNER_URL']), jetty_runner, 'jetty runner')
 if (not geoserver_dir.exists()):
  geoserver_dir.makedirs()
  webapp_dir = (geoserver_dir / 'geoserver')
  if (not webapp_dir):
   webapp_dir.makedirs()
  print 'extracting geoserver'
  z = zipfile.ZipFile(geoserver_bin, 'r')
  z.extractall(webapp_dir)
 _install_data_dir()

@ task @ cmdopts ( [ ( 'geoserver=' , 'g' , 'The location of the geoserver build (.war file).' ) , ( 'jetty=' , 'j' , 'The location of the Jetty Runner (.jar file).' ) ] ) def setup_geoserver ( options ) : download_dir = path ( 'downloaded' ) if ( not download_dir . exists ( ) ) : download_dir . makedirs ( ) geoserver_dir = path ( 'geoserver' ) geoserver_bin = ( download_dir / os . path . basename ( dev_config [ 'GEOSERVER_URL' ] ) ) jetty_runner = ( download_dir / os . path . basename ( dev_config [ 'JETTY_RUNNER_URL' ] ) ) grab ( options . get ( 'geoserver' , dev_config [ 'GEOSERVER_URL' ] ) , geoserver_bin , 'geoserver binary' ) grab ( options . get ( 'jetty' , dev_config [ 'JETTY_RUNNER_URL' ] ) , jetty_runner , 'jetty runner' ) if ( not geoserver_dir . exists ( ) ) : geoserver_dir . makedirs ( ) webapp_dir = ( geoserver_dir / 'geoserver' ) if ( not webapp_dir ) : webapp_dir . makedirs ( ) print 'extracting geoserver' z = zipfile . ZipFile ( geoserver_bin , 'r' ) z . extractall ( webapp_dir ) _install_data_dir ( )
prepare a testing instance of geoserver .