bora 1.0.0.beta2 → 1.0.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: aaba2dea11a48fb48b3d09b310db47f1e9ba8969
4
- data.tar.gz: e2b8692cb23a26672a6d1a2a1f8554f4efda1c4c
3
+ metadata.gz: eeac87bad618c3f74331672a63389944bf7716c3
4
+ data.tar.gz: 7cd0512cff09f5d9df6b342c72634af1dd452702
5
5
  SHA512:
6
- metadata.gz: 46c40e27b574844e6231c9037f59bb2c510dc70d2eaf6033549c59e842ea3d68bcd86f5ff851f749550afabb612fe84be06147402261a9050a114a15b90241bd
7
- data.tar.gz: 270e4438dfe9084b5e50b42efb81b3a2ce1bc27f5f495de1c901bac5efa18dafcb07d76fb89927c707a645360a4d09ef0132de52e1f725f8dc4e7e4d05b0de46
6
+ metadata.gz: 1f036d4f006abaf326104d3a637d8d1bc9cdbd3cb90bf2d24f420e4c10bb2f794d0ce135881fd1b6a155b4163844564af061ec975dd4a4c3950340e33e62c7c3
7
+ data.tar.gz: 1520b679100f9ed92ba92698ce5b4d8ecdc170626068a3cf206c40c62af79327c366a513746949b60dbcb24315b8400a0c9ca055ac61baddc73164df7e248395
data/README.md CHANGED
@@ -158,6 +158,7 @@ The following commands are available through the command line and rake tasks.
158
158
  * **delete** - Deletes the stack
159
159
  * **diff** - Provides a visual diff between the local template and the currently applied template in AWS
160
160
  * **events** - Outputs the latest events from the stack
161
+ * **list** - Outputs a list of all stacks defined in the config file
161
162
  * **outputs** - Shows the outputs from the stack
162
163
  * **recreate** - Recreates (deletes then creates) the stack
163
164
  * **show** - Shows the local template in JSON, generating it if necessary
@@ -20,6 +20,10 @@ class Bora
20
20
  @templates[name]
21
21
  end
22
22
 
23
+ def templates
24
+ @templates.values
25
+ end
26
+
23
27
  def stack(stack_name)
24
28
  t = @templates.find { |_, template| template.stack(stack_name) != nil }
25
29
  t ? t[1].stack(stack_name) : nil
@@ -5,6 +5,14 @@ class Bora
5
5
  class Cli < Thor
6
6
  class_option :file, type: :string, aliases: :f, default: Bora::DEFAULT_CONFIG_FILE, desc: "The Bora config file to use"
7
7
 
8
+ desc "list", "Lists the available stacks"
9
+ def list
10
+ templates = bora(options.file).templates
11
+ stacks = templates.collect { |t| t.stacks }.flatten
12
+ stack_names = stacks.collect { |s| s.stack_name }
13
+ puts stack_names.join("\n")
14
+ end
15
+
8
16
  desc "apply STACK_NAME", "Creates or updates the stack"
9
17
  option :params, type: :array, aliases: :p, desc: "Parameters to be passed to the template, eg: --params 'instance_type=t2.micro'"
10
18
  def apply(stack_name)
@@ -64,7 +72,7 @@ class Bora
64
72
  private
65
73
 
66
74
  def stack(config_file, stack_name)
67
- bora = Bora.new(config_file_or_hash: config_file)
75
+ bora = bora(config_file)
68
76
  stack = bora.stack(stack_name)
69
77
  if !stack
70
78
  STDERR.puts "Could not find stack #{stack_name}"
@@ -73,6 +81,10 @@ class Bora
73
81
  stack
74
82
  end
75
83
 
84
+ def bora(config_file)
85
+ Bora.new(config_file_or_hash: config_file)
86
+ end
87
+
76
88
  def params
77
89
  options.params ? Hash[options.params.map { |param| param.split("=", 2) }] : {}
78
90
  end
@@ -114,10 +114,8 @@ class Bora
114
114
  end
115
115
 
116
116
  def within_namespace
117
- namespace :stack do
118
- namespace @stack.stack_name do
119
- yield
120
- end
117
+ namespace @stack.stack_name do
118
+ yield
121
119
  end
122
120
  end
123
121
 
@@ -17,6 +17,10 @@ class Bora
17
17
  @stacks[name]
18
18
  end
19
19
 
20
+ def stacks
21
+ @stacks.values
22
+ end
23
+
20
24
  def rake_tasks
21
25
  @stacks.each { |_, s| s.rake_tasks }
22
26
  end
@@ -1,3 +1,3 @@
1
1
  class Bora
2
- VERSION = "1.0.0.beta2"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bora
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Blaxland
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -168,9 +168,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">"
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: 1.3.1
173
+ version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
176
  rubygems_version: 2.4.5.1