diff --git a/deploy.sample.php b/deploy.sample.php index 70b477e..ecc6539 100644 --- a/deploy.sample.php +++ b/deploy.sample.php @@ -6,7 +6,7 @@ define("LOGFILE", "deploy.log"); // The name of the file you want to log to. define("GIT", "/usr/bin/git"); // The path to the git executable define("MAX_EXECUTION_TIME", 180); // Override for PHP's max_execution_time (may need set in php.ini) -define("BEFORE_PULL", ""); // A command to execute before pulling +define("BEFORE_PULL", "/usr/bin/git reset --hard @{u}"); // A command to execute before pulling define("AFTER_PULL", ""); // A command to execute after successfully pulling require_once("deployer.php"); diff --git a/deployer.php b/deployer.php index e7bb53d..5b1885c 100644 --- a/deployer.php +++ b/deployer.php @@ -131,7 +131,7 @@ function forbid($file, $reason) { /** * Attempt to pull, returing the output and exit code */ - exec(GIT . " pull 2>&1", $output, $exit); + exec(GIT . " pull --recurse-submodules 2>&1", $output, $exit); // reformat the output as a string $output = (!empty($output) ? implode("\n", $output) : "[no output]") . "\n";