Permalink
Browse files

can't hurt to make this settable

Not every developer likes having everything under workspace.  That might make sense at
Pivotal, but there is no reason not to set it as an attribute, right?
  • Loading branch information...
1 parent 4f20f35 commit 7aa09b4c3a259f8a23715fa2e315af385d9de93a @knzconnor knzconnor committed Sep 9, 2011
Showing with 9 additions and 8 deletions.
  1. +1 −0 attributes/workspace_directory.rb
  2. +6 −6 recipes/git_projects.rb
  3. +2 −2 recipes/workspace_directory.rb
@@ -0,0 +1 @@
+node.default["workspace_directory"]="workspace"
View
@@ -1,28 +1,28 @@
-include_recipe "pivotal_workstation::workspace_directory"
+include_recipe "ccd_workstation::workspace_directory"
node.git_projects.each do |repo_name, repo_address|
execute "clone #{repo_name}" do
command "git clone #{repo_address} #{repo_name}"
user WS_USER
- cwd "#{WS_HOME}/workspace/"
- not_if { ::File.exists?("#{WS_HOME}/workspace/#{repo_name}") }
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/"
+ not_if { ::File.exists?("#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}") }
end
execute "track origin master" do
command "git branch --set-upstream master origin/master"
- cwd "#{WS_HOME}/workspace/#{repo_name}"
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}"
user WS_USER
end
execute "git submodule init for #{repo_name}" do
command "git submodule init"
- cwd "#{WS_HOME}/workspace/#{repo_name}"
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}"
user WS_USER
end
execute "git submodule update for #{repo_name}" do
command "git submodule update"
- cwd "#{WS_HOME}/workspace/#{repo_name}"
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}"
user WS_USER
end
end
@@ -1,5 +1,5 @@
-directory "#{WS_HOME}/workspace" do
+directory "#{WS_HOME}/#{node["workspace_directory"]}" do
owner WS_USER
mode "0755"
action :create
-end
+end

0 comments on commit 7aa09b4

Please sign in to comment.