awsssh 3.0.0.rc1 → 3.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0854a6413cf6ae7a3971665cc5e1424a648320b0
4
- data.tar.gz: 109523c466e6e9331f3250b787138702fd949bc7
3
+ metadata.gz: 8d4c7d18efb539f9dee264a9e7a0c378734b9caf
4
+ data.tar.gz: 794d4779823f21e227216c2078a66980bacef84c
5
5
  SHA512:
6
- metadata.gz: d1beffa40be5c1b8516c1ee15feaf95b39e32db9f9a75cebcfa07acf97aefe935680a2414abb8384befc90bd7e04d1ae5ce2d897afafc81bd8075ec64eed84f3
7
- data.tar.gz: 599513c140e9c421e3ac2764070cb1d9dac9c72b7904bcdeae98082d71b949cd8ba3aaa1595b96ff3139e134c63a54b2a9e38b61cfd00cbf149c6a3bfec3d2bb
6
+ metadata.gz: c50adbb615c3b1b64ac9682aa26e8c8f4211201e18f1aa5bfecbbc10db4cc5dc4c14b0e6c7c29a7f1809f71c9f6307ccc061d51a0d2d8255928a755dd0caebcb
7
+ data.tar.gz: 7df4a56c73c3f2cfb7376b635ca84a5dd6dc58029caa5a3b4591a6b5acb5f0a875751d814fc0852ae2d8a4dc92bb6383a5dbebbb7837effcfdf09c6b7f47a8f4
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.a
13
13
  mkmf.log
14
14
  *.gem
15
+ Gemfile.lock
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ script: bundle exec rake test
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1.0
data/README.md CHANGED
@@ -1,21 +1,20 @@
1
1
  # AWSSSH
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/awsssh.png)](http://badge.fury.io/rb/awsssh)
3
+ [![Gem Version](https://badge.fury.io/rb/awsssh.png)](http://badge.fury.io/rb/awsssh) || Master: [![Build Status](https://travis-ci.org/sethiele/awsssh.svg?branch=master)](https://travis-ci.org/sethiele/awsssh) || develop: [![Build Status](https://travis-ci.org/sethiele/awsssh.svg?branch=develop)](https://travis-ci.org/sethiele/awsssh)
4
4
 
5
- Mit hilfe dieses Gems kann man sich auf alle (bekannten) AWS EC2 Instancen verbinden die man durch seine Configurationen erreichen darf.
6
- Momentan ist das beschränkt auf EC2 Instancen, die durch OpsWorks verwaltet werden.
5
+ This gem helps you to connect to any `Amazon Web Service` `Opsworks` instances you have permissions for via ssh.
6
+ You don't have to setup your ssh configuration for dynamic Hostnames or dynamic IPs. And this over the borders of profiles (AWS accounts).
7
7
 
8
- Da sich die IP und der Public DNS der Server bei jedem Neustart ändern kann fragt dieses Gem immer bei AWS nach der aktuellen IP/DNS Name.
8
+ This gem reads the AWS Opsworks Stackinformations and looks for the right server to connect. All You have to know is the right Server Hostname (when the host name follows the pattern `PROFILENAME-WHATEVER` this is all you need) and the profile name.
9
9
 
10
10
  ## Installation
11
11
 
12
- Mitlerweile ist aus `awsssh` ein richtiges gem geworden.
13
-
14
12
  1. `gem install awsssh`
15
13
 
16
14
  ### Configurationen
17
- * Es muss die Variable `AWS_CREDENTIAL_FILE` auf das Credentialfile gesetzt sein.
18
- * In der Datei müssen die Zugangsdaten in der folgenden Form enthalten sein:
15
+
16
+ * Be shure you have seted up the Enviroment variable `AWS_CREDENTIAL_FILE` with the path to your credential File. (`echo $AWS_CREDENTIAL_FILE`) If not set the Enviroment variable with `export AWS_CREDENTIAL_FILE=~/.aws/credentials`.
17
+ * Inside the credential file you have to place all your credentials in the following format (its aws standard):
19
18
  ```
20
19
  [PROFILE-1]
21
20
  aws_access_key_id=VALUE
@@ -25,39 +24,44 @@ aws_access_key_id=VALUE
25
24
  aws_secret_access_key=VALUE
26
25
  ```
27
26
 
28
- ## Aufruf
27
+ ## Use `awsssh`
29
28
 
30
- ### Mit Server verbinden
29
+ ### Connect to Server
31
30
 
32
- Wenn der Profilname im Hostname enthalten ist:<br>
33
- `awsssh HOSTNAME`
31
+ If the profile name is the first part of the host name (like `PROFILENAME-WHATEVER`) connect with:<br>
32
+ `awsssh connect HOSTNAME`
34
33
 
35
- **Beispiel**<br>
36
- `awsssh profile-live-1`
34
+ **Example:**<br>
35
+ `awsssh connect profile-live-1`
37
36
 
38
- Wenn der Profilname nicht im Hostname enthalten ist:<br>
39
- `awsssh HOSTNAME --profile PROFILE`
37
+ If the profile name is not the first part of the hostname (like `app-1`) connect with:<br>
38
+ `awsssh connect HOSTNAME --profile PROFILE`
40
39
 
41
- **Beispiel**<br>
42
- `awsssh live-1 --profile KundeXY`
40
+ **Example:**<br>
41
+ `awsssh connect app-1 --profile PROFILENAME`
43
42
 
44
- ### Liste aller Profile
43
+ ### List all profiles
45
44
  `awsssh list_profiles`
46
45
 
47
- ### Liste aller Server für ein Profil
48
- `awsssh list_server PROFIL`
46
+ ### List all server for a given profile
47
+ `awsssh list_server PROFILENAME`
49
48
 
50
- ### Hilfe
49
+ ### Help
51
50
  `awsssh help`
52
51
 
53
52
  ### Version
54
53
  `awsssh version`
55
54
 
56
- ## Kontakt
55
+ ## Contact
57
56
 
58
- Sebastian Thiele Twitter: (@sebat)
57
+ Sebastian Thiele<br>
58
+ (Twitter: [@sebat](https://twitter.com/sebat))
59
59
 
60
60
  ## Changelog
61
+ **2016-xx-xx - v 3.0.0.rc2**
62
+ * readme in english
63
+ * Tests
64
+
61
65
  **2016-02-04 - v 3.0.0.rc1**
62
66
  * redesign
63
67
  * new credential format
data/Rakefile CHANGED
@@ -1,2 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'cucumber'
3
+ require 'cucumber/rake/task'
2
4
 
5
+ Cucumber::Rake::Task.new(:test, "Run tests")
data/awsssh.gemspec CHANGED
@@ -18,9 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.8", ">= 1.8.3"
22
- spec.add_development_dependency "pry", "~> 0.10.3", ">= 0.10.3"
23
- spec.add_development_dependency "rspec", "~> 3.4.0", ">= 3.4.0"
21
+ spec.add_development_dependency "bundler"
22
+ spec.add_development_dependency "pry"
23
+ spec.add_development_dependency "cucumber"
24
+ spec.add_development_dependency "aruba"
25
+ spec.add_development_dependency "rake"
24
26
 
25
27
  spec.add_runtime_dependency "inifile", "~> 3.0.0", ">= 3.0.0"
26
28
  spec.add_runtime_dependency "aws-sdk", "~> 2.2.0", ">= 2.2.0"
@@ -0,0 +1,43 @@
1
+ Feature: Running the program
2
+ Scenario: User runs the program without params
3
+ When I run `awsssh`
4
+ Then the exit status should be 0
5
+ And the output should contain "Commands:"
6
+
7
+ Scenario: User runs the program with version parameter
8
+ When I run `awsssh version`
9
+ Then the exit status should be 0
10
+ And the output should contain "version"
11
+
12
+ Scenario: User runs the program with list_profiles parameter
13
+ Given a file named "bla" with:
14
+ """
15
+ [testprofile]
16
+ aws_access_key_id=ABC
17
+ aws_secret_access_key=XYZ
18
+ region=us-east-1
19
+ """
20
+ When I run `awsssh list_profiles`
21
+ Then the output should contain "testprofile"
22
+
23
+ Scenario: User runs the program with list_server parameter
24
+ When I run `awsssh list_server`
25
+ Then the exit status should be 0
26
+ And the output should contain "ERROR"
27
+ And the output should contain "Usage"
28
+
29
+ Scenario: User runs the programm without `AWS_CREDENTIAL_FILE`
30
+ Given I set the environment variables to:
31
+ | variable | value |
32
+ | AWS_CREDENTIAL_FILE | |
33
+ When I run `awsssh list_profiles`
34
+ Then the output should contain "$AWS_CREDENTIAL_FILE not set"
35
+ And the exit status should not be 0
36
+
37
+ Scenario: User runs the programm woth wrong `AWS_CREDENTIAL_FILE`
38
+ Given I set the environment variables to:
39
+ | variable | value |
40
+ | AWS_CREDENTIAL_FILE | ./test.txt |
41
+ When I run `awsssh list_profiles`
42
+ Then the output should contain "Credential File not found."
43
+ And the exit status should not be 0
@@ -0,0 +1,3 @@
1
+ Given /^PENDING/ do
2
+ pending
3
+ end
@@ -0,0 +1,4 @@
1
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
2
+ ENV['AWS_CREDENTIAL_FILE'] = "bla"
3
+
4
+ require 'aruba/cucumber'
@@ -1,3 +1,3 @@
1
1
  module Awsssh
2
- VERSION = "3.0.0.rc1"
2
+ VERSION = "3.0.0.rc2"
3
3
  end
data/lib/awsssh.rb CHANGED
@@ -75,8 +75,14 @@ module Awsssh
75
75
  # open and check credential file
76
76
  #
77
77
  def open_credantial_file()
78
- raise "Enviroment variable `AWS_CREDENTIAL_FILE` not set" if ENV['AWS_CREDENTIAL_FILE'].nil?
79
- raise "Credential File not found. Please check path `#{ENV['AWS_CREDENTIAL_FILE']}`" unless File.exist?(ENV['AWS_CREDENTIAL_FILE'])
78
+ if ENV['AWS_CREDENTIAL_FILE'].to_s.empty?
79
+ $stderr.puts "$AWS_CREDENTIAL_FILE not set"
80
+ Process.exit!(4)
81
+ end
82
+ unless File.exist?(ENV['AWS_CREDENTIAL_FILE'])
83
+ $stderr.puts "Credential File not found. Please check path `#{ENV['AWS_CREDENTIAL_FILE']}`"
84
+ Process.exit!(4)
85
+ end
80
86
  IniFile.load(ENV['AWS_CREDENTIAL_FILE'])
81
87
  end
82
88
 
@@ -107,8 +113,5 @@ module Awsssh
107
113
  end
108
114
  return nil
109
115
  end
110
-
111
-
112
- default_task :connect
113
116
  end
114
117
  end
metadata CHANGED
@@ -1,75 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc1
4
+ version: 3.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Thiele
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.8'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 1.8.3
19
+ version: '0'
23
20
  type: :development
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.8'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 1.8.3
26
+ version: '0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: pry
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: 0.10.3
40
31
  - - ">="
41
32
  - !ruby/object:Gem::Version
42
- version: 0.10.3
33
+ version: '0'
43
34
  type: :development
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: 0.10.3
50
38
  - - ">="
51
39
  - !ruby/object:Gem::Version
52
- version: 0.10.3
40
+ version: '0'
53
41
  - !ruby/object:Gem::Dependency
54
- name: rspec
42
+ name: cucumber
55
43
  requirement: !ruby/object:Gem::Requirement
56
44
  requirements:
57
- - - "~>"
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
+ - - ">="
58
53
  - !ruby/object:Gem::Version
59
- version: 3.4.0
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
60
59
  - - ">="
61
60
  - !ruby/object:Gem::Version
62
- version: 3.4.0
61
+ version: '0'
63
62
  type: :development
64
63
  prerelease: false
65
64
  version_requirements: !ruby/object:Gem::Requirement
66
65
  requirements:
67
- - - "~>"
66
+ - - ">="
68
67
  - !ruby/object:Gem::Version
69
- version: 3.4.0
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
70
80
  - - ">="
71
81
  - !ruby/object:Gem::Version
72
- version: 3.4.0
82
+ version: '0'
73
83
  - !ruby/object:Gem::Dependency
74
84
  name: inifile
75
85
  requirement: !ruby/object:Gem::Requirement
@@ -139,16 +149,18 @@ extensions: []
139
149
  extra_rdoc_files: []
140
150
  files:
141
151
  - ".gitignore"
152
+ - ".travis.yml"
142
153
  - Gemfile
143
- - Gemfile.lock
144
154
  - LICENSE.txt
145
155
  - README.md
146
156
  - Rakefile
147
157
  - awsssh.gemspec
148
158
  - bin/awsssh
159
+ - features/running.feature
160
+ - features/step_definitions/running_steps.rb
161
+ - features/support/env.rb
149
162
  - lib/awsssh.rb
150
163
  - lib/awsssh/version.rb
151
- - spec/awsssh_spec.rb
152
164
  homepage: https://github.com/sethiele/awsssh
153
165
  licenses:
154
166
  - MIT
@@ -174,4 +186,6 @@ signing_key:
174
186
  specification_version: 4
175
187
  summary: Connects you with OpsWorks EC2
176
188
  test_files:
177
- - spec/awsssh_spec.rb
189
+ - features/running.feature
190
+ - features/step_definitions/running_steps.rb
191
+ - features/support/env.rb
data/Gemfile.lock DELETED
@@ -1,50 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- awsssh (3.0.0.rc1)
5
- aws-sdk (~> 2.2.0, >= 2.2.0)
6
- inifile (~> 3.0.0, >= 3.0.0)
7
- thor (~> 0.19.1, >= 0.19.1)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- aws-sdk (2.2.14)
13
- aws-sdk-resources (= 2.2.14)
14
- aws-sdk-core (2.2.14)
15
- jmespath (~> 1.0)
16
- aws-sdk-resources (2.2.14)
17
- aws-sdk-core (= 2.2.14)
18
- coderay (1.1.0)
19
- diff-lcs (1.2.5)
20
- inifile (3.0.0)
21
- jmespath (1.1.3)
22
- method_source (0.8.2)
23
- pry (0.10.3)
24
- coderay (~> 1.1.0)
25
- method_source (~> 0.8.1)
26
- slop (~> 3.4)
27
- rspec (3.4.0)
28
- rspec-core (~> 3.4.0)
29
- rspec-expectations (~> 3.4.0)
30
- rspec-mocks (~> 3.4.0)
31
- rspec-core (3.4.2)
32
- rspec-support (~> 3.4.0)
33
- rspec-expectations (3.4.0)
34
- diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.4.0)
36
- rspec-mocks (3.4.1)
37
- diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.4.0)
39
- rspec-support (3.4.1)
40
- slop (3.6.0)
41
- thor (0.19.1)
42
-
43
- PLATFORMS
44
- ruby
45
-
46
- DEPENDENCIES
47
- awsssh!
48
- bundler (~> 1.8, >= 1.8.3)
49
- pry (~> 0.10.3, >= 0.10.3)
50
- rspec (~> 3.4.0, >= 3.4.0)
data/spec/awsssh_spec.rb DELETED
@@ -1,17 +0,0 @@
1
- require "awsssh"
2
- describe Awsssh::Awsssh do
3
- def runner(options = {})
4
- @runner ||= Awsssh::Awsssh.new([1], options, :destination_root => destination_root)
5
- end
6
-
7
- def action(*args, &block)
8
- capture(:stdout) { runner.send(*args, &block) }
9
- end
10
-
11
- describe "on list server" do
12
- it "lists all server" do
13
- base = Awsssh::Awsssh.new ["-s"]
14
- expect(base.send(:list_server, 'trox').class).to eq [].class
15
- end
16
- end
17
- end