pivotal_workstation_cookbook 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.gitmodules +3 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/cookbooks/pivotal_workstation/.gitignore +2 -0
- data/cookbooks/pivotal_workstation/LICENSE.txt +21 -0
- data/cookbooks/pivotal_workstation/README.markdown +31 -0
- data/cookbooks/pivotal_workstation/attributes/chrome.rb +1 -0
- data/cookbooks/pivotal_workstation/attributes/firefox.rb +2 -0
- data/cookbooks/pivotal_workstation/attributes/fusion.rb +1 -0
- data/cookbooks/pivotal_workstation/attributes/git_pairs.rb +4 -0
- data/cookbooks/pivotal_workstation/attributes/git_projects.rb +3 -0
- data/cookbooks/pivotal_workstation/attributes/gitx.rb +2 -0
- data/cookbooks/pivotal_workstation/attributes/java.rb +1 -0
- data/cookbooks/pivotal_workstation/attributes/libreoffice.rb +3 -0
- data/cookbooks/pivotal_workstation/attributes/nginx.rb +11 -0
- data/cookbooks/pivotal_workstation/attributes/postgres.rb +3 -0
- data/cookbooks/pivotal_workstation/attributes/rubymine.rb +4 -0
- data/cookbooks/pivotal_workstation/attributes/rvm.rb +8 -0
- data/cookbooks/pivotal_workstation/attributes/skype.rb +1 -0
- data/cookbooks/pivotal_workstation/attributes/versions.rb +7 -0
- data/cookbooks/pivotal_workstation/libraries/bash_profile_include.rb +11 -0
- data/cookbooks/pivotal_workstation/libraries/brew.rb +31 -0
- data/cookbooks/pivotal_workstation/libraries/directories.rb +25 -0
- data/cookbooks/pivotal_workstation/libraries/marker.rb +42 -0
- data/cookbooks/pivotal_workstation/libraries/osx_app.rb +97 -0
- data/cookbooks/pivotal_workstation/libraries/rvm_ruby_install.rb +36 -0
- data/cookbooks/pivotal_workstation/libraries/user.rb +4 -0
- data/cookbooks/pivotal_workstation/libraries/version.rb +9 -0
- data/cookbooks/pivotal_workstation/recipes/ack.rb +1 -0
- data/cookbooks/pivotal_workstation/recipes/active_corners.rb +24 -0
- data/cookbooks/pivotal_workstation/recipes/bash_path_order.rb +13 -0
- data/cookbooks/pivotal_workstation/recipes/bash_profile-better_history.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/bash_profile-no_sudo_gem_install.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/bash_profile-ps1.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/bash_profile.rb +11 -0
- data/cookbooks/pivotal_workstation/recipes/chrome.rb +28 -0
- data/cookbooks/pivotal_workstation/recipes/defaults_fast_key_repeat_rate.rb +10 -0
- data/cookbooks/pivotal_workstation/recipes/disable_front_row.rb +4 -0
- data/cookbooks/pivotal_workstation/recipes/dock_preferences.rb +13 -0
- data/cookbooks/pivotal_workstation/recipes/ec2_api_tools.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/finder_display_full_path.rb +4 -0
- data/cookbooks/pivotal_workstation/recipes/firefox.rb +28 -0
- data/cookbooks/pivotal_workstation/recipes/fusion.rb +29 -0
- data/cookbooks/pivotal_workstation/recipes/gem_no_rdoc_no_ri.rb +7 -0
- data/cookbooks/pivotal_workstation/recipes/git.rb +8 -0
- data/cookbooks/pivotal_workstation/recipes/git_config_global_defaults.rb +71 -0
- data/cookbooks/pivotal_workstation/recipes/git_projects.rb +29 -0
- data/cookbooks/pivotal_workstation/recipes/git_scripts.rb +20 -0
- data/cookbooks/pivotal_workstation/recipes/gitx.rb +25 -0
- data/cookbooks/pivotal_workstation/recipes/global_environment_variables.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/homebrew.rb +27 -0
- data/cookbooks/pivotal_workstation/recipes/imagemagick.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/inputrc.rb +6 -0
- data/cookbooks/pivotal_workstation/recipes/iterm_set_defaults.rb +167 -0
- data/cookbooks/pivotal_workstation/recipes/java.rb +29 -0
- data/cookbooks/pivotal_workstation/recipes/joe.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/libreoffice.rb +28 -0
- data/cookbooks/pivotal_workstation/recipes/lion_basedev.rb +23 -0
- data/cookbooks/pivotal_workstation/recipes/mysql.rb +44 -0
- data/cookbooks/pivotal_workstation/recipes/nginx.rb +46 -0
- data/cookbooks/pivotal_workstation/recipes/osx_turn_on_locate.rb +8 -0
- data/cookbooks/pivotal_workstation/recipes/postgres.rb +71 -0
- data/cookbooks/pivotal_workstation/recipes/remove_garageband.rb +11 -0
- data/cookbooks/pivotal_workstation/recipes/rubymine.rb +30 -0
- data/cookbooks/pivotal_workstation/recipes/rubymine_preferences_pivotal.rb +36 -0
- data/cookbooks/pivotal_workstation/recipes/rvm.rb +58 -0
- data/cookbooks/pivotal_workstation/recipes/safari_preferences.rb +4 -0
- data/cookbooks/pivotal_workstation/recipes/screen_sharing_on.rb +16 -0
- data/cookbooks/pivotal_workstation/recipes/selenium_webdriver.rb +24 -0
- data/cookbooks/pivotal_workstation/recipes/set_finder_show_hd_on_desktop.rb +4 -0
- data/cookbooks/pivotal_workstation/recipes/set_multitouch_preferences.rb +9 -0
- data/cookbooks/pivotal_workstation/recipes/set_ntp_server.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/set_screensaver_preferences.rb +21 -0
- data/cookbooks/pivotal_workstation/recipes/size_up.rb +18 -0
- data/cookbooks/pivotal_workstation/recipes/skype.rb +28 -0
- data/cookbooks/pivotal_workstation/recipes/ssh_copy_id.rb +3 -0
- data/cookbooks/pivotal_workstation/recipes/sshd_on.rb +16 -0
- data/cookbooks/pivotal_workstation/recipes/ssl_certificate.rb +50 -0
- data/cookbooks/pivotal_workstation/recipes/terminal_preferences.rb +9 -0
- data/cookbooks/pivotal_workstation/recipes/textmate.rb +24 -0
- data/cookbooks/pivotal_workstation/recipes/textmate_plugins.rb +31 -0
- data/cookbooks/pivotal_workstation/recipes/textmate_set_defaults.rb +84 -0
- data/cookbooks/pivotal_workstation/recipes/user_owns_usr_local.rb +8 -0
- data/cookbooks/pivotal_workstation/recipes/vim.rb +35 -0
- data/cookbooks/pivotal_workstation/recipes/workspace_directory.rb +5 -0
- data/cookbooks/pivotal_workstation/templates/default/bash_profile-better_history.sh.erb +4 -0
- data/cookbooks/pivotal_workstation/templates/default/bash_profile-ec2_tools.sh.erb +5 -0
- data/cookbooks/pivotal_workstation/templates/default/bash_profile-no_sudo_gem_install.sh.erb +2 -0
- data/cookbooks/pivotal_workstation/templates/default/bash_profile-ps1.sh.erb +26 -0
- data/cookbooks/pivotal_workstation/templates/default/bash_profile-rvm.sh.erb +1 -0
- data/cookbooks/pivotal_workstation/templates/default/bash_profile.erb +6 -0
- data/cookbooks/pivotal_workstation/templates/default/git_scripts_pairs.erb +10 -0
- data/cookbooks/pivotal_workstation/templates/default/inputrc.erb +10 -0
- data/cookbooks/pivotal_workstation/templates/default/launchd.conf.erb +6 -0
- data/cookbooks/pivotal_workstation/templates/default/nginx.conf.erb +79 -0
- data/cookbooks/pivotal_workstation/templates/default/ntp.conf.erb +2 -0
- data/cookbooks/pivotal_workstation/templates/default/org.nginx.nginx.plist.erb +22 -0
- data/lib/pivotal_workstation_cookbook.rb +4 -0
- data/pivotal_workstation.gemspec +19 -0
- metadata +168 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
`pkgutil --pkgs=com.apple.pkg.JavaForMacOSX107`
|
2
|
+
if $? != 0
|
3
|
+
|
4
|
+
remote_file "/tmp/java.dmg" do
|
5
|
+
source node["java_download_uri"]
|
6
|
+
mode "0644"
|
7
|
+
end
|
8
|
+
|
9
|
+
execute "mount java dmg" do
|
10
|
+
command "hdid /tmp/java.dmg"
|
11
|
+
user WS_USER
|
12
|
+
end
|
13
|
+
|
14
|
+
execute "intall java" do
|
15
|
+
command "installer -pkg /Volumes/Java\\ for\\ Mac\\ OS\\ X\\ 10.7/JavaForMacOSX10.7.pkg -target /"
|
16
|
+
end
|
17
|
+
|
18
|
+
execute "unmount dmg" do
|
19
|
+
command "hdiutil detach /Volumes/Java\\ for\\ Mac\\ OS\\ X\\ 10.7"
|
20
|
+
user WS_USER
|
21
|
+
end
|
22
|
+
|
23
|
+
ruby_block "test to see if java was installed" do
|
24
|
+
block do
|
25
|
+
`pkgutil --pkgs=com.apple.pkg.JavaForMacOSX107`
|
26
|
+
raise "Java install failed" if $? != 0
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
unless File.exists?("/Applications/" + node["libreoffice_basename"])
|
2
|
+
|
3
|
+
remote_file "/tmp/libreoffice.dmg" do
|
4
|
+
source node["libreoffice_download_uri"]
|
5
|
+
mode "0644"
|
6
|
+
end
|
7
|
+
|
8
|
+
execute "mount libreoffice dmg" do
|
9
|
+
command "hdid /tmp/libreoffice.dmg"
|
10
|
+
user WS_USER
|
11
|
+
end
|
12
|
+
|
13
|
+
execute "copy LibreOffice to /Applications" do
|
14
|
+
command "cp -rf #{Regexp.escape(node["libreoffice_dmg_mnt"]+ "/" + node["libreoffice_basename"])} /Applications/"
|
15
|
+
user WS_USER
|
16
|
+
end
|
17
|
+
|
18
|
+
execute "unmount dmg" do
|
19
|
+
command "hdiutil detach #{Regexp.escape(node["libreoffice_dmg_mnt"])}"
|
20
|
+
user WS_USER
|
21
|
+
end
|
22
|
+
|
23
|
+
ruby_block "test to see if LibreOffice was installed" do
|
24
|
+
block do
|
25
|
+
raise "LibreOffice install failed" unless File.exists?("/Applications/" + node["libreoffice_basename"])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Base recipe
|
2
|
+
include_recipe "pivotal_workstation::java"
|
3
|
+
include_recipe "pivotal_workstation::rvm"
|
4
|
+
include_recipe "pivotal_workstation::git_scripts"
|
5
|
+
include_recipe "pivotal_workstation::chrome"
|
6
|
+
include_recipe "pivotal_workstation::homebrew"
|
7
|
+
include_recipe "pivotal_workstation::gitx"
|
8
|
+
include_recipe "pivotal_workstation::sshd_on"
|
9
|
+
include_recipe "pivotal_workstation::screen_sharing_on"
|
10
|
+
include_recipe "pivotal_workstation::postgres"
|
11
|
+
include_recipe "pivotal_workstation::gem_no_rdoc_no_ri"
|
12
|
+
include_recipe "pivotal_workstation::rubymine"
|
13
|
+
include_recipe "pivotal_workstation::rubymine_preferences_pivotal"
|
14
|
+
include_recipe "pivotal_workstation::skype"
|
15
|
+
include_recipe "pivotal_workstation::size_up"
|
16
|
+
include_recipe "pivotal_workstation::imagemagick"
|
17
|
+
include_recipe "pivotal_workstation::set_screensaver_preferences"
|
18
|
+
include_recipe "pivotal_workstation::firefox"
|
19
|
+
include_recipe "pivotal_workstation::textmate"
|
20
|
+
include_recipe "pivotal_workstation::textmate_set_defaults"
|
21
|
+
include_recipe "pivotal_workstation::fusion"
|
22
|
+
include_recipe "pivotal_workstation::libreoffice"
|
23
|
+
#include_recipe "pivotal_workstation::mysql" # broken
|
@@ -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 info mysql | grep 'cp /usr/local' | head -n 1 | cut -f 6 -d ' '\` #{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,71 @@
|
|
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 #{node["postgres_settings"]["name"]} --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
|
+
["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|
|
40
|
+
if File.exists?("/usr/bin/#{pg_cmd}")
|
41
|
+
`mv /usr/bin/#{pg_cmd} /usr/bin/#{pg_cmd}.orig`
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
execute "copy over the plist" do
|
48
|
+
command %'cp /usr/local/Cellar/postgresql/9.*/org.postgresql.postgres.plist ~/Library/LaunchAgents/'
|
49
|
+
user WS_USER
|
50
|
+
end
|
51
|
+
|
52
|
+
execute "start the daemon" do
|
53
|
+
command %'launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist'
|
54
|
+
user WS_USER
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
ruby_block "test to see if postgres is running" do
|
60
|
+
block do
|
61
|
+
sleep 2
|
62
|
+
require 'socket'
|
63
|
+
postgres_port = 5432
|
64
|
+
begin
|
65
|
+
s = TCPSocket.open('localhost',postgres_port)
|
66
|
+
rescue => e
|
67
|
+
raise "postgres is not running: " << e
|
68
|
+
end
|
69
|
+
s.close
|
70
|
+
end
|
71
|
+
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,30 @@
|
|
1
|
+
include_recipe "pivotal_workstation::java"
|
2
|
+
|
3
|
+
unless File.exists?("/Applications/" + node["rubymine_basename"])
|
4
|
+
|
5
|
+
remote_file "/tmp/rubymine.dmg" do
|
6
|
+
source node["rubymine_download_uri"]
|
7
|
+
mode "0644"
|
8
|
+
end
|
9
|
+
|
10
|
+
execute "mount rubymine dmg" do
|
11
|
+
command "hdid /tmp/rubymine.dmg"
|
12
|
+
user WS_USER
|
13
|
+
end
|
14
|
+
|
15
|
+
execute "copy rubymine to /Applications" do
|
16
|
+
command "cp -rf #{Regexp.escape(node["rubymine_dmg_mnt"]+ "/" + node["rubymine_basename"])} /Applications/"
|
17
|
+
user WS_USER
|
18
|
+
end
|
19
|
+
|
20
|
+
execute "unmount dmg" do
|
21
|
+
command "hdiutil detach #{Regexp.escape(node["rubymine_dmg_mnt"])}"
|
22
|
+
user WS_USER
|
23
|
+
end
|
24
|
+
|
25
|
+
ruby_block "test to see if RubyMine was installed" do
|
26
|
+
block do
|
27
|
+
raise "RubyMine install failed" unless File.exists?("/Applications/" + node["rubymine_basename"])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
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,58 @@
|
|
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
|
+
run_unless_marker_file_exists(marker_version_string_for("rvm")) do
|
11
|
+
recursive_directories [RVM_HOME, 'src', 'rvm'] do
|
12
|
+
owner WS_USER
|
13
|
+
recursive true
|
14
|
+
end
|
15
|
+
|
16
|
+
execute "download rvm" do
|
17
|
+
command "curl -Lsf http://github.com/wayneeseguin/rvm/tarball/#{rvm_git_revision_hash} | tar xvz -C#{RVM_HOME}/src/rvm --strip 1"
|
18
|
+
user WS_USER
|
19
|
+
end
|
20
|
+
|
21
|
+
execute "install rvm" do
|
22
|
+
cwd "#{RVM_HOME}/src/rvm"
|
23
|
+
command "./install"
|
24
|
+
user WS_USER
|
25
|
+
end
|
26
|
+
|
27
|
+
bash_profile_include("rvm")
|
28
|
+
|
29
|
+
execute "check rvm" do
|
30
|
+
command "#{RVM_COMMAND} --version | grep Wayne"
|
31
|
+
user WS_USER
|
32
|
+
end
|
33
|
+
|
34
|
+
execute "HACK the rvm openssl install script. ./Configure was failing with 'target already defined'. we've filed a bug about this" do
|
35
|
+
command "perl -pi -e 's/os\\/compiler darwin/darwin/g' #{::RVM_HOME}/scripts/package"
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
%w{readline autoconf openssl zlib}.each do |rvm_package|
|
40
|
+
execute "install rvm package: #{rvm_package}" do
|
41
|
+
command "#{::RVM_COMMAND} package install #{rvm_package}"
|
42
|
+
user WS_USER
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
node["rvm"]["rubies"].each do |ruby_version_string|
|
48
|
+
rvm_ruby_install(ruby_version_string)
|
49
|
+
end
|
50
|
+
|
51
|
+
run_unless_marker_file_exists("rvm_default_to_1.9.2") do
|
52
|
+
if node["rvm"]["default_ruby"]
|
53
|
+
execute "making 1.9.2 with rvm the default" do
|
54
|
+
command "#{::RVM_COMMAND} --default #{node["rvm"]["default_ruby"]}"
|
55
|
+
user WS_USER
|
56
|
+
end
|
57
|
+
end
|
58
|
+
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"
|
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
|