Add scheduled actions in deployment entity
This commit is contained in:
parent
d3b9e4ef38
commit
2dd7339c01
3 changed files with 11 additions and 2 deletions
|
@ -245,10 +245,14 @@ module Ci
|
||||||
.fabricate!
|
.fabricate!
|
||||||
end
|
end
|
||||||
|
|
||||||
def other_actions
|
def other_manual_actions
|
||||||
pipeline.manual_actions.where.not(name: name)
|
pipeline.manual_actions.where.not(name: name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def other_scheduled_actions
|
||||||
|
pipeline.scheduled_actions.where.not(name: name)
|
||||||
|
end
|
||||||
|
|
||||||
def pages_generator?
|
def pages_generator?
|
||||||
Gitlab.config.pages.enabled &&
|
Gitlab.config.pages.enabled &&
|
||||||
self.name == 'pages'
|
self.name == 'pages'
|
||||||
|
|
|
@ -44,7 +44,11 @@ class Deployment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def manual_actions
|
def manual_actions
|
||||||
@manual_actions ||= deployable.try(:other_actions)
|
@manual_actions ||= deployable.try(:other_manual_actions)
|
||||||
|
end
|
||||||
|
|
||||||
|
def scheduled_actions
|
||||||
|
@scheduled_actions ||= deployable.try(:other_scheduled_actions)
|
||||||
end
|
end
|
||||||
|
|
||||||
def includes_commit?(commit)
|
def includes_commit?(commit)
|
||||||
|
|
|
@ -25,4 +25,5 @@ class DeploymentEntity < Grape::Entity
|
||||||
expose :commit, using: CommitEntity
|
expose :commit, using: CommitEntity
|
||||||
expose :deployable, using: JobEntity
|
expose :deployable, using: JobEntity
|
||||||
expose :manual_actions, using: JobEntity
|
expose :manual_actions, using: JobEntity
|
||||||
|
expose :scheduled_actions, using: JobEntity
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue