src/Pure/Tools/phabricator.scala
changeset 71058 6ca9e8377613
parent 71057 2965304143d8
child 71066 114db2b5a5f8
equal deleted inserted replaced
71057:2965304143d8 71058:6ca9e8377613
   263     val apache_root = Path.explode(options.string("phabricator_apache_root"))
   263     val apache_root = Path.explode(options.string("phabricator_apache_root"))
   264     val apache_sites = apache_root + Path.explode("sites-available")
   264     val apache_sites = apache_root + Path.explode("sites-available")
   265 
   265 
   266     if (!apache_sites.is_dir) error("Bad Apache sites directory " + apache_sites)
   266     if (!apache_sites.is_dir) error("Bad Apache sites directory " + apache_sites)
   267 
   267 
   268     val server_name = phabricator_name(ext = "lvh.me")  // alias for "localhost" for testing
   268     val server_name = phabricator_name(name = name, ext = "lvh.me")  // alias for "localhost" for testing
   269     val server_url = "http://" + server_name
   269     val server_url = "http://" + server_name
   270 
   270 
   271     File.write(apache_sites + Path.basic(isabelle_phabricator_name(ext = "conf")),
   271     File.write(apache_sites + Path.basic(isabelle_phabricator_name(name = name, ext = "conf")),
   272 """<VirtualHost *:80>
   272 """<VirtualHost *:80>
   273     ServerName """ + server_name + """
   273     ServerName """ + server_name + """
   274     ServerAdmin webmaster@localhost
   274     ServerAdmin webmaster@localhost
   275     DocumentRoot """ + config.home.implode + """/webroot
   275     DocumentRoot """ + config.home.implode + """/webroot
   276 
   276 
   283 """)
   283 """)
   284 
   284 
   285     Isabelle_System.bash( """
   285     Isabelle_System.bash( """
   286       set -e
   286       set -e
   287       a2enmod rewrite
   287       a2enmod rewrite
   288       a2ensite """ + Bash.string(isabelle_phabricator_name())).check
   288       a2ensite """ + Bash.string(isabelle_phabricator_name(name = name))).check
   289 
   289 
   290     config.execute("config set phabricator.base-uri " + Bash.string(server_url))
   290     config.execute("config set phabricator.base-uri " + Bash.string(server_url))
   291 
   291 
   292     Linux.service_restart("apache2")
   292     Linux.service_restart("apache2")
   293 
   293