ruby_aem_aws 2.4.0 → 2.4.1

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: 626bc89b5ffff631dec7cbf1ce085ede5e6ae5f2
4
- data.tar.gz: '085b7e66c4b4af44a31a96dc8596136c6918e417'
3
+ metadata.gz: 127f5b90f64b8f1bd149bb34c3b1a6bfaf2d3348
4
+ data.tar.gz: 412586db736b7bcb7fc4737cae3f18a392ef22aa
5
5
  SHA512:
6
- metadata.gz: 67d6c53a75c92a80624e4f3e2b958f8c185390e0e4b0b2f35414d63bd57165ccdc25571fc8d3002e32f889a5880f4d26b89d2b84c0862bb59628d7c142cc016e
7
- data.tar.gz: eae039eca92be8c294dad7ccc53c296e7c9703c74de8bb116e5ec471117de646cfdd274f6548cda5656f44fbf248d5e57fa66a167efb17142e58c9ecbd962946
6
+ metadata.gz: 3ad3b0e2d3d321f59d614a4a4bdb4522db74c73568da452a67ffd61deb93f67eedde53c4019630159ad1330a2e0c017e77e8a77b912ce1d4a9c53bd6a5668140
7
+ data.tar.gz: 024e9c16f7e8cbd5e9d2a63382b8ce6f9041372949d03e51583547fcc901af1356a7eefb4559821c1f53011ebb5bdca4eaa617a91c1e2d95a5090665a443d271
data/conf/gem.yaml CHANGED
@@ -1 +1 @@
1
- version: 2.4.0
1
+ version: 2.4.1
@@ -18,6 +18,8 @@ require_relative '../component/chaos_monkey'
18
18
  require_relative '../component/orchestrator'
19
19
  require_relative '../component/publish_dispatcher'
20
20
  require_relative '../component/publish'
21
+ require_relative '../component/preview_publish_dispatcher'
22
+ require_relative '../component/preview_publish'
21
23
  require_relative '../mixins/metric_verifier'
22
24
 
23
25
  module RubyAemAws
@@ -96,9 +98,19 @@ module RubyAemAws
96
98
  RubyAemAws::Component::Publish.new(@stack_prefix, @publish_aws_clients)
97
99
  end
98
100
 
101
+ # @return new RubyAemAws::Component::PreviewPublish instance
102
+ def preview_publish
103
+ RubyAemAws::Component::PreviewPublish.new(@stack_prefix, @publish_aws_clients)
104
+ end
105
+
99
106
  # @return new RubyAemAws::Component::PublishDispatcher instance
100
107
  def publish_dispatcher
101
108
  RubyAemAws::Component::PublishDispatcher.new(@stack_prefix, @dispatcher_aws_clients)
102
109
  end
110
+
111
+ # @return new RubyAemAws::Component::PreviewPublishDispatcher instance
112
+ def preview_publish_dispatcher
113
+ RubyAemAws::Component::PreviewPublishDispatcher.new(@stack_prefix, @dispatcher_aws_clients)
114
+ end
103
115
  end
104
116
  end
@@ -0,0 +1,79 @@
1
+ # Copyright 2018-2021 Shine Solutions Group
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative '../abstract/grouped_component'
16
+ require_relative '../abstract/snapshot'
17
+ require_relative '../constants'
18
+ require_relative '../mixins/healthy_resource_verifier'
19
+ require_relative '../mixins/metric_verifier'
20
+ require_relative '../mixins/snapshot_verifier'
21
+
22
+ module RubyAemAws
23
+ module Component
24
+ # Interface to the AWS instance running the Preview Publish component of a full-set AEM stack.
25
+ class PreviewPublish
26
+ attr_reader :descriptor, :ec2_resource, :cloud_watch_client, :asg_client, :cloud_watch_log_client
27
+
28
+ include AbstractGroupedComponent
29
+ include AbstractSnapshot
30
+ include HealthyResourceVerifier
31
+ include MetricVerifier
32
+ include SnapshotVerifier
33
+
34
+ EC2_COMPONENT = 'preview-publish'.freeze
35
+ EC2_NAME = 'AEM Preview Publish'.freeze
36
+
37
+ # @param stack_prefix AWS tag: StackPrefix
38
+ # @param params Array of AWS Clients and Resource connections:
39
+ # - AutoScalingClient: AWS AutoScalingGroup Client.
40
+ # - CloudWatchClient: AWS Cloudwatch Client.
41
+ # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
42
+ # - Ec2Resource: AWS EC2 Resource connection.
43
+ # @return new RubyAemAws::FullSet::PreviewPublish
44
+ def initialize(stack_prefix, params)
45
+ @descriptor = ComponentDescriptor.new(stack_prefix,
46
+ EC2Descriptor.new(EC2_COMPONENT, EC2_NAME))
47
+ @asg_client = params[:AutoScalingClient]
48
+ @cloud_watch_client = params[:CloudWatchClient]
49
+ @cloud_watch_log_client = params[:CloudWatchLogsClient]
50
+ @ec2_resource = params[:Ec2Resource]
51
+ end
52
+
53
+ def terminate_all_instances
54
+ get_all_instances.each do |i|
55
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
56
+
57
+ i.terminate
58
+ i.wait_until_terminated
59
+ end
60
+ end
61
+
62
+ def terminate_random_instance
63
+ instance = get_random_instance
64
+ instance.terminate
65
+ instance.wait_until_terminated
66
+ end
67
+
68
+ def get_tags
69
+ tags = []
70
+ get_all_instances.each do |i|
71
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
72
+
73
+ tags.push(i.tags)
74
+ end
75
+ tags
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,84 @@
1
+ # Copyright 2018-2021 Shine Solutions Group
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative '../abstract/grouped_component'
16
+ require_relative '../abstract/snapshot'
17
+ require_relative '../constants'
18
+ require_relative '../mixins/healthy_resource_verifier'
19
+ require_relative '../mixins/metric_verifier'
20
+ require_relative '../mixins/snapshot_verifier'
21
+
22
+ module RubyAemAws
23
+ module Component
24
+ # Interface to the AWS instance running the Preview PublishDispatcher component of a full-set AEM stack.
25
+ class PreviewPublishDispatcher
26
+ attr_reader :descriptor, :ec2_resource, :asg_client, :elb_client, :cloud_watch_client, :cloud_watch_log_client
27
+
28
+ include AbstractGroupedComponent
29
+ include AbstractSnapshot
30
+ include HealthyResourceVerifier
31
+ include MetricVerifier
32
+ include SnapshotVerifier
33
+
34
+ EC2_COMPONENT = 'preview-publish-dispatcher'.freeze
35
+ EC2_NAME = 'AEM Preview Publish Dispatcher'.freeze
36
+ ELB_ID = 'PreviewPublishDispatcherLoadBalancer'.freeze
37
+ ELB_NAME = 'AEM Preview Publish Dispatcher Load Balancer'.freeze
38
+
39
+ # @param stack_prefix AWS tag: StackPrefix
40
+ # @param params Array of AWS Clients and Resource connections:
41
+ # - AutoScalingClient: AWS AutoScalingGroup Client.
42
+ # - CloudWatchClient: AWS Cloudwatch Client.
43
+ # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
44
+ # - Ec2Resource: AWS EC2 Resource connection.
45
+ # - ElbClient: AWS ElasticLoadBalancer v2 Client.
46
+ # @return new RubyAemAws::FullSet::PreviewPublishDispatcher
47
+ def initialize(stack_prefix, params)
48
+ @descriptor = ComponentDescriptor.new(stack_prefix,
49
+ EC2Descriptor.new(EC2_COMPONENT, EC2_NAME),
50
+ ELBDescriptor.new(ELB_ID, ELB_NAME))
51
+ @asg_client = params[:AutoScalingClient]
52
+ @cloud_watch_client = params[:CloudWatchClient]
53
+ @cloud_watch_log_client = params[:CloudWatchLogsClient]
54
+ @ec2_resource = params[:Ec2Resource]
55
+ @elb_client = params[:ElbClient]
56
+ end
57
+
58
+ def terminate_all_instances
59
+ get_all_instances.each do |i|
60
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
61
+
62
+ i.terminate
63
+ i.wait_until_terminated
64
+ end
65
+ end
66
+
67
+ def terminate_random_instance
68
+ instance = get_random_instance
69
+ instance.terminate
70
+ instance.wait_until_terminated
71
+ end
72
+
73
+ def get_tags
74
+ tags = []
75
+ get_all_instances.each do |i|
76
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
77
+
78
+ tags.push(i.tags)
79
+ end
80
+ tags
81
+ end
82
+ end
83
+ end
84
+ end
@@ -40,7 +40,7 @@ module RubyAemAws
40
40
  # - CloudWatchClient: AWS Cloudwatch Client.
41
41
  # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
42
42
  # - Ec2Resource: AWS EC2 Resource connection.
43
- # @return new RubyAemAws::FullSet::AuthorPrimary
43
+ # @return new RubyAemAws::FullSet::Publish
44
44
  def initialize(stack_prefix, params)
45
45
  @descriptor = ComponentDescriptor.new(stack_prefix,
46
46
  EC2Descriptor.new(EC2_COMPONENT, EC2_NAME))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_aem_aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-29 00:00:00.000000000 Z
11
+ date: 2023-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-autoscaling
@@ -223,6 +223,8 @@ files:
223
223
  - lib/ruby_aem_aws/component/chaos_monkey.rb
224
224
  - lib/ruby_aem_aws/component/component_descriptor.rb
225
225
  - lib/ruby_aem_aws/component/orchestrator.rb
226
+ - lib/ruby_aem_aws/component/preview_publish.rb
227
+ - lib/ruby_aem_aws/component/preview_publish_dispatcher.rb
226
228
  - lib/ruby_aem_aws/component/publish.rb
227
229
  - lib/ruby_aem_aws/component/publish_dispatcher.rb
228
230
  - lib/ruby_aem_aws/component/stack_manager_resources.rb