Skip to content

Commit

Permalink
Add ability to update submoooules with git deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiscertain committed Nov 1, 2014
1 parent 93adcbd commit b00449f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions commands/command.deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <<<EOF
Expand Down Expand Up @@ -119,6 +123,10 @@ private function deployWithGit() {
$ssh = $this->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);
Expand Down
1 change: 1 addition & 0 deletions default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ servers:
# pull_content_before: true
# clear_cache_after: true
# set_permissions_after: false
# update_submodules: false
#
# == RSYNC ==
# deploy:
Expand Down

0 comments on commit b00449f

Please sign in to comment.