simple_deploy_ssh 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +1 -0
- data/bin/simple_deploy_ssh +6 -0
- data/lib/simple_deploy_ssh/version.rb +3 -0
- data/lib/simple_deploy_ssh.rb +33 -0
- data/simple_deploy_ssh.gemspec +24 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 70e46f4f0d904d7c82ac94ddd50889192613ff74
|
4
|
+
data.tar.gz: 30dfffc43352df9aa0a3ebe8f4742d62b88a5ad5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c2b754754a6953de380c0fea9c6ae8bfdef8c19cc25480d9d4d84c456c3a08982168684431b49a5c93cb60f87fafe15efc95ff1fce8d887b2fdaada683d609bf
|
7
|
+
data.tar.gz: a53daa7feebc88111d4859553011ee5438e6815179c76c6b2f82ad9b6b502b2b9a901da453cfac5280ed75857cea8843bee79087ca24c6424ea76f6f974780ca
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Bradly Feeley
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Simple Deploy SSH
|
2
|
+
|
3
|
+
A gem to make it easier to ssh to instances managed with simple_deploy
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'simple_deploy_ssh'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install simple_deploy_ssh
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
$ simple_deploy qa app
|
22
|
+
|
23
|
+
or
|
24
|
+
|
25
|
+
$ simple_deploy prod worker
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it ( http://github.com/<my-github-username>/simple_deploy_ssh/fork )
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class SimpleDeploySSH
|
2
|
+
VERSION = "0.0.1"
|
3
|
+
|
4
|
+
def initialize(env_name, stack_name)
|
5
|
+
@env_name = env_name
|
6
|
+
@stack_name = stack_name
|
7
|
+
end
|
8
|
+
|
9
|
+
def connect!
|
10
|
+
Kernel.exec ssh_command
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
def list
|
15
|
+
command = "simple_deploy list -e #@env_name"
|
16
|
+
`#{command}`.split
|
17
|
+
end
|
18
|
+
|
19
|
+
def full_stack_name
|
20
|
+
fsn = list.find { |line| line.match /-\d-#@env_name-\d-#@stack_name-\d/ }
|
21
|
+
raise "stack not found" if fsn.nil?
|
22
|
+
fsn
|
23
|
+
end
|
24
|
+
|
25
|
+
def ip
|
26
|
+
command = "simple_deploy instances -e #@env_name -n #{full_stack_name}"
|
27
|
+
`#{command}`
|
28
|
+
end
|
29
|
+
|
30
|
+
def ssh_command
|
31
|
+
"ssh #{ip}"
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'simple_deploy_ssh'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "simple_deploy_ssh"
|
8
|
+
spec.version = SimpleDeploySSH::VERSION
|
9
|
+
spec.authors = ["Bradly Feeley"]
|
10
|
+
spec.email = ["bradlyf@gmail.com"]
|
11
|
+
spec.summary = %q{A gem to make it easier to ssh to instances managed with simple_deploy}
|
12
|
+
spec.description = %q{A gem to make it easier to ssh to instances managed with simple_deploy}
|
13
|
+
spec.homepage = "https://github.com/bradly/simple_deploy_ssh"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency('simple_deploy')
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simple_deploy_ssh
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bradly Feeley
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: simple_deploy
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: A gem to make it easier to ssh to instances managed with simple_deploy
|
56
|
+
email:
|
57
|
+
- bradlyf@gmail.com
|
58
|
+
executables:
|
59
|
+
- simple_deploy_ssh
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .gitignore
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/simple_deploy_ssh
|
69
|
+
- lib/simple_deploy_ssh.rb
|
70
|
+
- lib/simple_deploy_ssh/version.rb
|
71
|
+
- simple_deploy_ssh.gemspec
|
72
|
+
homepage: https://github.com/bradly/simple_deploy_ssh
|
73
|
+
licenses:
|
74
|
+
- MIT
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
requirements: []
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 2.0.2
|
93
|
+
signing_key:
|
94
|
+
specification_version: 4
|
95
|
+
summary: A gem to make it easier to ssh to instances managed with simple_deploy
|
96
|
+
test_files: []
|
97
|
+
has_rdoc:
|