From 06bfcaa60e06af5140a07bdff928cb1050d77f1b Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 19 Dec 2016 19:22:30 +0000 Subject: [PATCH] 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 --- manifests/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index a8e68be..e89c8fb 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -169,7 +169,7 @@ class phabricator::install ( exec { 'load-initial-db': 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 => [ Vcsrepo["${phabricator_dir}/phabricator"], Vcsrepo["${phabricator_dir}/libphutil"],