Skip to content

Commit 6f72764

Browse files
authored
[#170425434] Add optional targets_list argument (#3)
1 parent 5bebdeb commit 6f72764

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

bin/blue_green_switch

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ REGION = "us-west-2".freeze
66
tg_name = ARGV[0]
77
color = ARGV[1]
88
color_port = ARGV[2]
9+
targets_list = ARGV[3]
910

1011
if color_port.nil?
1112
fail "Cannot detect current color_port. Color_port not passed in cli?"
@@ -28,8 +29,15 @@ targets = AWSClient.elbv2.describe_target_health(target_group_arn: tg.target_gro
2829
.target_health_descriptions.map(&:target)
2930
targets_port = targets.map(&:port).uniq.first
3031

32+
if targets_list.nil?
33+
targets_ids = targets.map(&:id)
34+
else
35+
targets_ids = targets_list.split(",")
36+
end
37+
3138
new_targets = []
32-
targets.map(&:id).each do |i|
39+
40+
targets_ids.each do |i|
3341
new_targets <<
3442
{
3543
id: i,

deploy-tools.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22
s.name = 'deploy-tools'
3-
s.version = '0.1.1'
4-
s.date = '2022-02-01'
3+
s.version = '0.1.2'
4+
s.date = '2022-06-28'
55
s.summary = "Deploy tools"
66
s.description = "A set of script used for deployment"
77
s.authors = ["Tony Nyurkin", "Serhii Voronoi"]

0 commit comments

Comments
 (0)