Commit fd4e0703 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Add play type

parent 3f85c3ef
...@@ -110,8 +110,12 @@ module Ci ...@@ -110,8 +110,12 @@ module Ci
project.builds_enabled? && commands.present? && manual? && skipped? project.builds_enabled? && commands.present? && manual? && skipped?
end end
def close_environment?
options.fetch(:environment, {}).fetch(:close, false)
end
def closes_environment?(name) def closes_environment?(name)
environment == name && options.fetch(:environment, {}).fetch(:close, false) environment == name && close_environment?
end end
def play(current_user = nil) def play(current_user = nil)
...@@ -125,6 +129,16 @@ module Ci ...@@ -125,6 +129,16 @@ module Ci
end end
end end
def play_type
return nil unless playable?
if close_environment?
:close
else
:play
end
end
def retryable? def retryable?
project.builds_enabled? && commands.present? && complete? project.builds_enabled? && commands.present? && complete?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment