From b00449f403976a2744c8a887bd373d19c047a5f7 Mon Sep 17 00:00:00 2001 From: James Wagner Date: Fri, 31 Oct 2014 17:41:12 -0700 Subject: [PATCH] Add ability to update submoooules with git deployments --- commands/command.deploy.php | 8 ++++++++ default.yaml | 1 + 2 files changed, 9 insertions(+) diff --git a/commands/command.deploy.php b/commands/command.deploy.php index 7321463..9b05924 100644 --- a/commands/command.deploy.php +++ b/commands/command.deploy.php @@ -82,6 +82,10 @@ private function shouldSetPermissionsAfter() { return $this->config['servers'][$this->env]['deploy']['set_permissions_after']; } + private function shouldUpdateSubmodules() { + return $this->config['servers'][$this->env]['deploy']['update_submodules']; + } + private function handleNoEnvironment() { if ($this->env == null) { $output = <<getSshConnection(); if ($this->deployed) { $output = $ssh->exec('git pull'); + + if ($this->shouldUpdateSubmodules()) { + $output .= $ssh->exec('git submodule init; git submodule update'); + } } else { $path_pieces = explode('/', $this->webroot); $dir_name = array_pop($path_pieces); diff --git a/default.yaml b/default.yaml index 8d64f45..4c3f481 100755 --- a/default.yaml +++ b/default.yaml @@ -50,6 +50,7 @@ servers: # pull_content_before: true # clear_cache_after: true # set_permissions_after: false +# update_submodules: false # # == RSYNC == # deploy: