tacoma 1.0.3 → 1.0.5

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: 57e5d724bfb9469a9364b7c11a8520d991e72aa3
4
- data.tar.gz: 00fc0b60018964d255e988633f8fc0e808078921
3
+ metadata.gz: efbd55211534084016721562a6e93edc3e5faefe
4
+ data.tar.gz: 597b94d16b5dd4615a05ac805df49542ae121142
5
5
  SHA512:
6
- metadata.gz: dc7eb5a903b905036de48a5676e41acba4119118715dd5dd834327192bf3fcc8645ca9975ec111c79224575cce99faeb5a8fae364edf207f3ceff7ac0b3bad9a
7
- data.tar.gz: 3ed33cd6408816bf016067a6283a0553e897273fdc84b8faaee3b6a5d4ae8434752377c4a2958d80d281df525d2778c79f1a5dfd0c308ec5dc90d588e2a6e259
6
+ metadata.gz: f40893334cbe2db53593857a57d13a7c3ae742934fb05371bc38f3206b52ebe2503809f32ce4da7cee6efb31ca1a0ad48e7e4b08b6ba6ef12a3892253a303018
7
+ data.tar.gz: 4399cbcb4bc77a3274984fc8082714af7eb356d3775fc3bb0d4b7ca9dc7ff02f64e8c237b693fd42d5fc25aa82de3280cf0d2f5205ec474d548ecf0c954fb6d2
data/README.md CHANGED
@@ -37,15 +37,16 @@ Will display the export commands for the AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_I
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)
40
+ - [s3cmd](https://github.com/s3tools/s3cmd)
40
41
 
41
42
 
42
43
  ## TODO
43
44
 
44
45
  - Check for errors in the `tacoma.yml` file
45
- - Add other AWS tool providers (Knife, AWS cli, S3cmd, ...)
46
+ - Add other AWS tool providers (Knife, AWS cli, ...)
46
47
  - Honor the different optional environment vars for the different config files (i.e `FOG_RC`)
47
48
 
48
49
 
49
50
  ## THANKS
50
51
 
51
- This tool is shamelessly inspired in Raul Murciano's [rack-generator](https://github.com/raul/rack-generator)
52
+ This tool is shamelessly inspired in Raul Murciano's [rack-generator](https://github.com/raul/rack-generator)
@@ -4,38 +4,38 @@ require 'pathname'
4
4
 
5
5
 
6
6
  module Tacoma
7
-
7
+
8
8
  module Tool
9
9
  class << self
10
10
  attr_accessor :aws_identity_file
11
11
  attr_accessor :aws_secret_access_key
12
12
  attr_accessor :aws_access_key_id
13
13
  attr_accessor :repo
14
-
14
+
15
15
  def config
16
16
  filename = File.join(Dir.home, ".tacoma.yml")
17
17
  return YAML::load_file(filename)
18
18
  end
19
-
19
+
20
20
  def load_vars(environment)
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
24
  return
25
25
  end
26
-
26
+
27
27
  if config[environment]
28
- @aws_identity_file = config[environment]['aws_identity_file']
28
+ @aws_identity_file = config[environment]['aws_identity_file']
29
29
  @aws_secret_access_key = config[environment]['aws_secret_access_key']
30
- @aws_access_key_id = config[environment]['aws_access_key_id']
31
- @repo = config[environment]['repo']
30
+ @aws_access_key_id = config[environment]['aws_access_key_id']
31
+ @repo = config[environment]['repo']
32
32
  end
33
33
  end
34
34
  end
35
35
  end
36
-
36
+
37
37
  class Command < Thor
38
-
38
+
39
39
  include Thor::Actions
40
40
 
41
41
  desc "list", "Lists all known AWS environments"
@@ -44,26 +44,35 @@ module Tacoma
44
44
  puts key
45
45
  end
46
46
  end
47
-
47
+
48
48
  desc "switch ENVIRONMENT", "Loads AWS environment vars"
49
49
  def switch(environment)
50
-
50
+
51
51
  Tool.load_vars(environment)
52
52
  @aws_identity_file = Tool.aws_identity_file
53
53
  @aws_secret_access_key = Tool.aws_secret_access_key
54
54
  @aws_access_key_id = Tool.aws_access_key_id
55
- @repo = Tool.repo
56
-
55
+ @repo = Tool.repo
56
+
57
57
  # set configurations for tools
58
- {fog: '.fog', boto: '.boto'}.each do |tool, config_path|
58
+ {fog: '.fog', boto: '.boto', s3cfg: '.s3cfg'}.each do |tool, config_path|
59
59
  template_path = Pathname.new("#{self.class.source_root}/../template/#{tool}").realpath.to_s
60
60
  file_path = File.join(Dir.home, config_path)
61
61
  template template_path, file_path, :force => true
62
62
  end
63
-
63
+
64
64
  system("ssh-add #{@aws_identity_file}")
65
65
  end
66
66
 
67
+ desc "cd ENVIRONMENT", "Change directory to the project path"
68
+ def cd(environment)
69
+ switch(environment)
70
+ Dir.chdir `echo #{@repo}`.strip
71
+ puts "Welcome to the tacoma shell"
72
+ system("bash --login")
73
+ Process.kill(:SIGQUIT, Process.getpgid(Process.ppid))
74
+ end
75
+
67
76
  desc "install", "Create a sample ~/.tacoma.yml file"
68
77
  def install
69
78
  if (File.exists?(File.join(Dir.home, ".tacoma.yml")))
@@ -77,7 +86,7 @@ module Tacoma
77
86
 
78
87
  def self.source_root
79
88
  File.dirname(__FILE__)
80
- end
89
+ end
81
90
 
82
91
  end
83
92
 
@@ -1,3 +1,3 @@
1
1
  module Tacoma
2
- VERSION='1.0.3'
2
+ VERSION='1.0.5'
3
3
  end
@@ -0,0 +1,38 @@
1
+ [default]
2
+ access_key = <%= @aws_access_key_id %>
3
+ bucket_location = US
4
+ cloudfront_host = cloudfront.amazonaws.com
5
+ cloudfront_resource = /2010-07-15/distribution
6
+ default_mime_type = binary/octet-stream
7
+ delete_removed = False
8
+ dry_run = False
9
+ encoding = UTF-8
10
+ encrypt = False
11
+ follow_symlinks = False
12
+ force = False
13
+ get_continue = False
14
+ gpg_command = None
15
+ gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
16
+ gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
17
+ gpg_passphrase =
18
+ guess_mime_type = True
19
+ host_base = s3.amazonaws.com
20
+ host_bucket = %(bucket)s.s3.amazonaws.com
21
+ human_readable_sizes = False
22
+ list_md5 = False
23
+ log_target_prefix =
24
+ preserve_attrs = True
25
+ progress_meter = True
26
+ proxy_host =
27
+ proxy_port = 0
28
+ recursive = False
29
+ recv_chunk = 4096
30
+ reduced_redundancy = False
31
+ secret_key = <%= @aws_secret_access_key %>
32
+ send_chunk = 4096
33
+ simpledb_host = sdb.amazonaws.com
34
+ skip_existing = False
35
+ socket_timeout = 300
36
+ urlencoding_mode = normal
37
+ use_https = False
38
+ verbosity = WARNING
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.3
4
+ version: 1.0.5
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: 2013-12-11 00:00:00.000000000 Z
11
+ date: 2014-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -83,6 +83,7 @@ files:
83
83
  - lib/tacoma/version.rb
84
84
  - lib/template/boto
85
85
  - lib/template/fog
86
+ - lib/template/s3cfg
86
87
  - lib/template/tacoma.yml
87
88
  - tacoma.gemspec
88
89
  homepage: https://github.com/pantulis/tacoma