src/Pure/Tools/phabricator.scala
changeset 79516 eeacad2a7aaa
parent 79515 fa581264522e
child 79517 0856026e2c88
equal deleted inserted replaced
79515:fa581264522e 79516:eeacad2a7aaa
    32     def system_path: Path = Path.basic(system_name)
    32     def system_path: Path = Path.basic(system_name)
    33     def root_dir: Path = Path.explode("/etc") + system_path
    33     def root_dir: Path = Path.explode("/etc") + system_path
    34     def sites_dir: Path = root_dir + Path.explode("sites-available")
    34     def sites_dir: Path = root_dir + Path.explode("sites-available")
    35 
    35 
    36     def restart(): Unit = Linux.service_restart(system_name)
    36     def restart(): Unit = Linux.service_restart(system_name)
    37 
       
    38     def systemctl(cmd: String): String = "systemctl " + cmd + " " + system_name
       
    39 
    37 
    40     def php_init(): Unit =
    38     def php_init(): Unit =
    41       File.write(Linux.php_conf_dir(php_name) + Path.basic(isabelle_phabricator_name(ext = "ini")),
    39       File.write(Linux.php_conf_dir(php_name) + Path.basic(isabelle_phabricator_name(ext = "ini")),
    42         "post_max_size = 32M\n" +
    40         "post_max_size = 32M\n" +
    43         "opcache.validate_timestamps = 0\n" +
    41         "opcache.validate_timestamps = 0\n" +
   529   echo "Bad branch: \"$BRANCH\""
   527   echo "Bad branch: \"$BRANCH\""
   530   exit 1
   528   exit 1
   531 fi
   529 fi
   532 
   530 
   533 systemctl stop isabelle-phabricator-phd
   531 systemctl stop isabelle-phabricator-phd
   534 """ + webserver.systemctl("stop"),
   532 systemctl stop """ + webserver.system_name,
   535       body =
   533       body =
   536 """echo -e "\nUpgrading phabricator \"$NAME\" root \"$ROOT\" ..."
   534 """echo -e "\nUpgrading phabricator \"$NAME\" root \"$ROOT\" ..."
   537 for REPO in arcanist phabricator
   535 for REPO in arcanist phabricator
   538 do
   536 do
   539   cd "$ROOT/$REPO"
   537   cd "$ROOT/$REPO"
   543 done
   541 done
   544 echo -e "\nUpgrading storage ..."
   542 echo -e "\nUpgrading storage ..."
   545 "$ROOT/phabricator/bin/storage" upgrade --force
   543 "$ROOT/phabricator/bin/storage" upgrade --force
   546 """,
   544 """,
   547       exit =
   545       exit =
   548         webserver.systemctl("start") + """
   546 """systemctl start """ + webserver.system_name + """
   549 systemctl start isabelle-phabricator-phd""")
   547 systemctl start isabelle-phabricator-phd""")
   550 
   548 
   551 
   549 
   552     /* webserver setup */
   550     /* webserver setup */
   553 
   551