firespring_dev_commands 2.1.1.pre.alpha.3 → 2.1.1.pre.alpha.5

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: d10b933492abcb58534be8f719de98cd99343e9bb150722ba06f06bc30ada3e4
4
- data.tar.gz: da6153b815fd1b3b8c16d1da502cb083f74f1743fbd207d79c60369e2867e18a
3
+ metadata.gz: 9e54929040a40491ff1d2b36af03da9c718e2770a507cf29f62ab7b24993b8d8
4
+ data.tar.gz: da2feb3080c1864f22b988b9898a08408c874e29251be018b7f82f7290d5a922
5
5
  SHA512:
6
- metadata.gz: d8ece475f87702fe6bb3841ec84301d7d3017870d93e4dacd86a17e7b174dc8975b9b508d935eaf6e235192aefbe59a1f1cd4894356c70e904274a5d84097658
7
- data.tar.gz: 54d47ffc91f1177743b980df5c00b9d8a9d2c3e5870e31b08c6f0117ce33ef0a7701c7ec8f6a295a7043f94038fc98426faebbb04459583f91a31358db60e992
6
+ metadata.gz: bd65f5fb950c89f42cbb761c39241a0f6fd414f99c22e3b8ae6800bc1361ba46b104dd70e1a890477789db04750d14ab8529db53be96e8917f16d4424b2daa46
7
+ data.tar.gz: 85dd595b1e98265d75c41d24d3a98e72dbafa4d1fd112a04849d37061441251e5018a8295ab38486ccc78622052af98c0e111c0fc3498bf221d06072703be3b7
@@ -69,6 +69,13 @@ module Dev
69
69
  @state = FAILED
70
70
  end
71
71
 
72
+ # Get the cloudformation stack
73
+ def exist?
74
+ !client.describe_stacks(stack_name: name).stacks.empty?
75
+ rescue ::Aws::CloudFormation::Errors::ValidationError
76
+ false
77
+ end
78
+
72
79
  # Update the cloudformation stack
73
80
  def update(should_wait: true)
74
81
  # Call upload function to get the s3 url
@@ -31,6 +31,8 @@ module Dev
31
31
 
32
32
  # Start create on all stacks without waiting so they are created in parallel
33
33
  cloudformations.each do |cloudformation|
34
+ next if cloudformation.exist?
35
+
34
36
  cloudformation.create(should_wait: false)
35
37
  end
36
38
  LOG.info 'Waiting for all stacks to finish create'
@@ -62,6 +64,8 @@ module Dev
62
64
 
63
65
  # Start update on all stacks without waiting so they are updated in parallel
64
66
  cloudformations.each do |cloudformation|
67
+ next unless cloudformation.exist?
68
+
65
69
  cloudformation.update(should_wait: false)
66
70
  end
67
71
  LOG.info 'Waiting for all stacks to finish update'
@@ -93,6 +97,8 @@ module Dev
93
97
 
94
98
  # Start delete on all stacks without waiting so they are deleted in parallel
95
99
  cloudformations.each do |cloudformation|
100
+ next unless cloudformation.exist?
101
+
96
102
  cloudformation.delete(should_wait: false)
97
103
  end
98
104
  LOG.info 'Waiting for all stacks to finish delete'
@@ -71,7 +71,17 @@ module Dev
71
71
  params[:key_id] = Dev::Aws::Parameter.new.get_value("#{path}/kms/id")
72
72
  end
73
73
 
74
- message = _set_confirmation_message(param_path, old_value.value, old_value.type, new_value, params[:type])
74
+ message = 'This will change '.light_green +
75
+ param_path.light_yellow +
76
+ ' from "'.light_green +
77
+ old_value.value.light_yellow +
78
+ '" ('.light_green +
79
+ old_value.type.light_yellow +
80
+ ') to "'.light_green +
81
+ new_value.light_yellow +
82
+ '" ('.light_green +
83
+ params[:type].light_yellow +
84
+ '). Continue'.light_green
75
85
  Dev::Common.new.with_confirmation(message, color_message: false) do
76
86
  Dev::Aws::Parameter.new.put(param_path, new_value, **params)
77
87
  end
@@ -81,21 +91,6 @@ module Dev
81
91
  end
82
92
  end
83
93
  # rubocop:enable Metrics/MethodLength
84
-
85
- # Create the confirmation message text
86
- def _set_confirmation_message(path, old_value, old_value_type, new_value, new_value_type)
87
- 'This will change '.light_green +
88
- path.light_yellow +
89
- ' from "'.light_green +
90
- old_value.light_yellow +
91
- '" ('.light_green +
92
- old_value_type.light_yellow +
93
- ') to "'.light_green +
94
- new_value.light_yellow +
95
- '" ('.light_green +
96
- new_value_type.light_yellow +
97
- '). Continue'.light_green
98
- end
99
94
  end
100
95
  end
101
96
  end
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.1.pre.alpha.3'.freeze
9
+ VERSION = '2.1.1.pre.alpha.5'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1.pre.alpha.3
4
+ version: 2.1.1.pre.alpha.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-14 00:00:00.000000000 Z
11
+ date: 2023-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport