tacoma 1.0.11 → 1.0.12

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: 7671a33039dd0abccfbbcc88c7efed13253439b8
4
- data.tar.gz: f4c1d1a2b23c01dd82a2d103b1ec95130b848d14
3
+ metadata.gz: b4c0fa806b894208e53ad3bd5ecd00e36285855b
4
+ data.tar.gz: 185e15e296c11fcfc138ce5299995ecfa4a7db6b
5
5
  SHA512:
6
- metadata.gz: dad5d74aee8aef2678289fa14cbef7a61b0df78d231cf0b90e3a022d6cff9c08b5bdc2085d24a7fcad70783c63bfb56e50f37001280026513c7307ff95fe6368
7
- data.tar.gz: d09385047512791d49be9aa98db74c0deca50a4a934d04ac8e0955c93966d89b181237b81747d0c20e381c6d7df5b5e70dfcbe7466160c6839619bd2fdde0183
6
+ metadata.gz: 4ced14e1f23035c5cd6fe6d116a98d19de8b26a28157c7760e6d70e04243ec029243cee8305208ba24601ae9354d9d2edf4055c1736d3cfb5a52e93f72628e12
7
+ data.tar.gz: 2daf30e0eab0de3a9068379ac7bc2e1d40b0038dff1fbb22ec87691fdd005102913f4bc8fab16c100a25feb69ff13a4675f49ccb51918da227d0bfc34e6c90bd
data/README.md CHANGED
@@ -18,11 +18,13 @@ The format of the `.tacoma.yml` file is pretty straighforward
18
18
  aws_identity_file: "/path/to/pem/file/my_project.pem"
19
19
  aws_secret_access_key: "YOURSECRETACCESSKEY"
20
20
  aws_access_key_id: "YOURACCESSKEYID"
21
+ region: "REGION"
21
22
  repo: "$HOME/projects/my_project"
22
23
  another_project:
23
24
  aws_identity_file: "/path/to/another_pem.pem"
24
25
  aws_secret_access_key: "ANOTHERECRETACCESSKEY"
25
26
  aws_access_key_id: "ANOTHERACCESSKEYID"
27
+ region: "REGION"
26
28
  repo: "$HOME/projects/another_project"
27
29
 
28
30
  Once setup with a file like this, you can run
@@ -49,7 +51,9 @@ Will display the current tacoma version and list all available configuration tem
49
51
 
50
52
  tacoma current
51
53
 
52
- Will display the currently active tacoma environment.
54
+ Will display the currently active tacoma environment.
55
+
56
+ If you don't indicate a specific region, tacoma will use the "eu-west-1" region by default.
53
57
 
54
58
  ## Bash Completion
55
59
 
@@ -8,12 +8,13 @@ module Tacoma
8
8
 
9
9
 
10
10
  module Tool
11
-
11
+ DEFAULT_AWS_REGION = 'eu-west-1'
12
12
 
13
13
  class << self
14
14
  attr_accessor :aws_identity_file
15
15
  attr_accessor :aws_secret_access_key
16
16
  attr_accessor :aws_access_key_id
17
+ attr_accessor :region
17
18
  attr_accessor :repo
18
19
 
19
20
  include CacheEnvironment
@@ -24,24 +25,31 @@ module Tacoma
24
25
  end
25
26
 
26
27
  def load_vars(environment)
27
- config = Tool.config
28
- if config.keys.include?(environment) == false
29
- puts "Cannot find #{environment} key, check your YAML config file"
30
- return false
31
- end
32
-
33
- if config[environment]
34
- @aws_identity_file = config[environment]['aws_identity_file']
35
- @aws_secret_access_key = config[environment]['aws_secret_access_key']
36
- @aws_access_key_id = config[environment]['aws_access_key_id']
37
- @repo = config[environment]['repo']
38
- end
28
+ return false unless exists?(environment)
29
+
30
+ config = Tool.config
31
+ @aws_identity_file = config[environment]['aws_identity_file']
32
+ @aws_secret_access_key = config[environment]['aws_secret_access_key']
33
+ @aws_access_key_id = config[environment]['aws_access_key_id']
34
+ @region = config[environment]['region'] || DEFAULT_AWS_REGION
35
+ @repo = config[environment]['repo']
39
36
  end
40
37
 
41
38
  # Assume there is a ~/.aws/credentials file with a valid format
42
39
  def current_environment
43
40
  read_environment_from_cache
44
41
  end
42
+
43
+ private
44
+ def exists?(environment)
45
+ config = Tool.config
46
+ if config.keys.include?(environment) == false
47
+ puts "Cannot find #{environment} key, check your YAML config file"
48
+ return false
49
+ else
50
+ return true
51
+ end
52
+ end
45
53
  end
46
54
  end
47
55
 
@@ -88,6 +96,7 @@ module Tacoma
88
96
  @aws_identity_file = Tool.aws_identity_file
89
97
  @aws_secret_access_key = Tool.aws_secret_access_key
90
98
  @aws_access_key_id = Tool.aws_access_key_id
99
+ @region = Tool.region
91
100
  @repo = Tool.repo
92
101
 
93
102
 
@@ -105,6 +114,7 @@ module Tacoma
105
114
  puts "export AWS_SECRET_KEY=#{@aws_secret_access_key}"
106
115
  puts "export AWS_ACCESS_KEY=#{@aws_access_key_id}"
107
116
  puts "export AWS_ACCESS_KEY_ID=#{@aws_access_key_id}"
117
+ puts "export AWS_DEFAULT_REGION=#{@region}"
108
118
  end
109
119
 
110
120
  update_environment_to_cache(environment)
@@ -1,3 +1,3 @@
1
1
  module Tacoma
2
- VERSION='1.0.11'
2
+ VERSION='1.0.12'
3
3
  end
@@ -3,3 +3,4 @@
3
3
  [default]
4
4
  aws_access_key_id = <%= @aws_access_key_id %>
5
5
  aws_secret_access_key = <%= @aws_secret_access_key %>
6
+ region = <%= @region %>
@@ -11,10 +11,12 @@ my_first_project:
11
11
  aws_identity_file: "/path/to/pem/file/my_project.pem"
12
12
  aws_secret_access_key: "YOURSECRETACCESSKEY"
13
13
  aws_access_key_id: "YOURACCESSKEYID"
14
+ region: 'REGION'
14
15
  repo: "$HOME/projects/my_first_project"
15
16
 
16
17
  my_second_project:
17
18
  aws_identity_file: "/path/to/pem/file/my_second_project.pem"
18
19
  aws_secret_access_key: "ANOTHERSECRETACCESSKEY"
19
20
  aws_access_key_id: "ANOTHERACCESSKEYID"
21
+ region: 'REGION'
20
22
  repo: "/usr/share/projects/my_second_project"
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.11
4
+ version: 1.0.12
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: 2016-07-18 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor