test_pivotal_workstation 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.markdown +31 -0
- data/Rakefile +1 -0
- data/lib/test_pivotal_workstation.rb +5 -0
- data/lib/test_pivotal_workstation/attributes/default.rb +20 -0
- data/lib/test_pivotal_workstation/attributes/git_pairs.rb +5 -0
- data/lib/test_pivotal_workstation/attributes/git_projects.rb +3 -0
- data/lib/test_pivotal_workstation/attributes/github_for_mac.rb +4 -0
- data/lib/test_pivotal_workstation/attributes/gitx.rb +1 -0
- data/lib/test_pivotal_workstation/attributes/mouse_locator.rb +5 -0
- data/lib/test_pivotal_workstation/attributes/nginx.rb +11 -0
- data/lib/test_pivotal_workstation/attributes/pg_admin.rb +4 -0
- data/lib/test_pivotal_workstation/attributes/rvm.rb +8 -0
- data/lib/test_pivotal_workstation/attributes/sizeup.rb +1 -0
- data/lib/test_pivotal_workstation/attributes/versions.rb +6 -0
- data/lib/test_pivotal_workstation/attributes/vim.rb +2 -0
- data/lib/test_pivotal_workstation/attributes/workspace_directory.rb +1 -0
- data/lib/test_pivotal_workstation/libraries/applescript.rb +5 -0
- data/lib/test_pivotal_workstation/libraries/bash_profile_include.rb +11 -0
- data/lib/test_pivotal_workstation/libraries/brew.rb +38 -0
- data/lib/test_pivotal_workstation/libraries/directories.rb +25 -0
- data/lib/test_pivotal_workstation/libraries/marker.rb +42 -0
- data/lib/test_pivotal_workstation/libraries/osx_app.rb +97 -0
- data/lib/test_pivotal_workstation/libraries/rvm_ruby_install.rb +36 -0
- data/lib/test_pivotal_workstation/libraries/user.rb +4 -0
- data/lib/test_pivotal_workstation/libraries/version.rb +9 -0
- data/lib/test_pivotal_workstation/providers/package.rb +95 -0
- data/lib/test_pivotal_workstation/recipes/ack.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/active_corners.rb +24 -0
- data/lib/test_pivotal_workstation/recipes/activemq.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/bash_path_order.rb +13 -0
- data/lib/test_pivotal_workstation/recipes/bash_profile-arch_flags.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/bash_profile-better_history.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/bash_profile-no_sudo_gem_install.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/bash_profile-ps1.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/bash_profile-ree_settings.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/bash_profile.rb +11 -0
- data/lib/test_pivotal_workstation/recipes/ccmenu.rb +6 -0
- data/lib/test_pivotal_workstation/recipes/chrome.rb +6 -0
- data/lib/test_pivotal_workstation/recipes/default_editor.rb +55 -0
- data/lib/test_pivotal_workstation/recipes/defaults_fast_key_repeat_rate.rb +10 -0
- data/lib/test_pivotal_workstation/recipes/disable_front_row.rb +4 -0
- data/lib/test_pivotal_workstation/recipes/dock_preferences.rb +13 -0
- data/lib/test_pivotal_workstation/recipes/dropbox.rb +6 -0
- data/lib/test_pivotal_workstation/recipes/ec2_api_tools.rb +3 -0
- data/lib/test_pivotal_workstation/recipes/finder_display_full_path.rb +4 -0
- data/lib/test_pivotal_workstation/recipes/firefox.rb +5 -0
- data/lib/test_pivotal_workstation/recipes/gem_no_rdoc_no_ri.rb +14 -0
- data/lib/test_pivotal_workstation/recipes/git.rb +8 -0
- data/lib/test_pivotal_workstation/recipes/git_config_global_defaults.rb +72 -0
- data/lib/test_pivotal_workstation/recipes/git_projects.rb +29 -0
- data/lib/test_pivotal_workstation/recipes/git_scripts.rb +19 -0
- data/lib/test_pivotal_workstation/recipes/github_for_mac.rb +25 -0
- data/lib/test_pivotal_workstation/recipes/github_ssh_keys.rb +16 -0
- data/lib/test_pivotal_workstation/recipes/gitx.rb +56 -0
- data/lib/test_pivotal_workstation/recipes/global_environment_variables.rb +3 -0
- data/lib/test_pivotal_workstation/recipes/google_chrome_prevent_updates.rb +10 -0
- data/lib/test_pivotal_workstation/recipes/homebrew.rb +27 -0
- data/lib/test_pivotal_workstation/recipes/imagemagick.rb +3 -0
- data/lib/test_pivotal_workstation/recipes/inputrc.rb +6 -0
- data/lib/test_pivotal_workstation/recipes/iterm_set_defaults.rb +167 -0
- data/lib/test_pivotal_workstation/recipes/java.rb +8 -0
- data/lib/test_pivotal_workstation/recipes/joe.rb +3 -0
- data/lib/test_pivotal_workstation/recipes/libreoffice.rb +6 -0
- data/lib/test_pivotal_workstation/recipes/lion_basedev.rb +38 -0
- data/lib/test_pivotal_workstation/recipes/locate_on.rb +8 -0
- data/lib/test_pivotal_workstation/recipes/memcached.rb +20 -0
- data/lib/test_pivotal_workstation/recipes/mongodb.rb +20 -0
- data/lib/test_pivotal_workstation/recipes/mouse_locator.rb +54 -0
- data/lib/test_pivotal_workstation/recipes/mysql.rb +44 -0
- data/lib/test_pivotal_workstation/recipes/nginx.rb +46 -0
- data/lib/test_pivotal_workstation/recipes/osx_updates.rb +3 -0
- data/lib/test_pivotal_workstation/recipes/pg_admin.rb +4 -0
- data/lib/test_pivotal_workstation/recipes/pivotal_logos.rb +101 -0
- data/lib/test_pivotal_workstation/recipes/postgres.rb +89 -0
- data/lib/test_pivotal_workstation/recipes/remove_garageband.rb +11 -0
- data/lib/test_pivotal_workstation/recipes/rubymine.rb +8 -0
- data/lib/test_pivotal_workstation/recipes/rubymine_preferences_pivotal.rb +36 -0
- data/lib/test_pivotal_workstation/recipes/rvm.rb +53 -0
- data/lib/test_pivotal_workstation/recipes/safari_preferences.rb +4 -0
- data/lib/test_pivotal_workstation/recipes/screen_sharing_app.rb +12 -0
- data/lib/test_pivotal_workstation/recipes/screen_sharing_on.rb +16 -0
- data/lib/test_pivotal_workstation/recipes/selenium_webdriver.rb +24 -0
- data/lib/test_pivotal_workstation/recipes/set_finder_show_hd_on_desktop.rb +4 -0
- data/lib/test_pivotal_workstation/recipes/set_multitouch_preferences.rb +9 -0
- data/lib/test_pivotal_workstation/recipes/set_screensaver_preferences.rb +21 -0
- data/lib/test_pivotal_workstation/recipes/sizeup.rb +19 -0
- data/lib/test_pivotal_workstation/recipes/skype.rb +5 -0
- data/lib/test_pivotal_workstation/recipes/ssh_copy_id.rb +3 -0
- data/lib/test_pivotal_workstation/recipes/sshd_on.rb +16 -0
- data/lib/test_pivotal_workstation/recipes/ssl_certificate.rb +50 -0
- data/lib/test_pivotal_workstation/recipes/svn.rb +1 -0
- data/lib/test_pivotal_workstation/recipes/terminal_focus.rb +4 -0
- data/lib/test_pivotal_workstation/recipes/terminal_preferences.rb +9 -0
- data/lib/test_pivotal_workstation/recipes/textmate.rb +29 -0
- data/lib/test_pivotal_workstation/recipes/textmate_plugins.rb +31 -0
- data/lib/test_pivotal_workstation/recipes/textmate_preferences.rb +83 -0
- data/lib/test_pivotal_workstation/recipes/timemachine_preferences.rb +22 -0
- data/lib/test_pivotal_workstation/recipes/user_owns_usr_local.rb +8 -0
- data/lib/test_pivotal_workstation/recipes/vim.rb +66 -0
- data/lib/test_pivotal_workstation/recipes/virtualbox.rb +7 -0
- data/lib/test_pivotal_workstation/recipes/workspace_directory.rb +5 -0
- data/lib/test_pivotal_workstation/resources/package.rb +34 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-arch_flags.sh.erb +3 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-better_history.sh.erb +4 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-ec2_tools.sh.erb +5 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-git_vim.sh.erb +1 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-no_sudo_gem_install.sh.erb +2 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-ps1.sh.erb +8 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-ree_settings.sh.erb +6 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-rvm.sh.erb +1 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile-vi_is_minimal_vim.sh.erb +1 -0
- data/lib/test_pivotal_workstation/templates/default/bash_profile.erb +6 -0
- data/lib/test_pivotal_workstation/templates/default/git_scripts_pairs.erb +12 -0
- data/lib/test_pivotal_workstation/templates/default/inputrc.erb +10 -0
- data/lib/test_pivotal_workstation/templates/default/launchd.conf.erb +6 -0
- data/lib/test_pivotal_workstation/templates/default/nginx.conf.erb +79 -0
- data/lib/test_pivotal_workstation/templates/default/org.nginx.nginx.plist.erb +22 -0
- data/lib/test_pivotal_workstation/templates/default/pivotal_logos-dsimport.erb +2 -0
- data/lib/test_pivotal_workstation/version.rb +3 -0
- data/test_pivotal_workstation.gemspec +24 -0
- metadata +168 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
#http://solutions.treypiepmeier.com/2010/02/28/installing-mysql-on-snow-leopard-using-homebrew/
|
2
|
+
|
3
|
+
DEFAULT_PIVOTAL_MYSQL_PASSWORD = "password"
|
4
|
+
|
5
|
+
include_recipe "pivotal_workstation::homebrew"
|
6
|
+
|
7
|
+
run_unless_marker_file_exists("mysql_" + marker_version_string_for("homebrew")) do
|
8
|
+
brew_install "mysql"
|
9
|
+
|
10
|
+
directory "/Users/#{WS_USER}/Library/LaunchAgents" do
|
11
|
+
owner WS_USER
|
12
|
+
action :create
|
13
|
+
end
|
14
|
+
|
15
|
+
execute "copy mysql plist to ~/Library/LaunchAgents" do
|
16
|
+
command "cp `brew --prefix mysql`/com.mysql.mysqld.plist #{WS_HOME}/Library/LaunchAgents/"
|
17
|
+
user WS_USER
|
18
|
+
end
|
19
|
+
|
20
|
+
execute "mysql_install_db" do
|
21
|
+
command "mysql_install_db --verbose --user=#{WS_USER} --basedir=\"$(brew --prefix mysql)\" --datadir=/usr/local/var/mysql --tmpdir=/tmp"
|
22
|
+
user WS_USER
|
23
|
+
end
|
24
|
+
|
25
|
+
execute "load the mysql plist into the mac daemon startup thing" do
|
26
|
+
command "launchctl load -w #{WS_HOME}/Library/LaunchAgents/com.mysql.mysqld.plist"
|
27
|
+
user WS_USER
|
28
|
+
end
|
29
|
+
|
30
|
+
ruby_block "wait for mysql to come up" do
|
31
|
+
block do
|
32
|
+
Timeout::timeout(60) do
|
33
|
+
until system("ls /tmp/mysql.sock")
|
34
|
+
sleep 1
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
execute "set the root password to the default" do
|
41
|
+
command "mysqladmin -uroot password #{DEFAULT_PIVOTAL_MYSQL_PASSWORD}"
|
42
|
+
not_if "mysql -uroot -p#{DEFAULT_PIVOTAL_MYSQL_PASSWORD} -e 'show databases'"
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
include_recipe "pivotal_workstation::homebrew"
|
2
|
+
include_recipe "pivotal_workstation::ssl_certificate"
|
3
|
+
|
4
|
+
run_unless_marker_file_exists("nginx") do
|
5
|
+
|
6
|
+
brew_installed = `brew list | grep nginx`
|
7
|
+
unless brew_installed.empty?
|
8
|
+
execute "uninstall nginx" do
|
9
|
+
command "sudo brew remove nginx"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
brew_install "nginx"
|
14
|
+
|
15
|
+
plist_path = File.expand_path('org.nginx.nginx.plist', File.join('~', 'Library', 'LaunchAgents'))
|
16
|
+
if File.exists?(plist_path)
|
17
|
+
log "postgres plist found at #{plist_path}"
|
18
|
+
execute "unload the plist (shuts down the daemon)" do
|
19
|
+
command %'launchctl unload -w #{plist_path}'
|
20
|
+
user "root"
|
21
|
+
end
|
22
|
+
else
|
23
|
+
log "Did not find plist at #{plist_path} don't try to unload it"
|
24
|
+
end
|
25
|
+
|
26
|
+
launch_agents_path = File.expand_path('.', File.join('~', 'Library', 'LaunchAgents'))
|
27
|
+
directory launch_agents_path do
|
28
|
+
action :create
|
29
|
+
recursive true
|
30
|
+
owner WS_USER
|
31
|
+
end
|
32
|
+
|
33
|
+
template plist_path do
|
34
|
+
source "org.nginx.nginx.plist.erb"
|
35
|
+
owner "root"
|
36
|
+
end
|
37
|
+
|
38
|
+
execute "start the daemon" do
|
39
|
+
command %'sudo launchctl load -w #{plist_path}'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
template "/usr/local/etc/nginx/nginx.conf" do
|
44
|
+
source "nginx.conf.erb"
|
45
|
+
owner WS_USER
|
46
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
run_unless_marker_file_exists("pivotal_logos") do
|
2
|
+
# Let's make Pivotal Logos less intrusive; assume
|
3
|
+
# they want the logos the first time soloist is run,
|
4
|
+
# but afterwards leave the backgrounds & icons untouched
|
5
|
+
# (using a marker file)
|
6
|
+
#
|
7
|
+
# BUGS: the screen-share-lock icon will NOT refresh to the
|
8
|
+
# red dot until you log out & log in again.
|
9
|
+
%w{Icons BackgroundsPrimary BackgroundsSecondary}.each do |dir|
|
10
|
+
directory "#{WS_HOME}/Pictures/#{dir}" do
|
11
|
+
mode "0755"
|
12
|
+
owner WS_USER
|
13
|
+
:recursive
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
%w{blue green orange violet}.each do |color|
|
18
|
+
filename="pivID_#{color}-1004x400.png"
|
19
|
+
remote_file "#{WS_HOME}/Pictures/BackgroundsPrimary/#{filename}" do
|
20
|
+
source "http://cheffiles.pivotallabs.com/#{filename}"
|
21
|
+
owner WS_USER
|
22
|
+
:create_if_missing
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
%w{BackToTheEdward.png}.each do |filename|
|
27
|
+
remote_file "#{WS_HOME}/Pictures/BackgroundsSecondary/#{filename}" do
|
28
|
+
source "http://cheffiles.pivotallabs.com/#{filename}"
|
29
|
+
owner WS_USER
|
30
|
+
:create_if_missing
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
%w{Pivot.jpeg tracker_dot.png tracker_dot.jpeg}.each do |filename|
|
35
|
+
remote_file "#{WS_HOME}/Pictures/Icons/#{filename}" do
|
36
|
+
filename = filename.gsub(" ","%20")
|
37
|
+
source "http://cheffiles.pivotallabs.com/#{filename}"
|
38
|
+
owner WS_USER
|
39
|
+
:create_if_missing
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
template "/tmp/jpegphoto.dsimport" do
|
44
|
+
source "pivotal_logos-dsimport.erb"
|
45
|
+
owner WS_USER
|
46
|
+
end
|
47
|
+
|
48
|
+
# OpenDirectory has a specific format for JPEGPhoto (320x320 72dpi)
|
49
|
+
# easiest way to create one is to let Apple create it for you and
|
50
|
+
# then extract their jpeg:
|
51
|
+
# System Preferences
|
52
|
+
# ->Users & Groups
|
53
|
+
# ->select your username->click on icon->click "Edit Picture..."
|
54
|
+
# ->set your picture to the one you want. Then:
|
55
|
+
# dscl . read /Users/$USER JPEGPhoto |tail +2 |xxd -r -p > /tmp/precious.jpeg
|
56
|
+
execute("dscl . delete /Users/#{WS_USER} JPEGPhoto")
|
57
|
+
execute("dscl . create /Users/#{WS_USER} Picture \"#{WS_HOME}/Pictures/Icons/tracker_dot.png\"")
|
58
|
+
execute("dsimport /tmp/jpegphoto.dsimport /Local/Default M")
|
59
|
+
|
60
|
+
gem_package("plist")
|
61
|
+
|
62
|
+
ruby_block "install the pivotal backgrounds" do
|
63
|
+
block do
|
64
|
+
Gem.clear_paths
|
65
|
+
|
66
|
+
require 'plist'
|
67
|
+
# FIXME: if plist doesn't exist, create it.
|
68
|
+
plist_file = "#{ENV['HOME']}/Library/Preferences/com.apple.desktop.plist"
|
69
|
+
if File.exists?(plist_file)
|
70
|
+
`plutil -convert xml1 #{plist_file}`
|
71
|
+
desktop_plist = Plist::parse_xml(plist_file)
|
72
|
+
else
|
73
|
+
desktop_plist = Plist::parse_xml('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict></dict></plist>')
|
74
|
+
end
|
75
|
+
desktop_plist["Background"] =
|
76
|
+
{ "default" =>
|
77
|
+
{ "BackgroundColor" =>
|
78
|
+
[ 0.0, 0.250980406999588, 0.501960813999176 ],
|
79
|
+
"Change" => "TimeInterval",
|
80
|
+
"ChangePath" => "/Users/pivotal/Pictures/BackgroundsPrimary",
|
81
|
+
"ChangeTime" => 5.0,
|
82
|
+
"DSKDesktopPrefPane" => {
|
83
|
+
"UserFolderPaths" => [
|
84
|
+
"/Users/pivotal/Pictures/BackgroundsPrimary",
|
85
|
+
"/Users/pivotal/Pictures/BackgroundsSecondary"
|
86
|
+
]
|
87
|
+
},
|
88
|
+
"DrawBackgroundColor" => true,
|
89
|
+
"LastName" => "pivID_orange-1004x400.png",
|
90
|
+
"NewChangePath" => "~/Pictures/BackgroundsPrimary",
|
91
|
+
"NoImage" => false,
|
92
|
+
"Placement" => "Centered",
|
93
|
+
"Random" => false,
|
94
|
+
}
|
95
|
+
}
|
96
|
+
plist_handle = File.open(plist_file, "w")
|
97
|
+
plist_handle.puts Plist::Emit.dump(desktop_plist)
|
98
|
+
`killall Dock`
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
include_recipe "pivotal_workstation::homebrew"
|
2
|
+
|
3
|
+
run_unless_marker_file_exists("postgres") do
|
4
|
+
|
5
|
+
plist_path = File.expand_path('org.postgresql.postgres.plist', File.join('~', 'Library', 'LaunchAgents'))
|
6
|
+
if File.exists?(plist_path)
|
7
|
+
log "postgres plist found at #{plist_path}"
|
8
|
+
execute "unload the plist (shuts down the daemon)" do
|
9
|
+
command %'launchctl unload -w #{plist_path}'
|
10
|
+
user WS_USER
|
11
|
+
end
|
12
|
+
else
|
13
|
+
log "Did not find plist at #{plist_path} don't try to unload it"
|
14
|
+
end
|
15
|
+
|
16
|
+
# blow away default image's data directory
|
17
|
+
directory "/usr/local/var/postgres" do
|
18
|
+
action :delete
|
19
|
+
recursive true
|
20
|
+
end
|
21
|
+
|
22
|
+
brew_remove "postgresql"
|
23
|
+
brew_install "postgresql"
|
24
|
+
|
25
|
+
execute "create the database" do
|
26
|
+
command %'initdb -U #{WS_USER} --encoding=utf8 --locale=en_US /usr/local/var/postgres'
|
27
|
+
user WS_USER
|
28
|
+
end
|
29
|
+
|
30
|
+
launch_agents_path = File.expand_path('.', File.join('~','Library', 'LaunchAgents'))
|
31
|
+
directory launch_agents_path do
|
32
|
+
action :create
|
33
|
+
recursive true
|
34
|
+
owner WS_USER
|
35
|
+
end
|
36
|
+
|
37
|
+
ruby_block "rename Apple's stock postgres commands to avoid confusion" do
|
38
|
+
block do
|
39
|
+
new_dir="/usr/bin/postgres-orig"
|
40
|
+
if ! ( File.exists?(new_dir) && File.directory?(new_dir) )
|
41
|
+
Dir.mkdir(new_dir)
|
42
|
+
end
|
43
|
+
["clusterdb", "createdb", "createlang", "createuser", "dropdb", "droplang", "dropuser", "ecpg", "initdb", "oid2name", "pg_archivecleanup", "pg_config", "pg_controldata", "pg_ctl", "pg_dump", "pg_dumpall", "pg_resetxlog", "pg_restore", "pg_standby", "pg_upgrade", "pgbench", "postgres", "postmaster", "psql", "reindexdb", "vacuumdb", "vacuumlo"].each do |pg_cmd|
|
44
|
+
if File.exists?("/usr/bin/#{pg_cmd}")
|
45
|
+
File.rename("/usr/bin/#{pg_cmd}","/usr/bin/postgres-orig/#{pg_cmd}")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
execute "copy over the plist" do
|
52
|
+
command %'cp /usr/local/Cellar/postgresql/9.*/org.postgresql.postgres.plist ~/Library/LaunchAgents/'
|
53
|
+
user WS_USER
|
54
|
+
end
|
55
|
+
|
56
|
+
execute "start the daemon" do
|
57
|
+
command %'launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist'
|
58
|
+
user WS_USER
|
59
|
+
end
|
60
|
+
|
61
|
+
ruby_block "wait four seconds for the database to start" do
|
62
|
+
block do
|
63
|
+
sleep 4
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
execute "create the database" do
|
68
|
+
command "createdb"
|
69
|
+
user WS_USER
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
ruby_block "test to see if postgres is running" do
|
75
|
+
block do
|
76
|
+
require 'socket'
|
77
|
+
postgres_port = 5432
|
78
|
+
begin
|
79
|
+
s = TCPSocket.open('localhost',postgres_port)
|
80
|
+
rescue => e
|
81
|
+
raise "postgres is not running: " << e
|
82
|
+
end
|
83
|
+
s.close
|
84
|
+
`sudo -u #{WS_USER} psql < /dev/null`
|
85
|
+
if $?.to_i != 0
|
86
|
+
raise "I couldn't invoke postgres!"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This is obviously a destructive recipe.
|
2
|
+
|
3
|
+
run_unless_marker_file_exists("removed_garage_band") do
|
4
|
+
execute "Deleting Garage Band Support Files" do
|
5
|
+
command "rm -rf /Library/Application\ Support/GarageBand"
|
6
|
+
end
|
7
|
+
|
8
|
+
execute "Deleting Garage Band Application" do
|
9
|
+
command "rm -rf /Applications/GarageBand.app"
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
include_recipe "pivotal_workstation::java"
|
2
|
+
|
3
|
+
rubymine_version="3.2.4"
|
4
|
+
pivotal_workstation_package "Rubymine #{rubymine_version}" do
|
5
|
+
source "http://download.jetbrains.com/ruby/RubyMine-#{rubymine_version}.dmg"
|
6
|
+
action :install
|
7
|
+
checksum "5b670894397ae5dcb692bb2b2a7e3b01cedf2e50978879ea4fe1efaa348cbb9c"
|
8
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
pivotal_rubymine_git_revision_hash = version_string_for("Pivotal-Preferences-RubyMine")
|
2
|
+
rubymine_version_string = version_string_for("RubyMine-VersionString")
|
3
|
+
|
4
|
+
run_unless_marker_file_exists("#{marker_version_string_for("Pivotal-Preferences-RubyMine")}-#{rubymine_version_string}") do
|
5
|
+
download_dir = "/tmp/Pivotal-Preferences-RubyMine"
|
6
|
+
rubymine_preferences_dir = "#{WS_HOME}/Library/Preferences/RubyMine#{rubymine_version_string}"
|
7
|
+
|
8
|
+
execute "reset dir" do
|
9
|
+
command "rm -rf #{download_dir} && mkdir -p #{download_dir}"
|
10
|
+
user WS_USER
|
11
|
+
end
|
12
|
+
|
13
|
+
execute "get Pivotal-Preferences-RubyMine" do
|
14
|
+
command "curl -Lsf http://github.com/pivotal/Pivotal-Preferences-RubyMine/tarball/#{pivotal_rubymine_git_revision_hash} | tar xvz -C#{download_dir} --strip 1"
|
15
|
+
user WS_USER
|
16
|
+
end
|
17
|
+
|
18
|
+
[
|
19
|
+
[rubymine_preferences_dir, "keymaps"],
|
20
|
+
[rubymine_preferences_dir, "templates"],
|
21
|
+
].each do |dirs|
|
22
|
+
recursive_directories dirs do
|
23
|
+
owner WS_USER
|
24
|
+
mode "0755"
|
25
|
+
recursive true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
["cp #{download_dir}/keymaps/* #{rubymine_preferences_dir}/keymaps/",
|
30
|
+
"cp #{download_dir}/templates/* #{rubymine_preferences_dir}/templates/"].each do |copy_command|
|
31
|
+
execute "copy: #{copy_command}" do
|
32
|
+
command copy_command
|
33
|
+
user WS_USER
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
include_recipe "pivotal_workstation::java"
|
2
|
+
include_recipe "pivotal_workstation::bash_profile"
|
3
|
+
include_recipe "pivotal_workstation::git"
|
4
|
+
|
5
|
+
rvm_git_revision_hash = version_string_for("rvm")
|
6
|
+
|
7
|
+
::RVM_HOME = "#{WS_HOME}/.rvm"
|
8
|
+
::RVM_COMMAND = "#{::RVM_HOME}/bin/rvm"
|
9
|
+
|
10
|
+
bash_profile_include("rvm")
|
11
|
+
|
12
|
+
run_unless_marker_file_exists(marker_version_string_for("rvm")) do
|
13
|
+
recursive_directories [RVM_HOME, 'src', 'rvm'] do
|
14
|
+
owner WS_USER
|
15
|
+
recursive true
|
16
|
+
end
|
17
|
+
|
18
|
+
execute "download rvm" do
|
19
|
+
command "curl -Lsf http://github.com/wayneeseguin/rvm/tarball/#{rvm_git_revision_hash} | tar xvz -C#{RVM_HOME}/src/rvm --strip 1"
|
20
|
+
user WS_USER
|
21
|
+
end
|
22
|
+
|
23
|
+
execute "install rvm" do
|
24
|
+
cwd "#{RVM_HOME}/src/rvm"
|
25
|
+
command "./install"
|
26
|
+
user WS_USER
|
27
|
+
end
|
28
|
+
|
29
|
+
execute "check rvm" do
|
30
|
+
command "#{RVM_COMMAND} --version | grep Wayne"
|
31
|
+
user WS_USER
|
32
|
+
end
|
33
|
+
|
34
|
+
%w{readline autoconf openssl zlib}.each do |rvm_package|
|
35
|
+
execute "install rvm package: #{rvm_package}" do
|
36
|
+
command "#{::RVM_COMMAND} package install #{rvm_package}"
|
37
|
+
user WS_USER
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
node["rvm"]["rubies"].each do |ruby_version_string, env_override|
|
43
|
+
rvm_ruby_install(ruby_version_string,env_override)
|
44
|
+
end
|
45
|
+
|
46
|
+
run_unless_marker_file_exists("rvm_default_to_1.9.2") do
|
47
|
+
if node["rvm"]["default_ruby"]
|
48
|
+
execute "making 1.9.2 with rvm the default" do
|
49
|
+
command "#{::RVM_COMMAND} --default #{node["rvm"]["default_ruby"]}"
|
50
|
+
user WS_USER
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
unless File.exists?("/Applications/Screen Sharing.app")
|
2
|
+
|
3
|
+
link "/Applications/Screen\ Sharing.app" do
|
4
|
+
to "/System/Library/CoreServices/Screen\ Sharing.app"
|
5
|
+
end
|
6
|
+
|
7
|
+
ruby_block "assure the link /Applications/Screen Sharing.app was successfully created" do
|
8
|
+
block do
|
9
|
+
raise "Linking /Applications/Screen Sharing.app to /System/Library/CoreServices/Screen Sharing.app failed." unless File.exists?("/Applications/Screen Sharing.app")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
execute "Enabling Screen Sharing for All Users" do
|
2
|
+
command "/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers"
|
3
|
+
end
|
4
|
+
|
5
|
+
ruby_block "test to see if screen-sharing is enabled" do
|
6
|
+
block do
|
7
|
+
require 'socket'
|
8
|
+
vnc_port = 5900
|
9
|
+
begin
|
10
|
+
s = TCPSocket.open('localhost',vnc_port)
|
11
|
+
rescue => e
|
12
|
+
raise "Couldn't connect to screen-sharing: " << e
|
13
|
+
end
|
14
|
+
s.close
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
webdriver_location = "http://selenium.googlecode.com/files/chromedriver_mac_13.0.775.0.zip"
|
2
|
+
|
3
|
+
run_unless_marker_file_exists("selenium_webdriver_13_0_775_3") do
|
4
|
+
execute "download webdriver" do
|
5
|
+
command "curl -o /tmp/webdriver.zip #{webdriver_location}"
|
6
|
+
user WS_USER
|
7
|
+
end
|
8
|
+
|
9
|
+
execute "unzip" do
|
10
|
+
command "unzip -o /tmp/webdriver.zip chromedriver -d /usr/bin/"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
file "/usr/bin/chromedriver" do
|
15
|
+
mode "0755"
|
16
|
+
end
|
17
|
+
|
18
|
+
execute "create chromium.app symlink" do
|
19
|
+
command 'rm -f "/Applications/Chromium.app" && ln -s "/Applications/Google Chrome.app" "/Applications/Chromium.app"'
|
20
|
+
end
|
21
|
+
|
22
|
+
execute "create contents symlink" do
|
23
|
+
command 'rm -f "/Applications/Chromium.app/Contents/MacOS/Chromium" && ln -s "/Applications/Chromium.app/Contents/MacOS/Google Chrome" "/Applications/Chromium.app/Contents/MacOS/Chromium"'
|
24
|
+
end
|