Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #207 from mattheath/git-projects
Browse files Browse the repository at this point in the history
Initialise & update git submodules recursively
  • Loading branch information
hiremaga committed Feb 18, 2013
2 parents 8925459 + 16cffc6 commit 169b3fb
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion recipes/git_projects.rb
@@ -1,3 +1,21 @@
# Recipe to clone git repositories into the users workspace_directory
#
# Repositories should be defined as an array in the node_attributes section of
# your `soloistrc` file. eg:
#
# node_attributes:
# git_projects:
# -
# - repository-name (folder to be checked out into within your workspace folder)
# - repository-url (source url)
# -
# - rails
# - git@github.com:rails/rails.git
# -
# - hubot
# - git@github.com:github/hubot.git
#

include_recipe "pivotal_workstation::workspace_directory"

node['git_projects'].each do |repo_name, repo_address, repo_dir|
Expand All @@ -12,7 +30,7 @@
not_if { ::File.exists?("#{WS_HOME}/#{repo_dir}/#{repo_name}") }
end

[ "git branch --set-upstream master origin/master", "git submodule init", "git submodule update" ].each do |git_cmd|
[ "git branch --set-upstream master origin/master", "git submodule update --init --recursive" ].each do |git_cmd|
execute "#{repo_name} - #{git_cmd}" do
command git_cmd
cwd "#{WS_HOME}/#{repo_dir}/#{repo_name}"
Expand Down

0 comments on commit 169b3fb

Please sign in to comment.