sumomo 0.2.1 → 0.3.0

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: 019f0a632279023f951110f7226657c81f172a68
4
- data.tar.gz: 16fe8c16d7018a58371a6a20f06966346a93c8a3
3
+ metadata.gz: 081f53d1cf887c37ccd6634d470674276a600694
4
+ data.tar.gz: d7b8b5d4e40b8b0a283af3dc6dd898a937ee14d8
5
5
  SHA512:
6
- metadata.gz: a7ca388f66aad565904058648db6d6615f9135e88aa8824b75e222eaa14eb208ba624349c08f2b422266801936eb5da209d33cec02f527d65f34f7beeb230eb3
7
- data.tar.gz: c658a9ed05e1823c816fba6d60c2083b5ff2f33903c6d5f4e4d8ecf4c5df0c8514a1721bce9aebf65a5309b8cb53eaefd4c2987f1e3ed26712fb7ec2afb5ecd9
6
+ metadata.gz: 401a6213e3e06dab6ca9e27481bec2f914cf3643f6f0b38d1a817f566104f897cfa174135f8fcfd284901788e51862c67ffbc1bf5db51c192f6132f8a183d625
7
+ data.tar.gz: 0a3e46d8623b2e536bdde1451b1d8db85b735aa90c554073e339e327f8bc425a70f573db980c167172f6c6f60601976673c55db4ca3d4d814a8a8c907a23b074
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "trollop"
4
+ require "sumomo"
5
+ require "yaml"
6
+
7
+ SUB_COMMANDS = %w(delete create update)
8
+ global_opts = Trollop::options do
9
+ banner <<-USAGE
10
+ Sumomo v#{Sumomo::VERSION}
11
+
12
+ Usage: sumomo [options] <create|update|delete|outputs> <stackname>
13
+ USAGE
14
+
15
+ opt :region, "AWS region to use", type: :string, default: "ap-northeast-1"
16
+
17
+ stop_on SUB_COMMANDS
18
+ end
19
+
20
+ cmd = ARGV.shift # get the subcommand
21
+
22
+ cmd_opts = case cmd
23
+ when "delete"
24
+ Sumomo::delete_stack(name: ARGV[0], region: global_opts[:region])
25
+
26
+ when "create", "update"
27
+ local_opts = Trollop::options do
28
+ opt :filename, "File that describes the stack", type: :string, required: true
29
+ end
30
+ Sumomo::create_stack(name: ARGV[0], region: global_opts[:region]) do
31
+ eval File.read(local_opts[:filename]), local_opts[:filename]
32
+ end
33
+
34
+ when "outputs"
35
+ puts "Outputs for stack #{ARGV[0]}"
36
+ puts Sumomo::get_stack_outputs(name: ARGV[0], region: global_opts[:region]).to_yaml
37
+
38
+ else
39
+ Trollop::die "Unknown subcommand #{cmd.inspect}"
40
+ end
41
+
42
+ Sumomo::wait_for_stack(name: ARGV[0], region: global_opts[:region])
@@ -132,13 +132,13 @@ module Sumomo
132
132
 
133
133
  def mkdir(name)
134
134
  @script += <<-SNIPPET
135
- mkdir -p #{name}
135
+ sudo mkdir -p #{name}
136
136
  SNIPPET
137
137
  end
138
138
 
139
139
  def download_file(name, local_path)
140
140
  @script += <<-SNIPPET
141
- aws s3 cp s3://#{@bucket_name}/uploads/#{name} #{local_path}
141
+ sudo aws s3 cp s3://#{@bucket_name}/uploads/#{name} #{local_path}
142
142
  SNIPPET
143
143
  end
144
144
 
@@ -1,3 +1,3 @@
1
1
  module Sumomo
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "rubyzip"
37
37
  spec.add_dependency "activesupport"
38
38
  spec.add_dependency "hashie"
39
+ spec.add_dependency "trollop"
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Siaw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,10 +136,25 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: trollop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Sumomo
140
154
  email:
141
155
  - davidsiaw@gmail.com
142
- executables: []
156
+ executables:
157
+ - sumomo
143
158
  extensions: []
144
159
  extra_rdoc_files: []
145
160
  files:
@@ -159,6 +174,7 @@ files:
159
174
  - data/sumomo/custom_resources/SelectSpot.js
160
175
  - data/sumomo/sources/spot-watcher-poller.sh
161
176
  - data/sumomo/sources/spot-watcher.sh
177
+ - exe/sumomo
162
178
  - lib/sumomo.rb
163
179
  - lib/sumomo/ec2.rb
164
180
  - lib/sumomo/ecs.rb