Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional targets_list argument #3

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?
ptqa marked this conversation as resolved.
Show resolved Hide resolved
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