tacoma 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/tacoma/command.rb +32 -27
- data/lib/tacoma/version.rb +1 -1
- data/lib/template/aws_credentials +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 078cadfaa9a052324dee98ffc3b9ead0475d8073
|
4
|
+
data.tar.gz: b4e4420034a21a7c4dc94466f01f92df7dd9d6df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c03c155a64652518a29589fa5ddb5b32f8957251bf180f1190d75e24dc3d28a0492a4d72fe33c631855d892a19956c64f874f6c02b32fd561fc1909033afde5b
|
7
|
+
data.tar.gz: 5c1cc5079915143ed9a4c4b98b2fedb841c7dc067fc8cd0bb8fa86cedc436d7e22a84e4baf33c109eb614d25ea8661a3fbde0e44988b00707cbdf3620df9fe24
|
data/README.md
CHANGED
@@ -10,8 +10,8 @@ Simple command-line tool for managing AWS credentials across different projects
|
|
10
10
|
|
11
11
|
Tacoma needs a special file `.tacoma.yml` in your home directory. It can create a sample for you with
|
12
12
|
|
13
|
-
tacoma install
|
14
|
-
|
13
|
+
tacoma install
|
14
|
+
|
15
15
|
The format of the `.tacoma.yml` file is pretty straighforward
|
16
16
|
|
17
17
|
project:
|
@@ -25,7 +25,7 @@ The format of the `.tacoma.yml` file is pretty straighforward
|
|
25
25
|
aws_access_key_id: "ANOTHERACCESSKEYID"
|
26
26
|
repo: "$HOME/projects/another_project"
|
27
27
|
|
28
|
-
Once setup with a file like this, you can run
|
28
|
+
Once setup with a file like this, you can run
|
29
29
|
|
30
30
|
tacoma list
|
31
31
|
|
@@ -38,6 +38,8 @@ Will display the export commands for the AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_I
|
|
38
38
|
- [Fog](https://github.com/fog/fog), which should work with Capistrano's capify-ec2.
|
39
39
|
- [Boto](https://github.com/boto/boto)
|
40
40
|
- [s3cmd](https://github.com/s3tools/s3cmd)
|
41
|
+
- [route53](https://github.com/pcorliss/ruby_route_53)
|
42
|
+
- [aws cli](https://github.com/aws/aws-cli)
|
41
43
|
|
42
44
|
## Bash Completion
|
43
45
|
|
data/lib/tacoma/command.rb
CHANGED
@@ -21,7 +21,7 @@ module Tacoma
|
|
21
21
|
config = Tool.config
|
22
22
|
if config.keys.include?(environment) == false
|
23
23
|
puts "Cannot find #{environment} key, check your YAML config file"
|
24
|
-
return
|
24
|
+
return false
|
25
25
|
end
|
26
26
|
|
27
27
|
if config[environment]
|
@@ -48,37 +48,42 @@ module Tacoma
|
|
48
48
|
desc "switch ENVIRONMENT", "Loads AWS environment vars"
|
49
49
|
def switch(environment)
|
50
50
|
|
51
|
-
Tool.load_vars(environment)
|
52
|
-
@aws_identity_file = Tool.aws_identity_file
|
53
|
-
@aws_secret_access_key = Tool.aws_secret_access_key
|
54
|
-
@aws_access_key_id = Tool.aws_access_key_id
|
55
|
-
@repo = Tool.repo
|
56
|
-
|
57
|
-
# set configurations for tools
|
58
|
-
{fog: '.fog', boto: '.boto', s3cfg: '.s3cfg', route53: '.route53'}.each do |tool, config_path|
|
59
|
-
template_path = Pathname.new("#{self.class.source_root}/../template/#{tool}").realpath.to_s
|
60
|
-
file_path = File.join(Dir.home, config_path)
|
61
|
-
template template_path, file_path, :force => true
|
62
|
-
end
|
63
51
|
|
64
|
-
|
52
|
+
if Tool.load_vars(environment)
|
53
|
+
@aws_identity_file = Tool.aws_identity_file
|
54
|
+
@aws_secret_access_key = Tool.aws_secret_access_key
|
55
|
+
@aws_access_key_id = Tool.aws_access_key_id
|
56
|
+
@repo = Tool.repo
|
57
|
+
|
58
|
+
# set configurations for tools
|
59
|
+
{fog: '.fog', boto: '.boto', s3cfg: '.s3cfg', route53: '.route53', aws_credentials: '.aws/credentials'}.each do |tool, config_path|
|
60
|
+
template_path = Pathname.new("#{self.class.source_root}/../template/#{tool}").realpath.to_s
|
61
|
+
file_path = File.join(Dir.home, config_path)
|
62
|
+
template template_path, file_path, :force => true
|
63
|
+
end
|
64
|
+
system("ssh-add #{@aws_identity_file}")
|
65
|
+
return true
|
66
|
+
else
|
67
|
+
return false
|
68
|
+
end
|
65
69
|
end
|
66
70
|
|
67
71
|
desc "cd ENVIRONMENT", "Change directory to the project path"
|
68
72
|
def cd(environment)
|
69
|
-
switch(environment)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
if switch(environment)
|
74
|
+
Dir.chdir `echo #{@repo}`.strip
|
75
|
+
puts "Welcome to the tacoma shell"
|
76
|
+
shell = ENV['SHELL'].split('/').last
|
77
|
+
options =
|
78
|
+
case shell
|
79
|
+
when 'zsh'
|
80
|
+
''
|
81
|
+
else
|
82
|
+
'--login'
|
83
|
+
end
|
84
|
+
system("#{shell} #{options}")
|
85
|
+
Process.kill(:SIGQUIT, Process.getpgid(Process.ppid))
|
86
|
+
end
|
82
87
|
end
|
83
88
|
|
84
89
|
desc "install", "Create a sample ~/.tacoma.yml file"
|
data/lib/tacoma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.8
|
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: 2015-
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/tacoma.rb
|
83
83
|
- lib/tacoma/command.rb
|
84
84
|
- lib/tacoma/version.rb
|
85
|
+
- lib/template/aws_credentials
|
85
86
|
- lib/template/boto
|
86
87
|
- lib/template/fog
|
87
88
|
- lib/template/route53
|