Commit fd4e0703 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Add play type

parent 3f85c3ef
......@@ -110,8 +110,12 @@ module Ci
project.builds_enabled? && commands.present? && manual? && skipped?
end
def close_environment?
options.fetch(:environment, {}).fetch(:close, false)
end
def closes_environment?(name)
environment == name && options.fetch(:environment, {}).fetch(:close, false)
environment == name && close_environment?
end
def play(current_user = nil)
......@@ -125,6 +129,16 @@ module Ci
end
end
def play_type
return nil unless playable?
if close_environment?
:close
else
:play
end
end
def retryable?
project.builds_enabled? && commands.present? && complete?
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