Skip to content
Open
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 lib/stax/mixin/codepipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def tail(name = nil)
name ||= my.stack_pipeline_names.first
last_seen = nil
loop do
sleep 5
state = Aws::Codepipeline.state(name)
now = Time.now
stages = state.stage_states.map do |s|
Expand All @@ -120,7 +121,14 @@ def tail(name = nil)
[s.stage_name, color(s&.latest_execution&.status || '', COLORS), "#{ago} ago", revisions].join(' ')
end
puts [set_color(now, :blue), stages].flatten.join(' ')
sleep 5
if stages.none? { |stage| stage.match? /InProgress/ }
if stages.all? { |stage| stage.match? /Succeeded/ }
puts set_color("All stages succeeded!", :green)
else
puts set_color("Pipeline did not complete successfully.", :red)
end
break
end
end
end

Expand Down