Run database migrations when necessary

Check the output of the `storage status` command for appearance of
"Not Applied" migrations, and run an upgrade if so. This works
around an earlier assumption that the command would exit nonzero
when there are pending migrations, but it seems to exit zero even
under those conditions.

Change-Id: I5ff8026bfaaf31c8abcd55efc217256605be9e73
This commit is contained in:
Jeremy Stanley 2016-12-19 19:22:30 +00:00
parent b63aa4a17b
commit 06bfcaa60e
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ class phabricator::install (
exec { 'load-initial-db': exec { 'load-initial-db':
command => "${phabricator_dir}/phabricator/bin/storage upgrade --force", command => "${phabricator_dir}/phabricator/bin/storage upgrade --force",
unless => "${phabricator_dir}/phabricator/bin/storage status", onlyif => "${phabricator_dir}/phabricator/bin/storage status | grep -q 'Not Applied'",
require => [ require => [
Vcsrepo["${phabricator_dir}/phabricator"], Vcsrepo["${phabricator_dir}/phabricator"],
Vcsrepo["${phabricator_dir}/libphutil"], Vcsrepo["${phabricator_dir}/libphutil"],