stack_master 1.11.1-x64-mingw32 → 1.12.0-x64-mingw32

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: c449fb5688bf2a861bdb054c22e6d0cf7a99bacf
4
- data.tar.gz: a1dadea1f9575fc082d5a234407cc968101b82e8
3
+ metadata.gz: e52ba7c1a39b2978a64717487b4cf314e04d64c8
4
+ data.tar.gz: f143cfd33624bac80dab51329bd0ae89eb574379
5
5
  SHA512:
6
- metadata.gz: 2b472772959d43be6500c1dff64d2e0e2fef1293d5cb442b997b3f70b78fddcb4a882f36fab6fcc41fc14a2881595c1c239347f238c4288ec80bdedea1a573f4
7
- data.tar.gz: 265e1872ca549cb76590b771ab9ded1a0165d39e138e6534c1f205efd30afcced2c5db000adec6c379ebaf4bcd6da27edef28ee81f1f9af0d64425a4c9975f64
6
+ metadata.gz: 204f9935c56cbef2bd7814b8a7ee80ed8fdd479239f423224b320124331fb300d56fd11772e4183300ad07259e47c650a5ca3c59dd666c955a01b38ea07594da
7
+ data.tar.gz: 128e2a78fba1d8823234dbad20c95adbfb53cf5341ecfad9fbe28edb14d5ffee4bf7ee25255b03a1486d6d6db9f4d889346fa97041f7daf3bb0e819e9e36e3e9
data/README.md CHANGED
@@ -344,7 +344,7 @@ Returns the docker repository URI, i.e. `aws_account_id.dkr.ecr.region.amazonaws
344
344
  container_image_id:
345
345
  latest_container:
346
346
  repository_name: nginx # Required. The name of the repository
347
- registry_id: 012345678910 # The AWS Account ID the repository is located in. Defaults to the current account's default registry
347
+ registry_id: "012345678910" # The AWS Account ID the repository is located in. Defaults to the current account's default registry. Must be in quotes.
348
348
  region: us-east-1 # Defaults to the region the stack is located in
349
349
  tag: production # By default we'll find the latest image pushed to the repository. If tag is specified we return the sha digest of the image with this tag
350
350
  ```
data/lib/stack_master.rb CHANGED
@@ -94,6 +94,10 @@ module StackMaster
94
94
  autoload :Streamer, 'stack_master/stack_events/streamer'
95
95
  end
96
96
 
97
+ NON_INTERACTIVE_DEFAULT = false
98
+ DEBUG_DEFAULT = false
99
+ QUIET_DEFAULT = false
100
+
97
101
  def interactive?
98
102
  !non_interactive?
99
103
  end
@@ -101,7 +105,7 @@ module StackMaster
101
105
  def non_interactive?
102
106
  @non_interactive
103
107
  end
104
- @non_interactive = false
108
+ @non_interactive = NON_INTERACTIVE_DEFAULT
105
109
 
106
110
  def non_interactive!
107
111
  @non_interactive = true
@@ -110,7 +114,7 @@ module StackMaster
110
114
  def debug!
111
115
  @debug = true
112
116
  end
113
- @debug = false
117
+ @debug = DEBUG_DEFAULT
114
118
 
115
119
  def debug?
116
120
  @debug
@@ -121,6 +125,19 @@ module StackMaster
121
125
  stderr.puts "[DEBUG] #{message}".colorize(:green)
122
126
  end
123
127
 
128
+ def quiet!
129
+ @quiet = true
130
+ end
131
+ @quiet = QUIET_DEFAULT
132
+
133
+ def quiet?
134
+ @quiet
135
+ end
136
+
137
+ def reset_flags
138
+ @quiet = QUIET_DEFAULT
139
+ end
140
+
124
141
  attr_accessor :non_interactive_answer
125
142
  @non_interactive_answer = 'y'
126
143
 
@@ -35,6 +35,9 @@ module StackMaster
35
35
  global_option '-d', '--debug', 'Run in debug mode' do
36
36
  StackMaster.debug!
37
37
  end
38
+ global_option '-q', '--quiet', 'Do not output the resulting Stack Events, just return immediately' do
39
+ StackMaster.quiet!
40
+ end
38
41
 
39
42
  command :apply do |c|
40
43
  c.syntax = 'stack_master apply [region_or_alias] [stack_name]'
@@ -187,8 +190,10 @@ module StackMaster
187
190
  region = args[0]
188
191
  end
189
192
 
193
+ stack_name = Utils.underscore_to_hyphen(args[1])
194
+
190
195
  StackMaster.cloud_formation_driver.set_region(region)
191
- StackMaster::Commands::Delete.perform(region, args[1])
196
+ StackMaster::Commands::Delete.perform(region, stack_name)
192
197
  end
193
198
  end
194
199
 
@@ -21,7 +21,7 @@ module StackMaster
21
21
  ensure_valid_parameters!
22
22
  ensure_valid_template_body_size!
23
23
  create_or_update_stack
24
- tail_stack_events
24
+ tail_stack_events unless StackMaster.quiet?
25
25
  set_stack_policy
26
26
  end
27
27
 
@@ -20,7 +20,7 @@ module StackMaster
20
20
  end
21
21
 
22
22
  delete_stack
23
- tail_stack_events
23
+ tail_stack_events unless StackMaster.quiet?
24
24
  end
25
25
 
26
26
  private
@@ -17,12 +17,14 @@ module StackMaster
17
17
  ecr_client = Aws::ECR::Client.new(region: @region)
18
18
 
19
19
  images = fetch_images(parameters['repository_name'], parameters['registry_id'], ecr_client)
20
- return nil if images.empty?
21
20
 
22
- if !parameters['tag'].nil?
21
+ unless parameters['tag'].nil?
23
22
  images.select! { |image| image.image_tags.any? { |tag| tag == parameters['tag'] } }
24
23
  end
25
24
  images.sort! { |image_x, image_y| image_y.image_pushed_at <=> image_x.image_pushed_at }
25
+
26
+ return nil if images.empty?
27
+
26
28
  latest_image = images.first
27
29
 
28
30
  # aws_account_id.dkr.ecr.region.amazonaws.com/repository@sha256:digest
@@ -1,3 +1,3 @@
1
1
  module StackMaster
2
- VERSION = "1.11.1"
2
+ VERSION = "1.12.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.12.0
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Steve Hodgkiss
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-16 00:00:00.000000000 Z
12
+ date: 2019-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '1.5'
20
+ version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '1.5'
27
+ version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement