tacoma 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/Gemfile +2 -3
- data/README.md +5 -2
- data/contrib/tacoma.completion.sh +1 -1
- data/lib/tacoma.rb +1 -0
- data/lib/tacoma/cache_environment.rb +24 -0
- data/lib/tacoma/command.rb +17 -16
- data/lib/tacoma/version.rb +1 -1
- data/tacoma.gemspec +0 -2
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7671a33039dd0abccfbbcc88c7efed13253439b8
|
4
|
+
data.tar.gz: f4c1d1a2b23c01dd82a2d103b1ec95130b848d14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dad5d74aee8aef2678289fa14cbef7a61b0df78d231cf0b90e3a022d6cff9c08b5bdc2085d24a7fcad70783c63bfb56e50f37001280026513c7307ff95fe6368
|
7
|
+
data.tar.gz: d09385047512791d49be9aa98db74c0deca50a4a934d04ac8e0955c93966d89b181237b81747d0c20e381c6d7df5b5e70dfcbe7466160c6839619bd2fdde0183
|
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -33,7 +33,7 @@ And it will list all the configured entries. Running
|
|
33
33
|
|
34
34
|
tacoma switch project
|
35
35
|
|
36
|
-
Will
|
36
|
+
Will add the specified identity file into the SSH agent, and will generate configuration files for the supported tools, which at this time are
|
37
37
|
|
38
38
|
- [Fog](https://github.com/fog/fog), which should work with Capistrano's capify-ec2.
|
39
39
|
- [Boto](https://github.com/boto/boto)
|
@@ -41,12 +41,15 @@ Will display the export commands for the AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_I
|
|
41
41
|
- [route53](https://github.com/pcorliss/ruby_route_53)
|
42
42
|
- [aws cli](https://github.com/aws/aws-cli)
|
43
43
|
|
44
|
-
Running tacoma switch with the
|
44
|
+
Running `tacoma switch` with the `--with-exports` option will also echo shell export sentences for the most common incarnations of the AWS env vars.
|
45
45
|
|
46
46
|
tacoma version
|
47
47
|
|
48
48
|
Will display the current tacoma version and list all available configuration templates (providers).
|
49
49
|
|
50
|
+
tacoma current
|
51
|
+
|
52
|
+
Will display the currently active tacoma environment.
|
50
53
|
|
51
54
|
## Bash Completion
|
52
55
|
|
data/lib/tacoma.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module CacheEnvironment
|
2
|
+
|
3
|
+
def environment_cache_path
|
4
|
+
"#{Dir.home}/.tacoma_current_environment"
|
5
|
+
end
|
6
|
+
|
7
|
+
def update_environment_to_cache(environment)
|
8
|
+
begin
|
9
|
+
File.open(environment_cache_path, 'w') { |file| file.write(environment) }
|
10
|
+
rescue
|
11
|
+
puts "Cannot write at #{environment_cache_path}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def read_environment_from_cache
|
16
|
+
str = begin
|
17
|
+
File.open(environment_cache_path, &:readline)
|
18
|
+
rescue
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
str
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/tacoma/command.rb
CHANGED
@@ -5,13 +5,19 @@ require 'pathname'
|
|
5
5
|
|
6
6
|
module Tacoma
|
7
7
|
|
8
|
+
|
9
|
+
|
8
10
|
module Tool
|
11
|
+
|
12
|
+
|
9
13
|
class << self
|
10
14
|
attr_accessor :aws_identity_file
|
11
15
|
attr_accessor :aws_secret_access_key
|
12
16
|
attr_accessor :aws_access_key_id
|
13
17
|
attr_accessor :repo
|
14
18
|
|
19
|
+
include CacheEnvironment
|
20
|
+
|
15
21
|
def config
|
16
22
|
filename = File.join(Dir.home, ".tacoma.yml")
|
17
23
|
return YAML::load_file(filename)
|
@@ -34,19 +40,7 @@ module Tacoma
|
|
34
40
|
|
35
41
|
# Assume there is a ~/.aws/credentials file with a valid format
|
36
42
|
def current_environment
|
37
|
-
|
38
|
-
File.open(current_filename).each do |line|
|
39
|
-
if /aws_access_key_id/ =~ line
|
40
|
-
current_access_key_id = line[20..-2] # beware the CRLF
|
41
|
-
config = Tool.config
|
42
|
-
for key in config.keys
|
43
|
-
if config[key]['aws_access_key_id'] == current_access_key_id
|
44
|
-
return "#{key}"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
nil
|
43
|
+
read_environment_from_cache
|
50
44
|
end
|
51
45
|
end
|
52
46
|
end
|
@@ -55,6 +49,8 @@ module Tacoma
|
|
55
49
|
|
56
50
|
include Thor::Actions
|
57
51
|
|
52
|
+
include CacheEnvironment
|
53
|
+
|
58
54
|
desc "list", "Lists all known AWS environments"
|
59
55
|
def list
|
60
56
|
Tool.config.keys.each do |key|
|
@@ -94,6 +90,8 @@ module Tacoma
|
|
94
90
|
@aws_access_key_id = Tool.aws_access_key_id
|
95
91
|
@repo = Tool.repo
|
96
92
|
|
93
|
+
|
94
|
+
|
97
95
|
# set configurations for tools
|
98
96
|
TOOLS.each do |tool, config_path|
|
99
97
|
template_path = Pathname.new("#{self.class.source_root}/../template/#{tool}").realpath.to_s
|
@@ -108,6 +106,9 @@ module Tacoma
|
|
108
106
|
puts "export AWS_ACCESS_KEY=#{@aws_access_key_id}"
|
109
107
|
puts "export AWS_ACCESS_KEY_ID=#{@aws_access_key_id}"
|
110
108
|
end
|
109
|
+
|
110
|
+
update_environment_to_cache(environment)
|
111
|
+
|
111
112
|
return true
|
112
113
|
else
|
113
114
|
return false
|
@@ -143,9 +144,9 @@ module Tacoma
|
|
143
144
|
end
|
144
145
|
end
|
145
146
|
|
146
|
-
|
147
|
-
|
148
|
-
|
147
|
+
def self.source_root
|
148
|
+
File.dirname(__FILE__)
|
149
|
+
end
|
149
150
|
|
150
151
|
end
|
151
152
|
|
data/lib/tacoma/version.rb
CHANGED
data/tacoma.gemspec
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tacoma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Lupión
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Easy command line tool for AWS credentials management
|
@@ -74,13 +74,14 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- .gitignore
|
77
|
+
- ".gitignore"
|
78
78
|
- CHANGELOG
|
79
79
|
- Gemfile
|
80
80
|
- README.md
|
81
81
|
- bin/tacoma
|
82
82
|
- contrib/tacoma.completion.sh
|
83
83
|
- lib/tacoma.rb
|
84
|
+
- lib/tacoma/cache_environment.rb
|
84
85
|
- lib/tacoma/command.rb
|
85
86
|
- lib/tacoma/version.rb
|
86
87
|
- lib/template/aws_credentials
|
@@ -100,20 +101,19 @@ require_paths:
|
|
100
101
|
- lib
|
101
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
103
|
requirements:
|
103
|
-
- -
|
104
|
+
- - ">="
|
104
105
|
- !ruby/object:Gem::Version
|
105
106
|
version: '0'
|
106
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
108
|
requirements:
|
108
|
-
- -
|
109
|
+
- - ">="
|
109
110
|
- !ruby/object:Gem::Version
|
110
111
|
version: '0'
|
111
112
|
requirements: []
|
112
113
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.4.6
|
114
115
|
signing_key:
|
115
116
|
specification_version: 4
|
116
117
|
summary: This tool reads a YAML file with the credentials for your AWS accounts and
|
117
118
|
loads them into your environment.
|
118
119
|
test_files: []
|
119
|
-
has_rdoc:
|