Skip to content

Commit

Permalink
[#170425434] Add optional targets_list argument (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
TokRa13 authored Jun 30, 2022
1 parent 5bebdeb commit 6f72764
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion bin/blue_green_switch
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ REGION = "us-west-2".freeze
tg_name = ARGV[0]
color = ARGV[1]
color_port = ARGV[2]
targets_list = ARGV[3]

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

if targets_list.nil?
targets_ids = targets.map(&:id)
else
targets_ids = targets_list.split(",")
end

new_targets = []
targets.map(&:id).each do |i|

targets_ids.each do |i|
new_targets <<
{
id: i,
Expand Down
4 changes: 2 additions & 2 deletions deploy-tools.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'deploy-tools'
s.version = '0.1.1'
s.date = '2022-02-01'
s.version = '0.1.2'
s.date = '2022-06-28'
s.summary = "Deploy tools"
s.description = "A set of script used for deployment"
s.authors = ["Tony Nyurkin", "Serhii Voronoi"]
Expand Down

0 comments on commit 6f72764

Please sign in to comment.