Refactor rake node provisioner

This commit is contained in:
Henrik Lissner 2014-09-05 17:03:57 -04:00
parent 6ebcfd11bb
commit 2fa693e994
5 changed files with 54 additions and 37 deletions

View file

@ -1,4 +1,4 @@
desc "Provision home server"
desc "My home server"
task :callisto do
%w{
update

View file

@ -1,2 +1,2 @@
desc "Provision main laptop"
desc "My work laptop"
task :ganymede => :io

View file

@ -1,38 +1,53 @@
desc "Provision main desktop"
desc "My main computer"
task :io do
%w{
update
pkg:osx
pkg:zsh
pkg:vim
pkg:emacs
pkg:rbenv
pkg:pyenv
}.each { |task| Rake::Task[task].invoke }
[ "update",
"pkg:osx",
"pkg:zsh",
"pkg:vim",
"pkg:emacs",
"pkg:rbenv",
"pkg:pyenv",
"pkg:love"
].each { |task| Rake::Task[task].invoke }
# Install my the mac-apps I commonly use
if is_mac?
%w{
transmit
transmission
vlc
flux
skype
adium
codekit
sequel-pro
scrivener
omnigraffle
love
[ "transmit",
"transmission",
"vlc",
"flux",
"skype",
"adium",
"codekit",
"mindnode-pro",
"sequel-pro",
"scrivener",
"omnigraffle",
qlcolorcode
qlstephen
qlmarkdown
quicklook-json
qlprettypatch
quicklook-csv
betterzipql
webp-quicklook
suspicious-package
}.each { |app| Package.cask_install app }
# Quicklook plugins
"qlcolorcode",
"qlstephen",
"qlmarkdown",
"quicklook-json",
"qlprettypatch",
"quicklook-csv",
"betterzipql",
"webp-quicklook",
"suspicious-package"
].each { |app| Package.cask_install app }
end
if system("rbenv versions | grep 2.1.2 >/dev/null")
sh_safe "rbenv install 2.1.2"
sh_safe "rbenv global 2.1.2"
sh_safe "~/.rbenv/shims/gem install bundler rspec cucumber jekyll"
end
if system("pyenv versions | grep 3.4.1 >/dev/null")
sh_safe "pyenv install 3.4.1"
sh_safe "pyenv global 3.4.1"
sh_safe "~/.pyenv/shims/pip install nose cython"
end
end

View file

@ -1,2 +1,2 @@
desc "Provision 2nd desktop"
desc "My media desktop"
task :titan => :io

View file

@ -1,12 +1,14 @@
require_relative 'lib/output'
task :default => :update
desc "Update the node (based on hostname)"
task :default, :node do |t, args|
task :update, :node do |t, args|
args.with_defaults(:node => `hostname`.gsub('.local', '').strip)
Rake::Task["setup:#{args.node}"].invoke
end
desc "Wipe the slate clean"
# desc "Wipe the slate clean"
task :destroy do
# are you sure?
# are you really really sure?