Skip to content

Commit

Permalink
Go ona.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlacaelel committed Dec 14, 2013
1 parent 248e4dd commit c5567cc
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ rdoc
pkg

## PROJECT::SPECIFIC
.rvmrc
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'

gem 'rake', '0.8.7'
gem 'jeweler'
gem 'thoughtbot-shoulda', '2.10.2'

52 changes: 52 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.5)
builder (3.2.2)
faraday (0.8.8)
multipart-post (~> 1.2.0)
git (1.2.6)
github_api (0.10.1)
addressable
faraday (~> 0.8.1)
hashie (>= 1.2)
multi_json (~> 1.4)
nokogiri (~> 1.5.2)
oauth2
hashie (2.0.5)
highline (1.6.20)
httpauth (0.2.0)
jeweler (1.8.8)
builder
bundler (~> 1.0)
git (>= 1.2.5)
github_api (= 0.10.1)
highline (>= 1.6.15)
nokogiri (= 1.5.10)
rake
rdoc
json (1.8.1)
jwt (0.1.8)
multi_json (>= 1.5)
multi_json (1.8.2)
multi_xml (0.5.5)
multipart-post (1.2.0)
nokogiri (1.5.10)
oauth2 (0.9.2)
faraday (~> 0.8)
httpauth (~> 0.2)
jwt (~> 0.1.4)
multi_json (~> 1.0)
multi_xml (~> 0.5)
rack (~> 1.2)
rack (1.5.2)
rake (0.8.7)
rdoc (4.0.1)
json (~> 1.4)

PLATFORMS
ruby

DEPENDENCIES
jeweler
rake (= 0.8.7)
16 changes: 16 additions & 0 deletions lib/ona_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class Cli
'deploy' => { :method => :deploy, :id_required => true },
'ssh#' => { :method => :ssh_root, :id_required => true },
'ssh' => { :method => :ssh_deploy,:id_required => true },
'go' => { :method => :go_deploy, :id_required => true },
'go#' => { :method => :go_root, :id_required => true },
'http' => { :method => :http, :id_required => true },
'key' => { :method => :key, :id_required => true },
'keys' => { :method => :keys, :id_required => true },
Expand Down Expand Up @@ -66,6 +68,8 @@ def help
deploy 1 # Deploy a specific server
exit # Same as *quit*
go # Go to server without opening a new window.
go# # Same as go but do it as root.
help # Show this help
http 1 # Open the server in default browser.
key 1 # Uploads my public ssh-key to remote server (root)
Expand Down Expand Up @@ -124,6 +128,18 @@ def ssh_root server_id
end
end

def go_deploy server_id
@stack.find_all(server_id).each do |server|
system server.to_go 'deploy'
end
end

def go_root server_id
@stack.find_all(server_id).each do |server|
system server.to_go 'deploy'
end
end

def deploy server_id
@stack.find_all(server_id).each do |server|
prompt_for_continuation server
Expand Down
4 changes: 4 additions & 0 deletions lib/ona_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def to_ssh user
"open ssh://#{user}@#{ip}"
end

def to_go user
"ssh #{user}@#{ip}"
end

def to_http
"open http://#{ip}"
end
Expand Down

0 comments on commit c5567cc

Please sign in to comment.