test_pivotal_workstation 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.markdown +31 -0
  5. data/Rakefile +1 -0
  6. data/lib/test_pivotal_workstation.rb +5 -0
  7. data/lib/test_pivotal_workstation/attributes/default.rb +20 -0
  8. data/lib/test_pivotal_workstation/attributes/git_pairs.rb +5 -0
  9. data/lib/test_pivotal_workstation/attributes/git_projects.rb +3 -0
  10. data/lib/test_pivotal_workstation/attributes/github_for_mac.rb +4 -0
  11. data/lib/test_pivotal_workstation/attributes/gitx.rb +1 -0
  12. data/lib/test_pivotal_workstation/attributes/mouse_locator.rb +5 -0
  13. data/lib/test_pivotal_workstation/attributes/nginx.rb +11 -0
  14. data/lib/test_pivotal_workstation/attributes/pg_admin.rb +4 -0
  15. data/lib/test_pivotal_workstation/attributes/rvm.rb +8 -0
  16. data/lib/test_pivotal_workstation/attributes/sizeup.rb +1 -0
  17. data/lib/test_pivotal_workstation/attributes/versions.rb +6 -0
  18. data/lib/test_pivotal_workstation/attributes/vim.rb +2 -0
  19. data/lib/test_pivotal_workstation/attributes/workspace_directory.rb +1 -0
  20. data/lib/test_pivotal_workstation/libraries/applescript.rb +5 -0
  21. data/lib/test_pivotal_workstation/libraries/bash_profile_include.rb +11 -0
  22. data/lib/test_pivotal_workstation/libraries/brew.rb +38 -0
  23. data/lib/test_pivotal_workstation/libraries/directories.rb +25 -0
  24. data/lib/test_pivotal_workstation/libraries/marker.rb +42 -0
  25. data/lib/test_pivotal_workstation/libraries/osx_app.rb +97 -0
  26. data/lib/test_pivotal_workstation/libraries/rvm_ruby_install.rb +36 -0
  27. data/lib/test_pivotal_workstation/libraries/user.rb +4 -0
  28. data/lib/test_pivotal_workstation/libraries/version.rb +9 -0
  29. data/lib/test_pivotal_workstation/providers/package.rb +95 -0
  30. data/lib/test_pivotal_workstation/recipes/ack.rb +1 -0
  31. data/lib/test_pivotal_workstation/recipes/active_corners.rb +24 -0
  32. data/lib/test_pivotal_workstation/recipes/activemq.rb +1 -0
  33. data/lib/test_pivotal_workstation/recipes/bash_path_order.rb +13 -0
  34. data/lib/test_pivotal_workstation/recipes/bash_profile-arch_flags.rb +1 -0
  35. data/lib/test_pivotal_workstation/recipes/bash_profile-better_history.rb +1 -0
  36. data/lib/test_pivotal_workstation/recipes/bash_profile-no_sudo_gem_install.rb +1 -0
  37. data/lib/test_pivotal_workstation/recipes/bash_profile-ps1.rb +1 -0
  38. data/lib/test_pivotal_workstation/recipes/bash_profile-ree_settings.rb +1 -0
  39. data/lib/test_pivotal_workstation/recipes/bash_profile.rb +11 -0
  40. data/lib/test_pivotal_workstation/recipes/ccmenu.rb +6 -0
  41. data/lib/test_pivotal_workstation/recipes/chrome.rb +6 -0
  42. data/lib/test_pivotal_workstation/recipes/default_editor.rb +55 -0
  43. data/lib/test_pivotal_workstation/recipes/defaults_fast_key_repeat_rate.rb +10 -0
  44. data/lib/test_pivotal_workstation/recipes/disable_front_row.rb +4 -0
  45. data/lib/test_pivotal_workstation/recipes/dock_preferences.rb +13 -0
  46. data/lib/test_pivotal_workstation/recipes/dropbox.rb +6 -0
  47. data/lib/test_pivotal_workstation/recipes/ec2_api_tools.rb +3 -0
  48. data/lib/test_pivotal_workstation/recipes/finder_display_full_path.rb +4 -0
  49. data/lib/test_pivotal_workstation/recipes/firefox.rb +5 -0
  50. data/lib/test_pivotal_workstation/recipes/gem_no_rdoc_no_ri.rb +14 -0
  51. data/lib/test_pivotal_workstation/recipes/git.rb +8 -0
  52. data/lib/test_pivotal_workstation/recipes/git_config_global_defaults.rb +72 -0
  53. data/lib/test_pivotal_workstation/recipes/git_projects.rb +29 -0
  54. data/lib/test_pivotal_workstation/recipes/git_scripts.rb +19 -0
  55. data/lib/test_pivotal_workstation/recipes/github_for_mac.rb +25 -0
  56. data/lib/test_pivotal_workstation/recipes/github_ssh_keys.rb +16 -0
  57. data/lib/test_pivotal_workstation/recipes/gitx.rb +56 -0
  58. data/lib/test_pivotal_workstation/recipes/global_environment_variables.rb +3 -0
  59. data/lib/test_pivotal_workstation/recipes/google_chrome_prevent_updates.rb +10 -0
  60. data/lib/test_pivotal_workstation/recipes/homebrew.rb +27 -0
  61. data/lib/test_pivotal_workstation/recipes/imagemagick.rb +3 -0
  62. data/lib/test_pivotal_workstation/recipes/inputrc.rb +6 -0
  63. data/lib/test_pivotal_workstation/recipes/iterm_set_defaults.rb +167 -0
  64. data/lib/test_pivotal_workstation/recipes/java.rb +8 -0
  65. data/lib/test_pivotal_workstation/recipes/joe.rb +3 -0
  66. data/lib/test_pivotal_workstation/recipes/libreoffice.rb +6 -0
  67. data/lib/test_pivotal_workstation/recipes/lion_basedev.rb +38 -0
  68. data/lib/test_pivotal_workstation/recipes/locate_on.rb +8 -0
  69. data/lib/test_pivotal_workstation/recipes/memcached.rb +20 -0
  70. data/lib/test_pivotal_workstation/recipes/mongodb.rb +20 -0
  71. data/lib/test_pivotal_workstation/recipes/mouse_locator.rb +54 -0
  72. data/lib/test_pivotal_workstation/recipes/mysql.rb +44 -0
  73. data/lib/test_pivotal_workstation/recipes/nginx.rb +46 -0
  74. data/lib/test_pivotal_workstation/recipes/osx_updates.rb +3 -0
  75. data/lib/test_pivotal_workstation/recipes/pg_admin.rb +4 -0
  76. data/lib/test_pivotal_workstation/recipes/pivotal_logos.rb +101 -0
  77. data/lib/test_pivotal_workstation/recipes/postgres.rb +89 -0
  78. data/lib/test_pivotal_workstation/recipes/remove_garageband.rb +11 -0
  79. data/lib/test_pivotal_workstation/recipes/rubymine.rb +8 -0
  80. data/lib/test_pivotal_workstation/recipes/rubymine_preferences_pivotal.rb +36 -0
  81. data/lib/test_pivotal_workstation/recipes/rvm.rb +53 -0
  82. data/lib/test_pivotal_workstation/recipes/safari_preferences.rb +4 -0
  83. data/lib/test_pivotal_workstation/recipes/screen_sharing_app.rb +12 -0
  84. data/lib/test_pivotal_workstation/recipes/screen_sharing_on.rb +16 -0
  85. data/lib/test_pivotal_workstation/recipes/selenium_webdriver.rb +24 -0
  86. data/lib/test_pivotal_workstation/recipes/set_finder_show_hd_on_desktop.rb +4 -0
  87. data/lib/test_pivotal_workstation/recipes/set_multitouch_preferences.rb +9 -0
  88. data/lib/test_pivotal_workstation/recipes/set_screensaver_preferences.rb +21 -0
  89. data/lib/test_pivotal_workstation/recipes/sizeup.rb +19 -0
  90. data/lib/test_pivotal_workstation/recipes/skype.rb +5 -0
  91. data/lib/test_pivotal_workstation/recipes/ssh_copy_id.rb +3 -0
  92. data/lib/test_pivotal_workstation/recipes/sshd_on.rb +16 -0
  93. data/lib/test_pivotal_workstation/recipes/ssl_certificate.rb +50 -0
  94. data/lib/test_pivotal_workstation/recipes/svn.rb +1 -0
  95. data/lib/test_pivotal_workstation/recipes/terminal_focus.rb +4 -0
  96. data/lib/test_pivotal_workstation/recipes/terminal_preferences.rb +9 -0
  97. data/lib/test_pivotal_workstation/recipes/textmate.rb +29 -0
  98. data/lib/test_pivotal_workstation/recipes/textmate_plugins.rb +31 -0
  99. data/lib/test_pivotal_workstation/recipes/textmate_preferences.rb +83 -0
  100. data/lib/test_pivotal_workstation/recipes/timemachine_preferences.rb +22 -0
  101. data/lib/test_pivotal_workstation/recipes/user_owns_usr_local.rb +8 -0
  102. data/lib/test_pivotal_workstation/recipes/vim.rb +66 -0
  103. data/lib/test_pivotal_workstation/recipes/virtualbox.rb +7 -0
  104. data/lib/test_pivotal_workstation/recipes/workspace_directory.rb +5 -0
  105. data/lib/test_pivotal_workstation/resources/package.rb +34 -0
  106. data/lib/test_pivotal_workstation/templates/default/bash_profile-arch_flags.sh.erb +3 -0
  107. data/lib/test_pivotal_workstation/templates/default/bash_profile-better_history.sh.erb +4 -0
  108. data/lib/test_pivotal_workstation/templates/default/bash_profile-ec2_tools.sh.erb +5 -0
  109. data/lib/test_pivotal_workstation/templates/default/bash_profile-git_vim.sh.erb +1 -0
  110. data/lib/test_pivotal_workstation/templates/default/bash_profile-no_sudo_gem_install.sh.erb +2 -0
  111. data/lib/test_pivotal_workstation/templates/default/bash_profile-ps1.sh.erb +8 -0
  112. data/lib/test_pivotal_workstation/templates/default/bash_profile-ree_settings.sh.erb +6 -0
  113. data/lib/test_pivotal_workstation/templates/default/bash_profile-rvm.sh.erb +1 -0
  114. data/lib/test_pivotal_workstation/templates/default/bash_profile-vi_is_minimal_vim.sh.erb +1 -0
  115. data/lib/test_pivotal_workstation/templates/default/bash_profile.erb +6 -0
  116. data/lib/test_pivotal_workstation/templates/default/git_scripts_pairs.erb +12 -0
  117. data/lib/test_pivotal_workstation/templates/default/inputrc.erb +10 -0
  118. data/lib/test_pivotal_workstation/templates/default/launchd.conf.erb +6 -0
  119. data/lib/test_pivotal_workstation/templates/default/nginx.conf.erb +79 -0
  120. data/lib/test_pivotal_workstation/templates/default/org.nginx.nginx.plist.erb +22 -0
  121. data/lib/test_pivotal_workstation/templates/default/pivotal_logos-dsimport.erb +2 -0
  122. data/lib/test_pivotal_workstation/version.rb +3 -0
  123. data/test_pivotal_workstation.gemspec +24 -0
  124. metadata +168 -0
@@ -0,0 +1,95 @@
1
+ #
2
+ # Cookbook Name:: dmg
3
+ # Provider:: package
4
+ #
5
+ # Copyright 2011, Joshua Timberman
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ def load_current_resource
21
+ @dmgpkg = Chef::Resource::PivotalWorkstationPackage.new(new_resource.name)
22
+ @dmgpkg.app(new_resource.app)
23
+ Chef::Log.debug("Checking for application #{new_resource.app}")
24
+ installed = (new_resource.type == "app") ? (::File.directory?("#{new_resource.destination}/#{new_resource.app}.app")) : system("pkgutil --pkgs=#{new_resource.package_id}")
25
+ @dmgpkg.installed(installed)
26
+ end
27
+
28
+ action :install do
29
+ unless @dmgpkg.installed
30
+
31
+ volumes_dir = new_resource.volumes_dir ? new_resource.volumes_dir : new_resource.app
32
+ dmg_name = new_resource.dmg_name ? new_resource.dmg_name : new_resource.app
33
+ dmg_file = "#{Chef::Config[:file_cache_path]}/#{dmg_name}.dmg"
34
+
35
+ # cachedir needs to be writeable by admin grp because downloads
36
+ # may be done by non-root users. Also, on brand-new machines
37
+ # this directory doesn't exist & needs to be created.
38
+ directory Chef::Config[:file_cache_path] do
39
+ owner "root"
40
+ group "admin"
41
+ mode 0775
42
+ action :create
43
+ recursive true
44
+ end
45
+
46
+ if new_resource.source
47
+ remote_file dmg_file do
48
+ source new_resource.source
49
+ checksum new_resource.checksum if new_resource.checksum
50
+ group "admin"
51
+ mode 0644
52
+ end
53
+ end
54
+
55
+ ruby_block "attach #{dmg_file}" do
56
+ block do
57
+ software_license_agreement = system("hdiutil imageinfo #{dmg_file} | grep -q 'Software License Agreement: true'")
58
+ confirm_mount_cmd = software_license_agreement ? "echo Y |" : ""
59
+ system "#{confirm_mount_cmd} hdiutil attach '#{dmg_file}'"
60
+ end
61
+ not_if "hdiutil info | grep -q 'image-path.*#{dmg_file}'"
62
+ end
63
+
64
+ case new_resource.type
65
+ when "app"
66
+ # use "rsync -aH" instead of "cp -r" because rsync
67
+ # won't exit(1) when it hits a bad symbolic link (e.g.
68
+ # Dropbox's site.py). The "-H" flag is to copy
69
+ # hard-links, and mostly to show how cool I am.
70
+ execute "rsync -aH '/Volumes/#{volumes_dir}/#{new_resource.app}.app' '#{new_resource.destination}'" do
71
+ user WS_USER
72
+ group "admin"
73
+ end
74
+ file "#{new_resource.destination}/#{new_resource.app}.app/Contents/MacOS/#{new_resource.app}" do
75
+ mode 0755
76
+ ignore_failure true
77
+ end
78
+ when "mpkg"
79
+ ruby_block "installing /Volumes/#{volumes_dir}/#{new_resource.app}.*pkg" do
80
+ block do
81
+ if ::File.exists?("/Volumes/#{volumes_dir}/#{new_resource.app}.mpkg")
82
+ `sudo installer -pkg '/Volumes/#{volumes_dir}/#{new_resource.app}.mpkg' -target /`
83
+ # Some packages, e.g. Lion's Java, end in ".pkg", not ".mpkg"
84
+ elsif ::File.exists?("/Volumes/#{volumes_dir}/#{new_resource.app}.pkg")
85
+ `sudo installer -pkg '/Volumes/#{volumes_dir}/#{new_resource.app}.pkg' -target /`
86
+ else
87
+ raise "I couldn't find /Volumes/#{volumes_dir}/#{new_resource.app}.mpkg"
88
+ end
89
+ end
90
+ end
91
+ end
92
+
93
+ execute "hdiutil detach '/Volumes/#{volumes_dir}'"
94
+ end
95
+ end
@@ -0,0 +1 @@
1
+ brew_install "ack"
@@ -0,0 +1,24 @@
1
+ active_corner_value_to_int = {
2
+ :all_windows => 2,
3
+ :dashboard => 7
4
+ }
5
+
6
+ corners = {
7
+ :tl => :all_windows,
8
+ :tr => :dashboard
9
+ }
10
+
11
+ corners.each do |corner, value|
12
+ execute "#{corner} right #{value}" do
13
+ command "defaults write com.apple.dock wvous-#{corner}-corner -int #{active_corner_value_to_int[value]}"
14
+ user WS_USER
15
+ end
16
+ execute "#{corner} modifier" do
17
+ command "defaults write com.apple.dock wvous-#{corner}-modifier -int 0"
18
+ user WS_USER
19
+ end
20
+ end
21
+
22
+ execute "relaunch dock" do
23
+ command "killall Dock"
24
+ end
@@ -0,0 +1 @@
1
+ brew_install("activemq")
@@ -0,0 +1,13 @@
1
+ run_unless_marker_file_exists("bash_path_order") do
2
+ ruby_block "put /usr/local/bin first in path" do
3
+ block do
4
+ new_contents = ""
5
+ File.open("/etc/paths", "r") do |file|
6
+ new_contents = "/usr/local/bin\n"+file.read.gsub("/usr/local/bin\n", "")
7
+ end
8
+ File.open("/etc/paths", "w") do |file|
9
+ file.write(new_contents)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ bash_profile_include("arch_flags")
@@ -0,0 +1 @@
1
+ bash_profile_include("better_history")
@@ -0,0 +1 @@
1
+ bash_profile_include("no_sudo_gem_install")
@@ -0,0 +1 @@
1
+ bash_profile_include("ps1")
@@ -0,0 +1 @@
1
+ bash_profile_include("ree_settings")
@@ -0,0 +1,11 @@
1
+ ::BASH_INCLUDES_DIRNAME = ".bash_profile_includes"
2
+ ::BASH_INCLUDES_SUBDIR = File.expand_path("#{WS_HOME}/#{BASH_INCLUDES_DIRNAME}")
3
+
4
+ directory BASH_INCLUDES_SUBDIR do
5
+ owner WS_USER
6
+ end
7
+
8
+ template "#{WS_HOME}/.bash_profile" do
9
+ source "bash_profile.erb"
10
+ owner WS_USER
11
+ end
@@ -0,0 +1,6 @@
1
+ pivotal_workstation_package "CCMenu" do
2
+ volumes_dir "CCMenu 1.3"
3
+ source "http://cdnetworks-us-2.dl.sourceforge.net/project/ccmenu/CCMenu/1.3/ccmenu-1.3-b.dmg"
4
+ checksum "9afef887022002b0f074eb7db25349da53aea5d5a64d8415b756c676db9ad1de"
5
+ action :install
6
+ end
@@ -0,0 +1,6 @@
1
+ pivotal_workstation_package "Google Chrome" do
2
+ dmg_name "googlechrome"
3
+ source "https://dl-ssl.google.com/chrome/mac/stable/GGRM/googlechrome.dmg"
4
+ checksum "7daa2dc5c46d9bfb14f1d7ff4b33884325e5e63e694810adc58f14795165c91a"
5
+ action :install
6
+ end
@@ -0,0 +1,55 @@
1
+ include_recipe "pivotal_workstation::textmate"
2
+
3
+ # This sets TextMate to be the default editor for
4
+ # .xml, .rb, .erb, .plain-text, .yml, .yaml
5
+ #ls_handler_role_all="com.macromates.textmate"
6
+ ls_handler_role_all="com.macromates.textmate"
7
+ gem_package("plist")
8
+
9
+ plist_file = "#{ENV['HOME']}/Library/Preferences/com.apple.LaunchServices.plist"
10
+ ruby_block "Set the default editor" do
11
+ block do
12
+ Gem.clear_paths
13
+ require 'rubygems'
14
+ require 'plist'
15
+ `plutil -convert xml1 #{plist_file}`
16
+ ls_handler_plist = Plist::parse_xml(plist_file)
17
+ new_ls_handlers = [
18
+ { "LSHandlerContentType" => "public.plain-text",
19
+ "LSHandlerRoleAll" => ls_handler_role_all
20
+ },
21
+ { "LSHandlerContentType" => "public.ruby-script",
22
+ "LSHandlerRoleAll" => ls_handler_role_all
23
+ },
24
+ { "LSHandlerContentType" => "org.vim.yaml-file",
25
+ "LSHandlerRoleAll" => ls_handler_role_all
26
+ },
27
+ { "LSHandlerContentType" => "public.xml",
28
+ "LSHandlerRoleAll" => ls_handler_role_all
29
+ }
30
+ ]
31
+ # I go through the old_ls_handlers and remove all
32
+ # the ones that we're going to replace.
33
+ new_ls_handlers.each do |new_hash|
34
+ new_hash.each do |new_key,new_value|
35
+ if new_key == "LSHandlerContentType"
36
+ ls_handler_plist["LSHandlers"].each do |old_hash|
37
+ old_hash.each do |old_key,old_value|
38
+ if new_value == old_value and new_key == old_key
39
+ ls_handler_plist["LSHandlers"].delete(old_hash)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ ls_handler_plist["LSHandlers"] = ls_handler_plist["LSHandlers"] + new_ls_handlers
47
+ File.open(plist_file, "w") do |plist_handle|
48
+ plist_handle.puts Plist::Emit.dump(ls_handler_plist)
49
+ end
50
+ # rebuild the launch services database; this took 6 hours to figure out.
51
+ `su #{WS_USER} -c "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user"`
52
+ # restart the Finder with the new icons
53
+ `killall Finder`
54
+ end
55
+ end
@@ -0,0 +1,10 @@
1
+ execute "set key repeat rate to fast" do
2
+ command "defaults write ~/Library/Preferences/.GlobalPreferences KeyRepeat -int 2"
3
+ user WS_USER
4
+ end
5
+
6
+ execute "set key initial repeat delay to short" do
7
+ command "defaults write ~/Library/Preferences/.GlobalPreferences InitialKeyRepeat -int 15"
8
+ user WS_USER
9
+ end
10
+
@@ -0,0 +1,4 @@
1
+ execute "move front row out of the way" do
2
+ command "mv /System/Library/CoreServices/Front\\ Row.app /System/Library/CoreServices/Front_Row_disabled.app"
3
+ not_if { File.exists?("/System/Library/CoreServices/Front_Row_disabled.app") }
4
+ end
@@ -0,0 +1,13 @@
1
+ execute "set dock to be on left" do
2
+ command "defaults write com.apple.dock orientation -string left"
3
+ user WS_USER
4
+ end
5
+
6
+ execute "set dock to autohide" do
7
+ command "defaults write com.apple.dock autohide -boolean true"
8
+ user WS_USER
9
+ end
10
+
11
+ execute "relaunch dock" do
12
+ command "killall Dock"
13
+ end
@@ -0,0 +1,6 @@
1
+ pivotal_workstation_package "Dropbox" do
2
+ volumes_dir "Dropbox Installer"
3
+ source "http://www.dropbox.com/download?plat=mac"
4
+ checksum "a721c6e7fa9ae0d07f220901764ac65190d9299c7a0b62cd8a6822a27365e275"
5
+ action :install
6
+ end
@@ -0,0 +1,3 @@
1
+ brew_install "ec2-api-tools"
2
+
3
+ bash_profile_include("ec2_tools")
@@ -0,0 +1,4 @@
1
+ execute "set finder to display full path in title bar" do
2
+ command "defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES"
3
+ user WS_USER
4
+ end
@@ -0,0 +1,5 @@
1
+ pivotal_workstation_package "Firefox" do
2
+ source "http://download.mozilla.org/?product=firefox-6.0.2&os=osx&lang=en-US"
3
+ action :install
4
+ checksum "6c594a3bbd642dcdbf34cdcfa67fd1ec89855f37cbd42feea7813e625335c19c"
5
+ end
@@ -0,0 +1,14 @@
1
+ file "/etc/gemrc" do
2
+ owner "root"
3
+ group "wheel"
4
+ mode "0644"
5
+ action :create
6
+ content "install: --no-rdoc --no-ri\nupdate: --no-rdoc --no-ri\n"
7
+ end
8
+
9
+ unless File.exists?("#{WS_HOME}/.gemrc")
10
+ execute "link .gemrc to /etc/gemrc" do
11
+ command "ln -s /etc/gemrc #{WS_HOME}/.gemrc"
12
+ user WS_USER
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ unless system("git --version | grep 'git version' > /dev/null")
2
+ include_recipe "pivotal_workstation::homebrew"
3
+
4
+ execute "brew install git" do
5
+ user WS_USER
6
+ command "brew install git"
7
+ end
8
+ end
@@ -0,0 +1,72 @@
1
+ include_recipe "pivotal_workstation::git"
2
+ bash_profile_include("git_vim")
3
+
4
+ execute "set alias st=status" do
5
+ command "git config --global alias.st status"
6
+ user WS_USER
7
+ end
8
+
9
+ execute "set alias di=diff" do
10
+ command "git config --global alias.di diff"
11
+ user WS_USER
12
+ end
13
+
14
+ execute "set alias co=checkout" do
15
+ command "git config --global alias.co checkout"
16
+ user WS_USER
17
+ end
18
+
19
+ execute "set alias ci=commit" do
20
+ command "git config --global alias.ci commit"
21
+ user WS_USER
22
+ end
23
+
24
+ execute "set alias br=branch" do
25
+ command "git config --global alias.br branch"
26
+ user WS_USER
27
+ end
28
+
29
+ execute "set alias sta=stash" do
30
+ command "git config --global alias.sta stash"
31
+ user WS_USER
32
+ end
33
+
34
+ execute "set alias llog=log --date=local" do
35
+ command "git config --global alias.llog log --date=local"
36
+ user WS_USER
37
+ end
38
+
39
+ execute "set apply whitespace=nowarn" do
40
+ command "git config --global apply.whitespace nowarn"
41
+ user WS_USER
42
+ end
43
+
44
+ execute "set color branch=auto" do
45
+ command "git config --global color.branch auto"
46
+ user WS_USER
47
+ end
48
+
49
+ execute "set color diff=auto" do
50
+ command "git config --global color.diff auto"
51
+ user WS_USER
52
+ end
53
+
54
+ execute "set color interactive=auto" do
55
+ command "git config --global color.interactive auto"
56
+ user WS_USER
57
+ end
58
+
59
+ execute "set color status=auto" do
60
+ command "git config --global color.status auto"
61
+ user WS_USER
62
+ end
63
+
64
+ execute "set color ui=auto" do
65
+ command "git config --global color.ui auto"
66
+ user WS_USER
67
+ end
68
+
69
+ execute "set branch autosetupmerge=true" do
70
+ command "git config --global branch.autosetupmerge true"
71
+ user WS_USER
72
+ end
@@ -0,0 +1,29 @@
1
+ include_recipe "pivotal_workstation::workspace_directory"
2
+
3
+ node.git_projects.each do |repo_name, repo_address|
4
+ execute "clone #{repo_name}" do
5
+ command "git clone #{repo_address} #{repo_name}"
6
+ user WS_USER
7
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/"
8
+ not_if { ::File.exists?("#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}") }
9
+ end
10
+
11
+ execute "track origin master" do
12
+ command "git branch --set-upstream master origin/master"
13
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}"
14
+ user WS_USER
15
+ end
16
+
17
+ execute "git submodule init for #{repo_name}" do
18
+ command "git submodule init"
19
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}"
20
+ user WS_USER
21
+ end
22
+
23
+ execute "git submodule update for #{repo_name}" do
24
+ command "git submodule update"
25
+ cwd "#{WS_HOME}/#{node['workspace_directory']}/#{repo_name}"
26
+ user WS_USER
27
+ end
28
+ end
29
+
@@ -0,0 +1,19 @@
1
+ include_recipe "pivotal_workstation::user_owns_usr_local"
2
+
3
+ execute "put git-scripts in /usr/local/bin" do
4
+ command "cd /usr/local/bin && curl -L http://github.com/pivotal/git_scripts/tarball/master | gunzip | tar xvf - --strip=2"
5
+ user WS_USER
6
+ not_if "which git-pair"
7
+ end
8
+
9
+ template "#{WS_HOME}/.pairs" do
10
+ owner WS_USER
11
+ source "git_scripts_pairs.erb"
12
+ end
13
+
14
+ ruby_block "test that git pair works" do
15
+ block do
16
+ raise "git pair doesn't work" if `which git-pair`.empty?
17
+ end
18
+ end
19
+