282 |
282 |
283 progress.bash(cwd = root_path.file, echo = true, |
283 progress.bash(cwd = root_path.file, echo = true, |
284 script = """ |
284 script = """ |
285 set -e |
285 set -e |
286 echo "Cloning distribution repositories:" |
286 echo "Cloning distribution repositories:" |
287 git clone https://github.com/phacility/libphutil.git |
287 git clone --branch stable https://github.com/phacility/libphutil.git |
288 git clone https://github.com/phacility/arcanist.git |
288 git clone --branch stable https://github.com/phacility/arcanist.git |
289 git clone https://github.com/phacility/phabricator.git |
289 git clone --branch stable https://github.com/phacility/phabricator.git |
290 """).check |
290 """).check |
291 |
291 |
292 val config = Config(name, root_path) |
292 val config = Config(name, root_path) |
293 write_config(configs ::: List(config)) |
293 write_config(configs ::: List(config)) |
294 |
294 |
376 command_setup(dump_name, body = |
376 command_setup(dump_name, body = |
377 """mkdir -p "$ROOT/database" && chown root:root "$ROOT/database" && chmod 700 "$ROOT/database" |
377 """mkdir -p "$ROOT/database" && chown root:root "$ROOT/database" && chmod 700 "$ROOT/database" |
378 [ -e "$ROOT/database/dump.sql.gz" ] && mv -f "$ROOT/database/dump.sql.gz" "$ROOT/database/dump-old.sql.gz" |
378 [ -e "$ROOT/database/dump.sql.gz" ] && mv -f "$ROOT/database/dump.sql.gz" "$ROOT/database/dump-old.sql.gz" |
379 echo "Creating $ROOT/database/dump.sql.gz" |
379 echo "Creating $ROOT/database/dump.sql.gz" |
380 "$ROOT/phabricator/bin/storage" dump --compress --output "$ROOT/database/dump.sql.gz" 2>&1 | fgrep -v '[Warning] Using a password on the command line interface can be insecure' """) |
380 "$ROOT/phabricator/bin/storage" dump --compress --output "$ROOT/database/dump.sql.gz" 2>&1 | fgrep -v '[Warning] Using a password on the command line interface can be insecure' """) |
|
381 |
|
382 |
|
383 /* Phabricator upgrade */ |
|
384 |
|
385 command_setup(isabelle_phabricator_name(name = "upgrade"), |
|
386 init = |
|
387 """BRANCH="${1:stable}" |
|
388 if [ "$BRANCH" != "master" -a "$BRANCH" != "stable" ] |
|
389 then |
|
390 echo "Bad branch: \"$BRANCH\"" |
|
391 exit 1 |
|
392 fi |
|
393 |
|
394 systemctl stop isabelle-phabricator-phd |
|
395 systemctl stop apache2 |
|
396 """, |
|
397 body = |
|
398 """echo -e "\nUpgrading phabricator \"$NAME\" root \"$ROOT\" ..." |
|
399 for REPO in libphutil arcanist phabricator |
|
400 do |
|
401 cd "$ROOT/$REPO" |
|
402 echo -e "\nUpdating \"$REPO\" ..." |
|
403 git checkout "$BRANCH" |
|
404 git pull |
|
405 done |
|
406 echo -e "\nUpgrading storage ..." |
|
407 "$ROOT/phabricator/bin/storage" upgrade --force |
|
408 """, |
|
409 exit = |
|
410 """systemctl start apache2 |
|
411 systemctl start isabelle-phabricator-phd""") |
381 |
412 |
382 |
413 |
383 /* PHP setup */ |
414 /* PHP setup */ |
384 |
415 |
385 val php_version = |
416 val php_version = |