Skip to content

Commit

Permalink
Merge pull request #6 from thisbythem/git_submodules
Browse files Browse the repository at this point in the history
Add ability to update submodules with git deployments
  • Loading branch information
nobodyiscertain committed Nov 19, 2014
2 parents 93adcbd + b00449f commit c2c07b6
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 c2c07b6

Please sign in to comment.