ufo 6.3.11 → 6.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dee5f362adfe10c3a13ead6bc144fdb42e0a0671b4b445e1ca8d26ad13ee0242
4
- data.tar.gz: 4cdf0f764033f03bc7b545d6538e5e688d8c71a10a5d382b801ed16057f01857
3
+ metadata.gz: 96dbe1f1087d3b65bc76c0cc1372429ea662eb75d91d9b3942c0e27a49809531
4
+ data.tar.gz: e427dd248adee498f897614b5dace90fa5b61ddda04a86ad7ef6990ab87c790c
5
5
  SHA512:
6
- metadata.gz: 621378f349f803f03051ba3af47ef2df5ce5f73073eda011b18f86f4f2782109397a7b54eaa0e4593a0b9541a25e7970afb8fe77c22ba5f6ae4cac59e13ac257
7
- data.tar.gz: e369cde8199aa59ef9bda89d05001cc617010da7c8df144805f1ba5fbce8fd85fc4d513c6bd7e19d5849060ab14943b7369828dddcc9126914759aa8f5a3e06c
6
+ metadata.gz: 32763a18f438116170d9a3d2f7b7e45c6eb3f50ceeb2f714a49412eaf9aa236870c36d0e81b9c8242ef2f35ba01db429b0d12930613e65c093abd4b7ad15a35a
7
+ data.tar.gz: 3f9aa0e0724e55d4eb79432c7752ddb70d98081bcaea516761652afae0d6ce2b90385f6fa8515acd07335f179498a026e7b7bb990a4d29d11b030325d0d7687f
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [6.3.12] - 2022-07-11
7
+ - [#179](https://github.com/tongueroo/ufo/pull/179) auto continue_update_rollback and retry once
8
+
6
9
  ## [6.3.11] - 2022-07-09
7
10
  - [#178](https://github.com/tongueroo/ufo/pull/178) use .ufo/tmp folder instead of /tmp/ufo
8
11
 
data/lib/ufo/cfn/stack.rb CHANGED
@@ -55,9 +55,32 @@ module Ufo::Cfn
55
55
  logger.info "#{action[0..-2].capitalize}ing stack #{@stack_name.color(:green)}"
56
56
  cfn.send("#{action}_stack", stack_options) # Example: cfn.send("update_stack", stack_options)
57
57
  rescue Aws::CloudFormation::Errors::ValidationError => e
58
+ try_continue_update_rollback = continue_update_rollback(e)
59
+ try_continue_update_rollback && retry
58
60
  handle_stack_error(e)
59
61
  end
60
62
 
63
+ # Super edge case where stack is in UPDATE_ROLLBACK_FAILED. Can reproduce by:
64
+ #
65
+ # 1. spinning ECS cluster down to 0 and deploying with ufo ship
66
+ # 2. after 3h will timeout and fail and goes into UPDATE_ROLLBACK_FAILED
67
+ #
68
+ # Screenshot: https://capture.dropbox.com/Pdr8gijnaQvoMp2y
69
+ #
70
+ # Will auto-retry once
71
+ #
72
+ def continue_update_rollback(e)
73
+ if e.message.include?('UPDATE_ROLLBACK_FAILED') && !@continue_update_rollback_tried
74
+ logger.info "Stack in UPDATE_ROLLBACK_FAILED"
75
+ logger.info "Trying a continue_update_rollback and will retry again once"
76
+ cfn.continue_update_rollback(stack_name: @stack_name)
77
+ status.wait
78
+ @continue_update_rollback_tried ||= true
79
+ else
80
+ false
81
+ end
82
+ end
83
+
61
84
  def stack_options
62
85
  options = {
63
86
  capabilities: ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
@@ -2,6 +2,7 @@ module Ufo::TaskDefinition::Helpers
2
2
  module StackOutput
3
3
  include Ufo::AwsServices
4
4
  include Ufo::Concerns::Names
5
+ include Ufo::Utils::Logging
5
6
 
6
7
  def stack_output(name)
7
8
  stack_name, output_key = name.split(".")
data/lib/ufo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ufo
2
- VERSION = "6.3.11"
2
+ VERSION = "6.3.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.11
4
+ version: 6.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-09 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-logs